Re: [PATCH v2] xfs: check split_sectors validity before bio_split call
From: Christoph Hellwig
Date: Wed Jul 29 2026 - 05:02:49 EST
On Wed, Jul 29, 2026 at 03:34:18PM +0800, Hongling Zeng wrote:
> Change the split_sectors check from !split_sectors to split_sectors <= 0
> to make the error handling explicit. While bio_split_rw_at() cannot return
> a negative error code for the current GC I/O path (GC I/O doesn't use
> REQ_ATOMIC/REQ_NOWAIT flags and has proper alignment), making the check
> explicit improves code clarity and makes the intent clear.
>
> This also makes the code more robust for future maintenance if different
> I/O patterns are introduced.
>
> Signed-off-by: Hongling Zeng <zenghongling@xxxxxxxxxx>
Looks good:
Reviewed-by: Christoph Hellwig <hch@xxxxxx>