Skip to content

Commit 5d49d35

Browse files
author
Andreas Gruenbacher
committed
gfs2: Fix error handling in init_statfs
On an error path, init_statfs calls iput(pn) after pn has already been put. Fix that by setting pn to NULL after the initial iput. Fixes: 97fd734 ("gfs2: lookup local statfs inodes prior to journal recovery") Cc: [email protected] # v5.10+ Reported-by: Jing Xiangfeng <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent d3c51c5 commit 5d49d35

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/gfs2/ops_fstype.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ static int init_statfs(struct gfs2_sbd *sdp)
687687
}
688688

689689
iput(pn);
690+
pn = NULL;
690691
ip = GFS2_I(sdp->sd_sc_inode);
691692
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0,
692693
&sdp->sd_sc_gh);

0 commit comments

Comments
 (0)