dm-integrity: support recalculation in the 'I' mode
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 5 Sep 2024 19:01:52 +0000 (21:01 +0200)
committerMikulas Patocka <mpatocka@redhat.com>
Fri, 6 Sep 2024 10:34:05 +0000 (12:34 +0200)
commit90da77987dd59c8f6ec6d508d23d5a77c7af64f1
tree143c4d63b9cc2bfd1fb69801959bf561c658771f
parenta7722b82c2ca9ca771d6c698643883be76f61a7e
dm-integrity: support recalculation in the 'I' mode

In the kernel 6.11, dm-integrity was enhanced with an inline ('I') mode.
This mode uses devices with non-power-of-2 sector size. The extra
metadata after each sector are used to hold the integrity hash.

This commit enhances the inline mode, so that there is automatic
recalculation of the integrity hashes when the 'reclaculate' parameter is
used. It allows us to activate the device instantly, and the
recalculation is done on background.

If the device is deactivated while recalculation is in progress, it will
remember the point where it stopped and it will continue from this point
when activated again.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-integrity.c