]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gfs2: gfs2_glock_hold cleanup
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 18 Nov 2025 20:19:45 +0000 (20:19 +0000)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 26 Jan 2026 13:28:18 +0000 (14:28 +0100)
Use lockref_get_not_dead() instead of an unguarded __lockref_is_dead()
check.

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

index 7c3d488327eef393e9bed713645d38e0ea9d4169..bba4155119205cc78b0477d104e26d45a8a5c69e 100644 (file)
@@ -185,8 +185,8 @@ static void gfs2_free_dead_glocks(struct gfs2_sbd *sdp)
 
 struct gfs2_glock *gfs2_glock_hold(struct gfs2_glock *gl)
 {
-       GLOCK_BUG_ON(gl, __lockref_is_dead(&gl->gl_lockref));
-       lockref_get(&gl->gl_lockref);
+       if (!lockref_get_not_dead(&gl->gl_lockref))
+               GLOCK_BUG_ON(gl, 1);
        return gl;
 }