]> git.baikalelectronics.ru Git - kernel.git/commit
dm integrity: fix excessive alignment of metadata runs
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 13 Nov 2019 11:48:16 +0000 (06:48 -0500)
committerMike Snitzer <snitzer@redhat.com>
Fri, 15 Nov 2019 19:49:16 +0000 (14:49 -0500)
commitd70b114a5a0547ef0a506d2c25bfaa12a2b6ea34
tree7d95a35edc2d838b9a605db8bac62f39c9b1cbb5
parent82e5f6fd56f6a1b9d3974d1260fcb74fe89f69b4
dm integrity: fix excessive alignment of metadata runs

Metadata runs are supposed to be aligned on 4k boundary (so that they work
efficiently with disks with 4k sectors). However, there was a programming
bug that makes them aligned on 128k boundary instead. The unused space is
wasted.

Fix this bug by providing a proper 4k alignment. In order to keep
existing volumes working, we introduce a new flag SB_FLAG_FIXED_PADDING
- when the flag is clear, we calculate the padding the old way. In order
to make sure that the old version cannot mount the volume created by the
new version, we increase superblock version to 4.

Also in order to not break with old integritysetup, we fix alignment
only if the parameter "fix_padding" is present when formatting the
device.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Documentation/admin-guide/device-mapper/dm-integrity.rst
drivers/md/dm-integrity.c