dm integrity: fix error reporting in bitmap mode after creation
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 31 Aug 2020 13:25:41 +0000 (09:25 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:14:31 +0000 (19:14 +0200)
commit372236a01bc548c3a0fdb02eb362144a3b10a233
tree39a0929b9e122563023ac92f3622842191867401
parent2c8ee4951f11e18dd328a0e045aa436646cadec0
dm integrity: fix error reporting in bitmap mode after creation

commit e27fec66f0a94e35a35548bd0b29ae616e62ec62 upstream.

The dm-integrity target did not report errors in bitmap mode just after
creation. The reason is that the function integrity_recalc didn't clean up
ic->recalc_bitmap as it proceeded with recalculation.

Fix this by updating the bitmap accordingly -- the double shift serves
to rounddown.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 468dfca38b1a ("dm integrity: add a bitmap mode")
Cc: stable@vger.kernel.org # v5.2+
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-integrity.c