]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make sure lock state not stay in XLOCK/XLOCKDONE indefinitely 4223/head
authorYan, Zheng <zyan@redhat.com>
Tue, 31 Mar 2015 07:05:05 +0000 (15:05 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 31 Mar 2015 07:08:20 +0000 (15:08 +0800)
Fixes: #11254
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/Locker.cc

index 97b1583369cd90f3e886dd3106b38e91652f2c14..9af0fe25e54274ce80b8d6c52552561821d25ad7 100644 (file)
@@ -1519,8 +1519,9 @@ bool Locker::xlock_start(SimpleLock *lock, MDRequestRef& mut)
        }
       }
 
-      if (!lock->is_stable() && !(lock->get_state() == LOCK_XLOCKDONE &&
-                                 lock->get_xlock_by_client() == client))
+      if (!lock->is_stable() && (lock->get_state() != LOCK_XLOCKDONE ||
+                                lock->get_xlock_by_client() != client ||
+                                lock->is_waiter_for(SimpleLock::WAIT_STABLE)))
        break;
 
       if (lock->get_state() == LOCK_LOCK || lock->get_state() == LOCK_XLOCKDONE) {