From b4eb1f0ed8c5ef490884898816ee6e701cd95ab4 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Thu, 21 Mar 2019 16:19:49 +0800 Subject: [PATCH] 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 --- src/mon/ConfigMonitor.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mon/ConfigMonitor.cc b/src/mon/ConfigMonitor.cc index 3e08b8a49f0..d550af8fe1e 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; -- 2.39.5