mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
ANDROID: dm-bow: avoid truncating the logical block size
Upstream commitad6bf88a6c("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 commit64611a15ca("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:
parent
759502a4b8
commit
228804d48c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user