From dfcb403a00dec16aabaa5139d7f9cfea08515f06 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Sat, 24 Jun 2017 15:38:49 +0800 Subject: [PATCH] mon/OSDMonitor: fix wrong sanity check order for allow_ec_overwrites Signed-off-by: xie xingguo --- src/mon/OSDMonitor.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 6d9e7eac4a2c6..131588ef502b9 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -6021,6 +6021,12 @@ int OSDMonitor::prepare_command_pool_set(map &cmdmap, ss << "ec overwrites can only be enabled for an erasure coded pool"; return -EINVAL; } + stringstream err; + if (!g_conf->mon_debug_no_require_bluestore_for_ec_overwrites && + !is_pool_currently_all_bluestore(pool, p, &err)) { + ss << "pool must only be stored on bluestore for scrubbing to work: " << err.str(); + return -EINVAL; + } if (val == "true" || (interr.empty() && n == 1)) { p.flags |= pg_pool_t::FLAG_EC_OVERWRITES; } else if (val == "false" || (interr.empty() && n == 0)) { @@ -6030,12 +6036,6 @@ int OSDMonitor::prepare_command_pool_set(map &cmdmap, ss << "expecting value 'true', 'false', '0', or '1'"; return -EINVAL; } - stringstream err; - if (!g_conf->mon_debug_no_require_bluestore_for_ec_overwrites && - !is_pool_currently_all_bluestore(pool, p, &err)) { - ss << "pool must only be stored on bluestore for scrubbing to work: " << err.str(); - return -EINVAL; - } } else if (var == "target_max_objects") { if (interr.length()) { ss << "error parsing int '" << val << "': " << interr; -- 2.39.5