From: Kent Overstreet <kent.overstreet@linux.dev>
To: Youling Tang <youling.tang@linux.dev>
Cc: linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org,
Youling Tang <tangyouling@kylinos.cn>
Subject: Re: [PATCH] bcachefs: Fix error path of bch2_link_trans()
Date: Mon, 29 Apr 2024 23:31:21 -0400 [thread overview]
Message-ID: <ww5fcxuzfcgttglsr6cpnrxufeusw4ixe76iqp7mab3djlyfje@zozue6qvxhzy> (raw)
In-Reply-To: <20240430032839.948404-1-youling.tang@linux.dev>
On Tue, Apr 30, 2024 at 11:28:39AM +0800, Youling Tang wrote:
> From: Youling Tang <tangyouling@kylinos.cn>
>
> In bch2_link_trans(), if bch2_inode_nlink_inc() fails, it needs to
> call bch2_trans_iter_exit() in the error path.
Thanks - applied.
>
> Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
> ---
> fs/bcachefs/fs-common.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/bcachefs/fs-common.c b/fs/bcachefs/fs-common.c
> index 6c737def357e..508d029ac53d 100644
> --- a/fs/bcachefs/fs-common.c
> +++ b/fs/bcachefs/fs-common.c
> @@ -200,12 +200,12 @@ int bch2_link_trans(struct btree_trans *trans,
>
> ret = bch2_inode_peek(trans, &inode_iter, inode_u, inum, BTREE_ITER_intent);
> if (ret)
> - goto err;
> + return ret;
>
> inode_u->bi_ctime = now;
> ret = bch2_inode_nlink_inc(inode_u);
> if (ret)
> - return ret;
> + goto err;
>
> ret = bch2_inode_peek(trans, &dir_iter, dir_u, dir, BTREE_ITER_intent);
> if (ret)
> --
> 2.34.1
>
next prev parent reply other threads:[~2024-04-30 3:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-30 3:28 [PATCH] bcachefs: Fix error path of bch2_link_trans() Youling Tang
2024-04-30 3:31 ` Kent Overstreet [this message]
2024-04-30 9:18 ` Markus Elfring
2024-04-30 9:29 ` Youling Tang
2024-04-30 10:55 ` Markus Elfring
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=ww5fcxuzfcgttglsr6cpnrxufeusw4ixe76iqp7mab3djlyfje@zozue6qvxhzy \
--to=kent.overstreet@linux.dev \
--cc=linux-bcachefs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tangyouling@kylinos.cn \
--cc=youling.tang@linux.dev \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).