]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: should not take non-tell commands as tell ones 32517/head
authorKefu Chai <kchai@redhat.com>
Tue, 7 Jan 2020 07:36:52 +0000 (15:36 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 7 Jan 2020 07:37:08 +0000 (15:37 +0800)
this change addresses a regression introduced by a2c34794dc. in which, a
new flag, 'FLAG_TELL' was added. and it's used to check if a command is
"TELL" command. if it is, it's added to the tell/asok command registry
and monitor will handle the commands in this registry using asok hooks.

but there are some commands whose flag is "HIDDEN". and after
a2c34794dc, is_tell() takes HIDDEN commands as TELL command. that's why
`ceph_test_admin_socket_output --all` fails. because, "mds freeze" is
now wrongly considered as a TELL command. but monitor is not able to
handle is using the asok hooks.

after this change, is_tell() will not mistake "mds freeze" as a TELL
command anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/MonCommand.h

index af856510952182c76e254c511bdd9bf1caa11c8c..2d363302bfa58dfab08847051e8c6a3669aaa6e2 100644 (file)
@@ -35,7 +35,7 @@ struct MonCommand {
   // in --help output.
   static const uint64_t FLAG_TELL       = (FLAG_NOFORWARD | FLAG_HIDDEN);
 
-  bool has_flag(uint64_t flag) const { return (flags & flag) != 0; }
+  bool has_flag(uint64_t flag) const { return (flags & flag) == flag; }
   void set_flag(uint64_t flag) { flags |= flag; }
   void unset_flag(uint64_t flag) { flags &= ~flag; }