]> git.ipfire.org Git - thirdparty/linux.git/commit
gfs2: Do not cancel internal demote requests
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 17 Dec 2025 22:22:49 +0000 (22:22 +0000)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 26 Jan 2026 13:28:17 +0000 (14:28 +0100)
commit4928c36536d218ae70a1b79f1c0d3302ffe31f69
treeb3ee21e634af52e11e502f83f527bd05fe5945e9
parent5e3319932a22cefd42e6bab2d60d2a17b2e1a6fa
gfs2: Do not cancel internal demote requests

Trying to change the state of a glock may result in a "conversion
deadlock" error, indicating that the requested state transition would
cause a deadlock.  In this case, we unlock and retry the state change.
It makes no sense to try canceling those unlock requests, but the
current code is not aware of that.

In addition, if a locking request is canceled shortly after it is made,
the cancelation request can currently overtake the locking request.
This may result in deadlocks.

Fix both of these bugs by repurposing the GLF_PENDING_REPLY flag into a
GLF_MAY_CANCEL flag which is set only when the current locking request
can be canceled.  When trying to cancel a locking request in
gfs2_glock_dq(), wait for this flag to be set.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glock.c
fs/gfs2/incore.h
fs/gfs2/trace_gfs2.h