dm integrity: add the "reset_recalculate" feature flag
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 23 Mar 2021 14:59:45 +0000 (10:59 -0400)
committerMike Snitzer <snitzer@redhat.com>
Fri, 26 Mar 2021 18:53:42 +0000 (14:53 -0400)
commitdb7b93e38106e58ac2ea24eaaea7ed760a319120
treeae68290414e5ca5503de7ea366d61d39e0e26786
parentece2577388334dd5e8d59cb46895f9573bc4b808
dm integrity: add the "reset_recalculate" feature flag

Add a new flag "reset_recalculate" that will restart recalculating
from the beginning of the device. It can be used if we want to change
the hash function. Example:

dmsetup remove_all
rmmod brd
set -e
modprobe brd rd_size=1048576
dmsetup create in --table '0 2000000 integrity /dev/ram0 0 16 J 2 internal_hash:sha256 recalculate'
sleep 10
dmsetup status
dmsetup remove in
dmsetup create in --table '0 2000000 integrity /dev/ram0 0 16 J 2 internal_hash:sha3-256 reset_recalculate'

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