mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
ANDROID: dm-default-key: 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 default_key_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:cb39ec0c10("ANDROID: dm: add dm-default-key target for metadata encryption") Change-Id: I98dd65afdb120073203af3b201d0831edd6e245c Signed-off-by: Eric Biggers <ebiggers@google.com>
This commit is contained in:
@@ -386,7 +386,7 @@ static void default_key_io_hints(struct dm_target *ti,
|
||||
const unsigned int sector_size = dkc->sector_size;
|
||||
|
||||
limits->logical_block_size =
|
||||
max_t(unsigned short, limits->logical_block_size, sector_size);
|
||||
max_t(unsigned int, limits->logical_block_size, sector_size);
|
||||
limits->physical_block_size =
|
||||
max_t(unsigned int, limits->physical_block_size, sector_size);
|
||||
limits->io_min = max_t(unsigned int, limits->io_min, sector_size);
|
||||
|
||||
Reference in New Issue
Block a user