* [PATCH] gfs2: Fix error handling in init_statfs()
@ 2021-06-28 11:14 Jing Xiangfeng
2021-06-28 12:23 ` Andreas Gruenbacher
0 siblings, 1 reply; 2+ messages in thread
From: Jing Xiangfeng @ 2021-06-28 11:14 UTC (permalink / raw)
To: rpeterso, agruenba, adas; +Cc: cluster-devel, linux-kernel, jingxiangfeng
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 <jingxiangfeng@huawei.com>
---
fs/gfs2/ops_fstype.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index 826f77d9cff5..e9ebab1af62f 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -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;
--
2.26.0.106.g9fadedd
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gfs2: Fix error handling in init_statfs()
2021-06-28 11:14 [PATCH] gfs2: Fix error handling in init_statfs() Jing Xiangfeng
@ 2021-06-28 12:23 ` Andreas Gruenbacher
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Gruenbacher @ 2021-06-28 12:23 UTC (permalink / raw)
To: Jing Xiangfeng; +Cc: Bob Peterson, Abhijith Das, cluster-devel, LKML
Hi Jing,
On Mon, Jun 28, 2021 at 1:22 PM Jing Xiangfeng <jingxiangfeng@huawei.com> wrote:
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-28 12:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28 11:14 [PATCH] gfs2: Fix error handling in init_statfs() Jing Xiangfeng
2021-06-28 12:23 ` Andreas Gruenbacher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).