linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: fix get_max_io_size()
@ 2020-08-06 21:58 Keith Busch
  2020-08-06 23:24 ` Jens Axboe
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Keith Busch @ 2020-08-06 21:58 UTC (permalink / raw)
  To: linux-block, Jens Axboe; +Cc: Keith Busch, Eric Deal, Bart Van Assche, stable

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.

Reported-by: Eric Deal <eric.deal@wdc.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: stable@vger.kernel.org
Fixes: 9cc5169cd478b ("block: Improve physical block alignment of split bios")
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 block/blk-merge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-merge.c b/block/blk-merge.c
index 5196dc145270..d7fef954d42f 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,
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-08-18 16:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 21:58 [PATCH] block: fix get_max_io_size() Keith Busch
2020-08-06 23:24 ` Jens Axboe
2020-08-07  0:28 ` Bart Van Assche
2020-08-07  1:25   ` Bart Van Assche
2020-08-07  3:24     ` Keith Busch
2020-08-07 14:18       ` Bart Van Assche
2020-08-07 17:10         ` Keith Busch
2020-08-07 19:02           ` Bart Van Assche
2020-08-17 15:56             ` Keith Busch
2020-08-07  3:20   ` Keith Busch
2020-08-18 16:39 ` Keith Busch
2020-08-18 16:44   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).