All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Josef Bacik <josef@toxicpanda.com>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 2/2] btrfs: return errors from btrfs_del_csums in cleanup_ref_head
Date: Thu, 20 May 2021 09:02:42 +0800	[thread overview]
Message-ID: <27ee833d-1430-b533-0aab-3f8f2c6f0bce@gmx.com> (raw)
In-Reply-To: <73314ceb4a87c4a6fc559834235e63f7aae79570.1621435862.git.josef@toxicpanda.com>



On 2021/5/19 下午10:52, Josef Bacik wrote:
> We are unconditionally returning 0 in cleanup_ref_head, despite the fact
> that btrfs_del_csums could fail.  We need to return the error so the
> transaction gets aborted properly, fix this by returning ret from
> btrfs_del_csums in cleanup_ref_head.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> ---
>   fs/btrfs/extent-tree.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index b84bbc24ff57..790de24576ac 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -1826,7 +1826,7 @@ static int cleanup_ref_head(struct btrfs_trans_handle *trans,
>
>   	struct btrfs_fs_info *fs_info = trans->fs_info;
>   	struct btrfs_delayed_ref_root *delayed_refs;
> -	int ret;
> +	int ret = 0;
>
>   	delayed_refs = &trans->transaction->delayed_refs;
>
> @@ -1868,7 +1868,7 @@ static int cleanup_ref_head(struct btrfs_trans_handle *trans,
>   	trace_run_delayed_ref_head(fs_info, head, 0);
>   	btrfs_delayed_ref_unlock(head);
>   	btrfs_put_delayed_ref_head(head);
> -	return 0;
> +	return ret;
>   }
>
>   static struct btrfs_delayed_ref_head *btrfs_obtain_ref_head(
>

  reply	other threads:[~2021-05-20  1:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 14:52 [PATCH 0/2] btrfs_del_csums error handling fixes Josef Bacik
2021-05-19 14:52 ` [PATCH 1/2] btrfs: fix error handling in btrfs_del_csums Josef Bacik
2021-05-20  1:02   ` Qu Wenruo
2021-05-19 14:52 ` [PATCH 2/2] btrfs: return errors from btrfs_del_csums in cleanup_ref_head Josef Bacik
2021-05-20  1:02   ` Qu Wenruo [this message]
2021-05-21 12:20   ` David Sterba
2021-05-21 12:24 ` [PATCH 0/2] btrfs_del_csums error handling fixes David Sterba

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=27ee833d-1430-b533-0aab-3f8f2c6f0bce@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.