block: fix get_max_io_size()

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 case of 0 in bio_split(). Restore the previous working behavior.

Change-Id: I5d4b36862fb7f7202996bcaa2c4b7d71b49e6ba6
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>
Git-commit: f09dbec9c0
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Pradeep P V K <ppvk@codeaurora.org>
This commit is contained in:
Keith Busch 2020-08-06 14:58:37 -07:00 committed by Gerrit - the friendly Code Review server
parent bcb3f4fc7d
commit 1154754b7b

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,