]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/ConfigMonitor: kill improper assert
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 21 Mar 2019 08:19:49 +0000 (16:19 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 22 Mar 2019 10:54:17 +0000 (18:54 +0800)
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 <xie.xingguo@zte.com.cn>
src/mon/ConfigMonitor.cc

index 3e08b8a49f0ca2c797f4ad5bfefd41d7e4e52b3d..d550af8fe1e48ef6859309278ce03cd39a65000e 100644 (file)
@@ -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;