]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: set stopping to true during suicide()
authorhuanwen ren <ren.huanwen@zte.com.cn>
Thu, 26 May 2016 11:36:38 +0000 (19:36 +0800)
committerhuanwen ren <ren.huanwen@zte.com.cn>
Thu, 26 May 2016 11:36:38 +0000 (19:36 +0800)
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 <ren.huanwen@zte.com.cn>
src/mds/MDSDaemon.cc

index e7d9fe51b13fdf3a4fe6544168ada431713f44a7..e338226c0590e0af1d55781932ab2999c6fdb500 100644 (file)
@@ -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;