]> git.hungrycats.org Git - linux/commit
block: fix merging data-less bios
authorKeith Busch <kbusch@kernel.org>
Tue, 11 Nov 2025 14:06:20 +0000 (06:06 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Sep 2026 11:36:18 +0000 (13:36 +0200)
commitbf8601feeb469f517054efa274ba39c1c811b244
treed4f47e2118968912c057691489b6a6cca3cd8828
parent43a4c2afcb5ab7a0d5bf80c792c318853bebe83c
block: fix merging data-less bios

[ Upstream commit fd9ecd005252b595fd02ff7fcc4056251027404d ]

The data segment gaps the block layer tracks doesn't apply to bio's that
don't have data. Skip calculating this to fix a NULL pointer access.

Fixes: 2f6b2565d43cdb5 ("block: accumulate memory segment gaps per bio")
Reported-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Yu Kuai <yukuai@fnnas.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/blk-merge.c