Commit 64611a15 authored by Eric Biggers's avatar Eric Biggers Committed by Mike Snitzer

dm crypt: avoid truncating the logical block size

queue_limits::logical_block_size got changed from unsigned short to
unsigned int, but it was forgotten to update crypt_io_hints() to use the
new type.  Fix it.

Fixes: ad6bf88a ("block: fix an integer overflow in logical block size")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Reviewed-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 04867370
...@@ -3312,7 +3312,7 @@ static void crypt_io_hints(struct dm_target *ti, struct queue_limits *limits) ...@@ -3312,7 +3312,7 @@ static void crypt_io_hints(struct dm_target *ti, struct queue_limits *limits)
limits->max_segment_size = PAGE_SIZE; limits->max_segment_size = PAGE_SIZE;
limits->logical_block_size = limits->logical_block_size =
max_t(unsigned short, limits->logical_block_size, cc->sector_size); max_t(unsigned, limits->logical_block_size, cc->sector_size);
limits->physical_block_size = limits->physical_block_size =
max_t(unsigned, limits->physical_block_size, cc->sector_size); max_t(unsigned, limits->physical_block_size, cc->sector_size);
limits->io_min = max_t(unsigned, limits->io_min, cc->sector_size); limits->io_min = max_t(unsigned, limits->io_min, cc->sector_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment