]> git.baikalelectronics.ru Git - kernel.git/commit
dm integrity: revert to not using discard filler when recalulating
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 12 May 2021 12:28:43 +0000 (08:28 -0400)
committerMike Snitzer <snitzer@redhat.com>
Thu, 13 May 2021 18:53:48 +0000 (14:53 -0400)
commit477be6268d619d5532ae4dacf2ae547c5eb58198
tree4c8931e03f4786698e664cae7dd2c1c7eeb16871
parentc9f3475f27ac051821c10998658bf5d188ca0c12
dm integrity: revert to not using discard filler when recalulating

Revert the commit 91b6324662b296af4f3f05d0afd13283450bd2d0 ("dm integrity:
use discard support when recalculating").

There's a bug that when we write some data beyond the current recalculate
boundary, the checksum will be rewritten with the discard filler later.
And the data will no longer have integrity protection. There's no easy
fix for this case.

Also, another problematic case is if dm-integrity is used to detect
bitrot (random device errors, bit flips, etc); dm-integrity should
detect that even for unused sectors. With commit 91b6324662b it can
happen that such change is undetected (because discard filler is not a
valid checksum).

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