]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: do not acquire xlock in xlockdone state 49539/head
authorIgor Fedotov <igor.fedotov@croit.io>
Fri, 4 Nov 2022 18:43:25 +0000 (21:43 +0300)
committerIgor Fedotov <igor.fedotov@croit.io>
Thu, 22 Dec 2022 08:47:57 +0000 (11:47 +0300)
Fixes: https://tracker.ceph.com/issues/49132
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
(cherry picked from commit 2e37d1e3c4af071d4e09df603c141f38cadda69f)

src/mds/Locker.cc

index a73c4225cbf27d58986db974401249b03058faee..409185f7398ff95a7763f31e950302da6a795e3b 100644 (file)
@@ -1925,8 +1925,13 @@ bool Locker::xlock_start(SimpleLock *lock, MDRequestRef& mut)
       }
 
       if (!lock->is_stable() && (lock->get_state() != LOCK_XLOCKDONE ||
-                                lock->get_xlock_by_client() != client ||
-                                lock->is_waiter_for(SimpleLock::WAIT_STABLE)))
+                                lock->get_xlock_by_client() != client ||
+                                lock->is_waiter_for(SimpleLock::WAIT_STABLE)))
+       break;
+      // Avoid unstable XLOCKDONE state reset,
+      // see: https://tracker.ceph.com/issues/49132
+      if (lock->get_state() == LOCK_XLOCKDONE &&
+          lock->get_type() == CEPH_LOCK_IFILE)
        break;
 
       if (lock->get_state() == LOCK_LOCK || lock->get_state() == LOCK_XLOCKDONE) {