From: Patrick Donnelly Date: Tue, 5 Mar 2024 17:19:42 +0000 (-0500) Subject: mds: prevent new wrlocks on LocalLock if there exists any xlock waiter X-Git-Tag: testing/wip-batrick-testing-20240411.154038~154^2~11 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=bddd3c72014dc7aa4bb4f16e4633111a0f2e0bb0;p=ceph-ci.git mds: prevent new wrlocks on LocalLock if there exists any xlock waiter Otherwise, an xlock waiter can become starved as a LocalLock supports multiple writers. Strictly speaking, a new lock state would be appropriate for this but we cheat frequently with the LocalLock -- there is only one state. All transition checks are already manually performed by the Locker. Signed-off-by: Patrick Donnelly --- diff --git a/src/mds/LocalLockC.h b/src/mds/LocalLockC.h index 4d26a1c3e14..a4df37bbcfe 100644 --- a/src/mds/LocalLockC.h +++ b/src/mds/LocalLockC.h @@ -34,7 +34,7 @@ public: } bool can_wrlock() const { - return !is_xlocked(); + return !is_xlocked() && !is_waiter_for(SimpleLock::WAIT_XLOCK); } void get_wrlock(client_t client) { ceph_assert(can_wrlock());