]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: drop loner on gather before doing waiters
authorSage Weil <sage@newdream.net>
Thu, 2 Jul 2009 17:21:51 +0000 (10:21 -0700)
committerSage Weil <sage@newdream.net>
Thu, 2 Jul 2009 17:21:51 +0000 (10:21 -0700)
Otherwise we would reissue/use caps on loner in non-loner states, and go
back.

src/mds/Locker.cc

index ccba8b109f4bd371b0c7b1846ef587ba7f227883..c7f8d532b335fb6704416acf0e78f79b14fd6a4c 100644 (file)
@@ -523,6 +523,18 @@ void Locker::eval_gather(SimpleLock *lock, bool first, bool *need_issue)
        lock->is_stable())
       lock->get_parent()->auth_unpin(lock);
 
+    // drop loner before doing waiters
+    if (caps &&
+       in->is_auth() && in->get_loner() >= 0 &&
+       in->multiple_nonstale_caps()) {
+      dout(10) << "  trying to drop loner" << dendl;
+      if (in->try_drop_loner()) {
+       dout(10) << "  dropped loner" << dendl;
+       if (need_issue)
+         *need_issue = true;
+      }
+    }
+
     lock->finish_waiters(SimpleLock::WAIT_STABLE|SimpleLock::WAIT_WR|SimpleLock::WAIT_RD|SimpleLock::WAIT_XLOCK);
     
     if (caps) {
@@ -1027,6 +1039,7 @@ void Locker::file_update_finish(CInode *in, Mutation *mut, bool share, int clien
   }
   if (sup)
     cap->dec_suppress();
+  
   if (share && in->is_auth() && in->filelock.is_stable())
     share_inode_max_size(in);
 }