]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: take xlock in the order requests start locking 35345/head
authorYan, Zheng <zyan@redhat.com>
Mon, 27 Apr 2020 06:48:33 +0000 (14:48 +0800)
committerSidharth Anupkrishnan <sanupkri@redhat.com>
Tue, 2 Jun 2020 11:35:39 +0000 (17:05 +0530)
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 b2728189847c0e8078e51734bab016440e23edeb..3159e06d63ec5110df46fb4df2aad9c589803a92 100644 (file)
@@ -1651,7 +1651,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);