From: Hongling Zeng <zhongling0719@126.com>
To: Christoph Hellwig <hch@infradead.org>,
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,
stable@vger.kernel.org
Subject: Re: [PATCH] xfs: check split_sectors validity before bio_split call
Date: Wed, 29 Jul 2026 15:35:18 +0800 [thread overview]
Message-ID: <6A69AD36.1070702@126.com> (raw)
In-Reply-To: <ammjJTqoOHsW9AXJ@infradead.org>
在 2026年07月29日 14:52, Christoph Hellwig 写道:
> 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.
Thanks for the review. Updated v2 below - removed Fixes/stable
tags and reworded as code improvement.
prev parent reply other threads:[~2026-07-29 7:36 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
2026-07-29 7:35 ` Hongling Zeng [this message]
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=6A69AD36.1070702@126.com \
--to=zhongling0719@126.com \
--cc=cem@kernel.org \
--cc=djwong@kernel.org \
--cc=hans.holmberg@wdc.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=zenghongling@kylinos.cn \
/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