]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: take xlock in the order requests start locking 35392/head
authorYan, Zheng <zyan@redhat.com>
Mon, 27 Apr 2020 06:48:33 +0000 (14:48 +0800)
committerNathan Cutler <ncutler@suse.com>
Thu, 4 Jun 2020 12:59:08 +0000 (14:59 +0200)
this avoid assertion in MutaionImpl::finish_locking()

Fix: https://tracker.ceph.com/issues/45261
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit 2e11a35d5b06312e0b2d0aecd83e8eb882ddf719)

src/mds/Locker.cc

index cf3c7aa5e3870066ffe05db09b8fd40f995cdd90..284cb254e5d4943b89fdd86c11e932abe5316c24 100644 (file)
@@ -1612,7 +1612,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);