From: xie xingguo Date: Thu, 21 Mar 2019 08:19:49 +0000 (+0800) Subject: mon/ConfigMonitor: kill improper assert X-Git-Tag: v15.0.0~111^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b4eb1f0ed8c5ef490884898816ee6e701cd95ab4;p=ceph.git mon/ConfigMonitor: kill improper assert otherwise it can be reliably triggerred by the following command: ceph config reset 0 There are two ways to fix this problem: - add some more santicy checks and prevent user from passing in any kind of non-positive (not permitted) value - kill the assert instead Option 2 sounds to be the preferred choice for me since "0" in general is the natural representation of "nothing" and hence could always be used to revert everything to its default or initiative state. But perhaps I am the only one? Signed-off-by: xie xingguo --- diff --git a/src/mon/ConfigMonitor.cc b/src/mon/ConfigMonitor.cc index 3e08b8a49f0ca..d550af8fe1e48 100644 --- a/src/mon/ConfigMonitor.cc +++ b/src/mon/ConfigMonitor.cc @@ -540,7 +540,6 @@ bool ConfigMonitor::prepare_command(MonOpRequestRef op) err = 0; goto reply; } - ceph_assert(num > 0); ceph_assert((version_t)num < version); for (int64_t v = version; v > num; --v) { ConfigChangeSet ch;