Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12212948 authored by Chenggang Wang's avatar Chenggang Wang Committed by Greg Kroah-Hartman
Browse files

UPSTREAM: 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.

Bug: 173583534
Fixes: 9cc5169c ("block: Improve physical block alignment of split
bios")
Reported-by: default avatarEric Deal <eric.deal@wdc.com>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 173583534
(cherry picked from commit f09dbec9)
Signed-off-by: default avatarChenggang Wang <wangchenggang@vivo.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
Change-Id: I5f4708059f106b6ded162cbe096e45bae7a7fca4
parent 37201331
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,