]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm integrity: correctly calculate the size of metadata area
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 7 May 2019 18:28:35 +0000 (14:28 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 May 2019 16:22:20 +0000 (18:22 +0200)
commit96ecf4c59f08b37f1e0f024d4976544525ce578c
tree9da6e4feb764dab8f215f681332aa390a0330816
parentecff1441aa15571b1297dfb4ac16812223112802
dm integrity: correctly calculate the size of metadata area

commit 30bba430ddf737978e40561198693ba91386dac1 upstream.

When we use separate devices for data and metadata, dm-integrity would
incorrectly calculate the size of the metadata device as if it had
512-byte block size - and it would refuse activation with larger block
size and smaller metadata device.

Fix this so that it takes actual block size into account, which fixes
the following reported issue:
https://gitlab.com/cryptsetup/cryptsetup/issues/450

Fixes: 356d9d52e122 ("dm integrity: allow separate metadata device")
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-integrity.c