]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
uclient: wait for mds sessions close on unmount
authorSage Weil <sage@newdream.net>
Thu, 18 Jun 2009 23:35:18 +0000 (16:35 -0700)
committerSage Weil <sage@newdream.net>
Thu, 18 Jun 2009 23:42:35 +0000 (16:42 -0700)
src/client/Client.cc

index a07d1c09a3b6910a66f9470c15d592efa9f58e05..3c4ff5a20e0315e1101a7889de9f301d5984fc59 100644 (file)
@@ -892,6 +892,7 @@ void Client::handle_client_session(MClientSession *m)
 
   case CEPH_SESSION_CLOSE:
     mds_sessions.erase(from);
+    mount_cond.Signal();
     // FIXME: kick requests (hard) so that they are redirected.  or fail.
     break;
 
@@ -2420,6 +2421,12 @@ int Client::unmount()
                            mdsmap->get_inst(p->first));
   }
 
+  // wait for sessions to close
+  while (mds_sessions.size()) {
+    dout(2) << "waiting for " << mds_sessions.size() << " mds sessions to close" << dendl;
+    mount_cond.Wait(client_lock);
+  }
+
   // leave cluster
   client_lock.Unlock();
   monclient->unmount();