From c5e53526bd9c22429bd247399d9cf22bf5f48cf2 Mon Sep 17 00:00:00 2001 From: Mingxin Liu Date: Wed, 2 Dec 2015 09:50:28 +0800 Subject: [PATCH] mon: fix OSDMonitor::_check_become_tier cannot prevent client from setting multiple tiers in a particular way Fixes:#13950 Signed-off-by: Mingxin Liu --- src/mon/OSDMonitor.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 3578b7933bdf..551d6001fb9b 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -7738,6 +7738,16 @@ bool OSDMonitor::_check_become_tier( return false; } + if (tier_pool->has_tiers()) { + *ss << "pool '" << tier_pool_name << "' has following tier(s) already:"; + for (set::iterator it = tier_pool->tiers.begin(); + it != tier_pool->tiers.end(); it++) + *ss << "'" << osdmap.get_pool_name(*it) << "',"; + *ss << " multiple tiers are not yet supported."; + *err = -EINVAL; + return false; + } + if (tier_pool->is_tier()) { *ss << "tier pool '" << tier_pool_name << "' is already a tier of '" << osdmap.get_pool_name(tier_pool->tier_of) << "'"; -- 2.47.3