]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: add check for crush rule size in pool set size command
authorVikhyat Umrao <vumrao@redhat.com>
Fri, 4 Oct 2019 17:54:51 +0000 (10:54 -0700)
committerVikhyat Umrao <vikhyat@redhat.com>
Tue, 15 Oct 2019 17:21:14 +0000 (10:21 -0700)
Fixes: https://tracker.ceph.com/issues/42111
Signed-off-by: Vikhyat Umrao <vumrao@redhat.com>
(cherry picked from commit ddc467f82f32140213bfa439f0a6cc31d945d2f2)

src/mon/OSDMonitor.cc

index 3f50e6fd3d261a169caa87485ab046533c02017b..001ca530ee86719b4f785034d42a4757a4c7a248 100644 (file)
@@ -7151,6 +7151,9 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap,
       ss << "pool size must be between 1 and 10";
       return -EINVAL;
     }
+    if (!osdmap.crush->check_crush_rule(p.get_crush_rule(), p.type, n, ss)) {
+      return -EINVAL;
+    }
     int r = check_pg_num(pool, p.get_pg_num(), n, &ss);
     if (r < 0) {
       return r;