gfs2: harden gfs2_glock_hold

Function gfs2_glock_hold() is expected only to be called when the glock is
held, so use lockref_get_not_zero() instead of lockref_get_not_dead().

In addition, when an asynchronous callback arrives in gfs2_glock_cb(), the
glock can already be dead (from __gfs2_glock_put()), or it can be on the glock
lru list with refcount 0, so we cannot use gfs2_glock_hold() there.

With gfs2_glock_cb() now handling dead glocks, we can remove the racy check in
gdlm_bast().

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
This commit is contained in:
Andreas Gruenbacher 2026-08-12 12:08:06 +02:00
commit 657e5af4fe
2 changed files with 4 additions and 5 deletions