]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: can_xlock_soon() should include LOCK_LOCK
authorSage Weil <sage@newdream.net>
Fri, 9 Jan 2009 18:44:02 +0000 (10:44 -0800)
committerSage Weil <sage@newdream.net>
Fri, 9 Jan 2009 18:44:02 +0000 (10:44 -0800)
i.e., if we are already xlocked.  This avoids calling {file,scatter}_lock
on an already LOCK_LOCK lock.

src/mds/FileLock.h
src/mds/Locker.cc
src/mds/ScatterLock.h

index cb83c662004cb8feb49a96643305946893559967..fa87e14fa7045da73af6af699e4b08410df7a84d 100644 (file)
@@ -168,7 +168,8 @@ class FileLock : public ScatterLock {
     if (parent->is_auth())
       return (state == LOCK_SYNC_LOCK ||
              state == LOCK_LONER_LOCK ||
-             state == LOCK_MIXED_LOCK);
+             state == LOCK_MIXED_LOCK ||
+             state == LOCK_LOCK);
     else
       return false;
   }
index 930fa557d59dee10f8a128eaca0d917ed84c4a09..41a9c24a1c291c715662de2e16afcb658eb4cabd 100644 (file)
@@ -2276,6 +2276,7 @@ bool Locker::scatter_xlock_start(ScatterLock *lock, MDRequest *mut)
       }
       
       // initiate lock 
+      assert(lock->get_state() != LOCK_LOCK);
       scatter_lock(lock);
       
       // fall-thru to below.
@@ -3322,7 +3323,8 @@ bool Locker::file_xlock_start(FileLock *lock, MDRequest *mut)
        return false;
       }
       
-      // initiate lock 
+      // initiate lock
+      assert(lock->get_state() != LOCK_LOCK);
       file_lock(lock);
       
       // fall-thru to below.
index 3853b9535e8f2657542cd1762013a9446ecba118..ccf72f911400a5fc4eccd14eaca320376650b879 100644 (file)
@@ -144,7 +144,8 @@ public:
   bool can_xlock_soon() {
     if (parent->is_auth())
       return (state == LOCK_SCATTER_LOCK ||
-             state == LOCK_SYNC_LOCK);
+             state == LOCK_SYNC_LOCK ||
+             state == LOCK_LOCK);
     else
       return false;
   }