Skip to content

Commit 7b85140

Browse files
keithbuschgregkh
authored andcommitted
block: fix get_max_io_size()
commit e4b469c 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: 9cc5169 ("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>
1 parent 8245d79 commit 7b85140

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎block/blk-merge.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static inline unsigned get_max_io_size(struct request_queue *q,
154154
if (max_sectors > start_offset)
155155
return max_sectors - start_offset;
156156

157-
return sectors & (lbs - 1);
157+
return sectors & ~(lbs - 1);
158158
}
159159

160160
static inline unsigned get_max_segment_size(const struct request_queue *q,

0 commit comments

Comments
 (0)