]> git-server-git.apps.pok.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 <vumrao@redhat.com>
Mon, 7 Oct 2019 20:54:28 +0000 (13:54 -0700)
Fixes: https://tracker.ceph.com/issues/42111
Signed-off-by: Vikhyat Umrao <vumrao@redhat.com>
src/mon/OSDMonitor.cc

index fbd231c06119dac28f07d3133b6b171760761036..bb4b6064d5c80747de0966fbbc0de6fbfd3a46f4 100644 (file)
@@ -7894,6 +7894,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;