Skip to content

Commit c07bfb4

Browse files
author
Andreas Gruenbacher
committed
gfs2: Fix refcount leak in gfs2_glock_poke
In gfs2_glock_poke, make sure gfs2_holder_uninit is called on the local glock holder. Without that, we're leaking a glock and a pid reference. Fixes: 9e8990d ("gfs2: Smarter iopen glock waiting") Cc: [email protected] # v5.8+ Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 4c5c301 commit c07bfb4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/gfs2/glock.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,9 +790,11 @@ static void gfs2_glock_poke(struct gfs2_glock *gl)
790790
struct gfs2_holder gh;
791791
int error;
792792

793-
error = gfs2_glock_nq_init(gl, LM_ST_SHARED, flags, &gh);
793+
gfs2_holder_init(gl, LM_ST_SHARED, flags, &gh);
794+
error = gfs2_glock_nq(&gh);
794795
if (!error)
795796
gfs2_glock_dq(&gh);
797+
gfs2_holder_uninit(&gh);
796798
}
797799

798800
static bool gfs2_try_evict(struct gfs2_glock *gl)

0 commit comments

Comments
 (0)