]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/config: fix rm_val error codes
authorSage Weil <sage@redhat.com>
Mon, 4 Jun 2018 15:59:51 +0000 (10:59 -0500)
committerNathan Cutler <ncutler@suse.com>
Wed, 13 Jun 2018 16:46:13 +0000 (18:46 +0200)
EINVAL if the config option is invalid.
ENOENT if the config option wasn't set.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 4f957a4ad7fb7029435f38a1da086d59f34f3428)

src/common/config.cc

index d4649ae2fe8bea32ee60a267736997fd4ca5ea47..8becf6a42c00ee328be336040cb7d6fd226f0fa7 100644 (file)
@@ -1413,6 +1413,9 @@ void md_config_t::_refresh(const Option& opt)
 
 int md_config_t::_rm_val(const std::string& key, int level)
 {
+  if (schema.count(key) == 0) {
+    return -EINVAL;
+  }
   auto i = values.find(key);
   if (i == values.end()) {
     return -ENOENT;