]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: only kick head on snap rdlock if in SNAP_SYNC state
authorSage Weil <sage@newdream.net>
Fri, 13 Aug 2010 21:20:39 +0000 (14:20 -0700)
committerSage Weil <sage@newdream.net>
Mon, 16 Aug 2010 15:29:48 +0000 (08:29 -0700)
We may, e.g., be in the SCAN state, which is totally unrelated to the
head!

src/mds/Locker.cc

index 299351f0a0971736cdfddb1845e7c01249c47e5c..85d29030bb5c2b6536eff31e33de054fec24232d 100644 (file)
@@ -783,7 +783,8 @@ bool Locker::rdlock_start(SimpleLock *lock, MDRequest *mut, bool as_anon)
   if (lock->get_type() != CEPH_LOCK_DN)
     in = (CInode *)lock->get_parent();
   
-  if (in && !in->is_head() && in->is_auth()) {
+  if (in && !in->is_head() && in->is_auth() &&
+      lock->get_state() == LOCK_SNAP_SYNC) {
     // okay, we actually need to kick the head's lock to get ourselves synced up.
     CInode *head = mdcache->get_inode(in->ino());
     assert(head);