gfs2: Fix error handling in init_statfs()
PATCH 1/1 gfs2: Fix error handling in init_statfs()
In an error path of init_statfs(), it calls iput to put pn which has been put. Jump to correct label to fix it.
Fixes 97fd734ba17e ("gfs2: lookup local statfs inodes prior to journal recovery")
Signed-off-by Jing Xiangfeng <[email protected]>
--- fs/gfs2/ops_fstype.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/gfs2/ops_fstype.c +2 -1
@@ -692,7 +692,8 @@ static int init_statfs(struct gfs2_sbd *sdp) &sdp->sd_sc_gh);if (error) {fs_err (sdp,"can't lock local \"sc\" file: %d\n" , error); - goto free_local; +free_local_statfs_inodes (sdp); + goto put_statfs; }return 0 ;
Signature · 1 line
2.26.0.106.g9fadedd
Andreas Gruenbacher
maintainerHi Jing,
Quoted 2 lines · Jing Xiangfeng
In an error path of
init_statfs(), it calls iput to put pn which has been put. Jump to correct label to fix it.
thanks for your patch. This looks okay, but I'd rather set pn to NULL after the iput instead. Since iput(NULL) is a no-op, we'll end up with the same result.
Andreas