From: Boris Burkov <boris@bur.io>
To: Hongling Zeng <zenghongling@kylinos.cn>
Cc: clm@fb.com, dsterba@suse.com, linux-btrfs@vger.kernel.org,
linux-kernel@vger.kernel.org, zhongling0719@126.com,
David Sterba <dsterba@suse.cz>
Subject: Re: [PATCH v2] btrfs: Add missing sctx check in cleanup path
Date: Fri, 17 Jul 2026 12:51:03 -0700 [thread overview]
Message-ID: <20260717195103.GA142812@zen.localdomain> (raw)
In-Reply-To: <20260714012850.611545-1-zenghongling@kylinos.cn>
On Tue, Jul 14, 2026 at 09:28:50AM +0800, Hongling Zeng wrote:
> Add sctx NULL check in the for loop condition of the sort_clone_roots
> cleanup path for consistency with the else branch
>
Reviewed-by: Boris Burkov <boris@bur.io>
> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
> Suggested-by: David Sterba <dsterba@suse.cz>
> ---
> Change in v2:
> -Uses the same pattern: for (i = 0; sctx && i < clone_sources_to_rollback; i++)
> ,suggested by David
> ---
> fs/btrfs/send.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
> index 3ae480c7474b..297704edf1b4 100644
> --- a/fs/btrfs/send.c
> +++ b/fs/btrfs/send.c
> @@ -8251,7 +8251,7 @@ long btrfs_ioctl_send(struct btrfs_root *send_root, const struct btrfs_ioctl_sen
> }
>
> if (sort_clone_roots) {
> - for (i = 0; i < sctx->clone_roots_cnt; i++) {
> + for (i = 0; sctx && i < sctx->clone_roots_cnt; i++) {
> btrfs_root_dec_send_in_progress(
> sctx->clone_roots[i].root);
> btrfs_put_root(sctx->clone_roots[i].root);
> --
> 2.25.1
>
next prev parent reply other threads:[~2026-07-17 19:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 1:28 [PATCH v2] btrfs: Add missing sctx check in cleanup path Hongling Zeng
2026-07-17 19:51 ` Boris Burkov [this message]
2026-07-20 10:57 ` 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=20260717195103.GA142812@zen.localdomain \
--to=boris@bur.io \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zenghongling@kylinos.cn \
--cc=zhongling0719@126.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