]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Now actually requeues blocked locks whenever locks are removed.
authorGreg Farnum <gregf@hq.newdream.net>
Thu, 29 Apr 2010 23:09:27 +0000 (16:09 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Mon, 2 Aug 2010 17:39:55 +0000 (10:39 -0700)
src/mds/CInode.cc
src/mds/Server.cc

index eb93a7e473c8d122553119807ffd5ca182248a98..d7c84b8faa19f5e3c4ab7eb9a843efe89d05f99f 100644 (file)
@@ -575,6 +575,15 @@ void CInode::remove_client_cap(client_t client)
     mdcache->num_inodes_with_caps--;
   }
   mdcache->num_caps--;
+
+  //clean up advisory locks
+  bool fcntl_removed = fcntl_locks.remove_all_from(client);
+  bool flock_removed = flock_locks.remove_all_from(client);
+  if (fcntl_removed || flock_removed) {
+    list<Context*> waiters;
+    take_waiting(CInode::WAIT_FLOCK, waiters);
+    mdcache->mds->queue_waiters(waiters);
+  }
 }
 
 void CInode::move_to_realm(SnapRealm *realm)
index 32a136e37025f075f1802ef1504a82126fe156a2..ce4c721e9c54951880c18a4e5840a27782458153 100644 (file)
@@ -2605,6 +2605,9 @@ void Server::handle_client_file_setlock(MDRequest *mdr)
     /* For now we're ignoring the activated locks because their responses
      * will be sent when the lock comes up again in rotation by the MDS.
      * It's a cheap hack, but it's easy to code. */
+    list<Context*> waiters;
+    cur->take_waiting(CInode::WAIT_FLOCK, waiters);
+    mds->queue_waiters(waiters);
   } else {
     if (lock_state->add_lock(set_lock, will_wait)) {
       // lock set successfully