1
0
Fork 0

block: fix get_max_io_size()

commit e4b469c66f upstream.

A previous commit aligning splits to physical block sizes inadvertently
modified one return case such that that it now returns 0 length splits
when the number of sectors doesn't exceed the physical offset. This
later hits a BUG in bio_split(). Restore the previous working behavior.

Fixes: 9cc5169cd4 ("block: Improve physical block alignment of split bios")
Reported-by: Eric Deal <eric.deal@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5.4-rM2-2.2.x-imx-squashed
Keith Busch 2020-08-06 14:58:37 -07:00 committed by Greg Kroah-Hartman
parent 2f4b202eb1
commit f09dbec9c0
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ static inline unsigned get_max_io_size(struct request_queue *q,
if (max_sectors > start_offset)
return max_sectors - start_offset;
return sectors & (lbs - 1);
return sectors & ~(lbs - 1);
}
static inline unsigned get_max_segment_size(const struct request_queue *q,