From 4f957a4ad7fb7029435f38a1da086d59f34f3428 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 4 Jun 2018 10:59:51 -0500 Subject: [PATCH] common/config: fix rm_val error codes EINVAL if the config option is invalid. ENOENT if the config option wasn't set. Signed-off-by: Sage Weil --- src/common/config.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/config.cc b/src/common/config.cc index d4649ae2fe8..8becf6a42c0 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -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; -- 2.39.5