ANDROID: dm-bow: avoid truncating the logical block size

Upstream commit ad6bf88a6c ("block: fix an integer overflow in logical
block size") changed queue_limits::logical_block_size from 'unsigned
short' to 'unsigned int', and this commit has been backported to the LTS
branches.  Update the computation in dm_bow_io_hints() to match.

This mirrors upstream commit 64611a15ca ("dm crypt: avoid truncating
the logical block size") which fixed the same bug in dm-crypt.

Fixes: 7df64f6216 ("ANDROID: dm-bow: Add block_size option")
Change-Id: I45eba7d21cf178e4b8e624ef5f819a1ffb015a8d
Signed-off-by: Eric Biggers <ebiggers@google.com>
This commit is contained in:
Eric Biggers 2020-06-10 13:56:07 -07:00
parent 759502a4b8
commit 228804d48c

View File

@ -627,7 +627,7 @@ static void dm_bow_io_hints(struct dm_target *ti, struct queue_limits *limits)
const unsigned int block_size = bc->block_size;
limits->logical_block_size =
max_t(unsigned short, limits->logical_block_size, block_size);
max_t(unsigned int, limits->logical_block_size, block_size);
limits->physical_block_size =
max_t(unsigned int, limits->physical_block_size, block_size);
limits->io_min = max_t(unsigned int, limits->io_min, block_size);