From: Vikhyat Umrao Date: Fri, 4 Oct 2019 17:54:51 +0000 (-0700) Subject: mon/OSDMonitor: add check for crush rule size in pool set size command X-Git-Tag: v14.2.5~94^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ab092cffdaf66f48dc46359482e05af4b2ca6eb0;p=ceph.git mon/OSDMonitor: add check for crush rule size in pool set size command Fixes: https://tracker.ceph.com/issues/42111 Signed-off-by: Vikhyat Umrao (cherry picked from commit ddc467f82f32140213bfa439f0a6cc31d945d2f2) --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 3f50e6fd3d2..001ca530ee8 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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;