From fe484f3b5d069ef5d9dd0e37f3ef8b0f21676502 Mon Sep 17 00:00:00 2001 From: myoungwon oh Date: Sat, 31 Oct 2020 14:48:45 +0900 Subject: [PATCH] mon: add error check and a comment to explain why interr.clear() is needed Signed-off-by: Myoungwon Oh --- src/mon/OSDMonitor.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index e38c598b389..3fe9cf37c9e 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) { -- 2.39.5