linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jing Xiangfeng <jingxiangfeng@huawei.com>
To: <rpeterso@redhat.com>, <agruenba@redhat.com>, <adas@redhat.com>
Cc: <cluster-devel@redhat.com>, <linux-kernel@vger.kernel.org>,
	<jingxiangfeng@huawei.com>
Subject: [PATCH] gfs2: Fix error handling in init_statfs()
Date: Mon, 28 Jun 2021 19:14:50 +0800	[thread overview]
Message-ID: <20210628111450.194262-1-jingxiangfeng@huawei.com> (raw)

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


             reply	other threads:[~2021-06-28 11:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 11:14 Jing Xiangfeng [this message]
2021-06-28 12:23 ` [PATCH] gfs2: Fix error handling in init_statfs() Andreas Gruenbacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210628111450.194262-1-jingxiangfeng@huawei.com \
    --to=jingxiangfeng@huawei.com \
    --cc=adas@redhat.com \
    --cc=agruenba@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpeterso@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).