From: Christoph Hellwig <hch@infradead.org>
To: Hongling Zeng <zenghongling@kylinos.cn>
Cc: cem@kernel.org, djwong@kernel.org, hans.holmberg@wdc.com,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
zhongling0719@126.com, stable@vger.kernel.org
Subject: Re: [PATCH] xfs: check split_sectors validity before bio_split call
Date: Tue, 28 Jul 2026 23:52:21 -0700 [thread overview]
Message-ID: <ammjJTqoOHsW9AXJ@infradead.org> (raw)
In-Reply-To: <20260729063117.54540-1-zenghongling@kylinos.cn>
On Wed, Jul 29, 2026 at 02:31:17PM +0800, Hongling Zeng wrote:
> Fix by changing the check from !split_sectors to split_sectors <= 0
> immediately after bio_split_rw_at() and before any arithmetic operations.
> This prevents both the negative error code propagation and the undefined
> behavior from left-shifting negative values.
>
> When NULL is returned, the caller's while loop naturally terminates,
> which is the correct behavior for "cannot split" cases.
>
> Fixes: 080d01c41d44f ("xfs: implement zoned garbage collection")
> Cc: <stable@vger.kernel.org>
Nothing can actually hit that. It only happens for invalid flags,
or unaligned I/O, none of which can happen for GC I/O.
I think checking all cases of the return value is fine, but the fixes
is a bit bogus, and it really is not stable material.
next prev parent reply other threads:[~2026-07-29 6:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 6:31 [PATCH] xfs: check split_sectors validity before bio_split call Hongling Zeng
2026-07-29 6:52 ` Christoph Hellwig [this message]
2026-07-29 7:35 ` Hongling Zeng
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=ammjJTqoOHsW9AXJ@infradead.org \
--to=hch@infradead.org \
--cc=cem@kernel.org \
--cc=djwong@kernel.org \
--cc=hans.holmberg@wdc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=stable@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