]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: take xlock in the order requests start locking 34757/head
authorYan, Zheng <zyan@redhat.com>
Mon, 27 Apr 2020 06:48:33 +0000 (14:48 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 27 Apr 2020 06:52:49 +0000 (14:52 +0800)
this avoid assertion in MutaionImpl::finish_locking()

Fix: https://tracker.ceph.com/issues/45261
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/Locker.cc

index b811db4870cf315f59bcc160d4bc5ede125453fd..b249b787671139bb122e06eaf32227a21230c16a 100644 (file)
@@ -1906,7 +1906,8 @@ bool Locker::xlock_start(SimpleLock *lock, MDRequestRef& mut)
   if (lock->get_parent()->is_auth()) {
     // auth
     while (1) {
-      if (lock->can_xlock(client) &&
+      if (mut->locking && // started xlock (not preempt other request)
+         lock->can_xlock(client) &&
          !(lock->get_state() == LOCK_LOCK_XLOCK &&     // client is not xlocker or
            in && in->issued_caps_need_gather(lock))) { // xlocker does not hold shared cap
        lock->set_state(LOCK_XLOCK);