From 2a7b6f161f3ba0b5591fc2bd54e306327fd2be86 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 7 Jan 2020 15:36:52 +0800 Subject: [PATCH] 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 --- src/mon/MonCommand.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mon/MonCommand.h b/src/mon/MonCommand.h index af856510952..2d363302bfa 100644 --- a/src/mon/MonCommand.h +++ b/src/mon/MonCommand.h @@ -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; } -- 2.39.5