From ab092cffdaf66f48dc46359482e05af4b2ca6eb0 Mon Sep 17 00:00:00 2001 From: Vikhyat Umrao Date: Fri, 4 Oct 2019 10:54:51 -0700 Subject: [PATCH] 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) --- src/mon/OSDMonitor.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 3f50e6fd3d261..001ca530ee867 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; -- 2.39.5