Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: fix merging data-less bios

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>

authored by

Keith Busch and committed by
Jens Axboe
fd9ecd00 727a4402

+3
+3
block/blk-merge.c
··· 737 737 { 738 738 struct bio_vec pb, nb; 739 739 740 + if (!bio_has_data(prev)) 741 + return 0; 742 + 740 743 gaps_bit = min_not_zero(gaps_bit, prev->bi_bvec_gap_bit); 741 744 gaps_bit = min_not_zero(gaps_bit, next->bi_bvec_gap_bit); 742 745