mon: should not take non-tell commands as tell ones

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>
This commit is contained in:
Kefu Chai 2020-01-07 15:36:52 +08:00
parent 53066d09ab
commit 2a7b6f161f

View 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; }