]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix file_eval on subtree roots
authorSage Weil <sage.weil@dreamhost.com>
Mon, 11 Apr 2011 17:14:21 +0000 (10:14 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Tue, 12 Apr 2011 04:09:24 +0000 (21:09 -0700)
We were going from mix->sync when we shouldn't.  Fix mis-coded filelock
and look at _lock_ state, not inode's!

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/mds/Locker.cc

index 3bb89ef41a2dc22bd5c9469b0400ff15cca663b5..3192ef16ba83ec2523bf2a1b97f73ce7a70175ad 100644 (file)
@@ -3710,9 +3710,9 @@ void Locker::file_eval(ScatterLock *lock, bool *need_issue)
   // * -> sync?
   else if (lock->get_state() != LOCK_SYNC &&
           !lock->is_wrlocked() &&   // drain wrlocks first!
-          !in->filelock.is_waiter_for(SimpleLock::WAIT_WR) &&
+          !lock->is_waiter_for(SimpleLock::WAIT_WR) &&
           !(wanted & (CEPH_CAP_GWR|CEPH_CAP_GBUFFER)) &&
-          !((in->get_state() == LOCK_MIX) &&
+          !((lock->get_state() == LOCK_MIX) &&
             in->is_dir() && in->has_subtree_root_dirfrag())  // if we are a delegation point, stay where we are
           //((wanted & CEPH_CAP_RD) || 
           //in->is_replicated() ||