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: v15.1.0~1260^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ddc467f82f32140213bfa439f0a6cc31d945d2f2;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 --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index fbd231c06119..bb4b6064d5c8 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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;