From d5ad9076b0bd218421fb70da32a46368d924730f Mon Sep 17 00:00:00 2001 From: huanwen ren Date: Thu, 26 May 2016 19:36:38 +0800 Subject: [PATCH] mds: set stopping to true during suicide() We are using stopping flag everywhere to indicate that a shutdown procedure of the mds-daemon is already in progress, but we never set stopping to true correctly. The suicide() method is the proper place to set the stopping flag as it is the only exit for mds-daemon. Signed-off-by: huanwen ren --- src/mds/MDSDaemon.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mds/MDSDaemon.cc b/src/mds/MDSDaemon.cc index e7d9fe51b13fd..e338226c0590e 100644 --- a/src/mds/MDSDaemon.cc +++ b/src/mds/MDSDaemon.cc @@ -1049,6 +1049,10 @@ void MDSDaemon::handle_signal(int signum) void MDSDaemon::suicide() { assert(mds_lock.is_locked()); + + // make sure we don't suicide twice + assert(stopping == false); + stopping = true; dout(1) << "suicide. wanted state " << ceph_mds_state_name(beacon.get_want_state()) << dendl; -- 2.39.5