From: huanwen ren Date: Thu, 26 May 2016 11:36:38 +0000 (+0800) Subject: mds: set stopping to true during suicide() X-Git-Tag: v11.0.0~396^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d5ad9076b0bd218421fb70da32a46368d924730f;p=ceph.git 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 --- diff --git a/src/mds/MDSDaemon.cc b/src/mds/MDSDaemon.cc index e7d9fe51b13..e338226c059 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;