summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorKeith Busch <kbusch@kernel.org>2020-08-07 00:58:37 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-03 12:29:38 +0300
commit7b85140f7060b623caaf1512cd7eb96392c90f44 (patch)
tree2e1fcf0e9489acf6eca2a34cf46d106fcf4c7003 /block
parent8245d79338b7c86d36323e760d820f0ef63d3369 (diff)
downloadlinux-7b85140f7060b623caaf1512cd7eb96392c90f44.tar.xz
block: fix get_max_io_size()
commit e4b469c66f3cbb81c2e94d31123d7bcdf3c1dabd 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: 9cc5169cd478b ("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>
Diffstat (limited to 'block')
-rw-r--r--block/blk-merge.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 0b590907676a..75abba4d4591 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -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,