From: myoungwon oh Date: Sat, 31 Oct 2020 05:48:45 +0000 (+0900) Subject: mon: add error check and a comment to explain why interr.clear() is needed X-Git-Tag: v16.1.0~374^2~32 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fe484f3b5d069ef5d9dd0e37f3ef8b0f21676502;p=ceph.git mon: add error check and a comment to explain why interr.clear() is needed Signed-off-by: Myoungwon Oh --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index e38c598b3898..3fe9cf37c9e7 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -8662,6 +8662,10 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap, return -EINVAL; } } else if (var == "dedup_tier") { + if (interr.empty()) { + ss << "expecting value 'pool name'"; + return -EINVAL; + } // Current base tier in dedup does not support ec pool if (p.is_erasure()) { ss << "pool '" << poolstr @@ -8676,6 +8680,8 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap, const pg_pool_t *tp = osdmap.get_pg_pool(lowtierpool_id); ceph_assert(tp); n = lowtierpool_id; + // The original input is string (pool name), but we convert it to int64_t. + // So, clear interr interr.clear(); } else if (var == "dedup_chunk_algorithm") { if (!unset) {