]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: add error check and a comment to explain why interr.clear() is needed
authormyoungwon oh <ohmyoungwon@gmail.com>
Sat, 31 Oct 2020 05:48:45 +0000 (14:48 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Sat, 31 Oct 2020 05:51:28 +0000 (14:51 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsumg.com>
src/mon/OSDMonitor.cc

index e38c598b3898d9b84bf98909e7e8da9af6e2dba7..3fe9cf37c9e7bdf9bcd2480ce20d4bce7b3fd5ae 100644 (file)
@@ -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) {