dm integrity: clear the journal on suspend
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 15 Nov 2022 17:51:50 +0000 (12:51 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:40:05 +0000 (17:40 +0100)
commit64b7f9a7ddfbcc7cb14a0421fdc18610f862bdde
tree5dbab6a792b3fd73e1db19db01888982784ebce5
parentd306f73079f36f38eaee3163c7275f06bf75b5f4
dm integrity: clear the journal on suspend

[ Upstream commit 984bf2cc531e778e49298fdf6730e0396166aa21 ]

There was a problem that a user burned a dm-integrity image on CDROM
and could not activate it because it had a non-empty journal.

Fix this problem by flushing the journal (done by the previous commit)
and clearing the journal (done by this commit). Once the journal is
cleared, dm-integrity won't attempt to replay it on the next
activation.

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