dm integrity: fix recalculation when moving from journal mode to bitmap mode
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 7 Feb 2020 16:42:30 +0000 (11:42 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2020 12:00:23 +0000 (13:00 +0100)
commit5b3f03f6e232f062db9477a639110a7ebd925b9a
tree9db27b25afdc8b861876da4bb8c0379229beb3e1
parentac5e2d2d5fc6d3e2ecc56af9e3aff77942c1d48f
dm integrity: fix recalculation when moving from journal mode to bitmap mode

commit d5bdf66108419cdb39da361b58ded661c29ff66e upstream.

If we resume a device in bitmap mode and the on-disk format is in journal
mode, we must recalculate anything above ic->sb->recalc_sector. Otherwise,
there would be non-recalculated blocks which would cause I/O errors.

Fixes: 468dfca38b1a ("dm integrity: add a bitmap mode")
Cc: stable@vger.kernel.org # v5.2+
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