]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: do not acquire xlock in xlockdone state 49538/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:41:56 +0000 (11:41 +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 b515bcb3075a19b93bd0608248b4807965706ed0..3d432859a17b92499b9a31afd3dee7fca32ffaae 100644 (file)
@@ -1922,8 +1922,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) {