dm integrity: fix flush with external metadata device
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 8 Jan 2021 16:15:56 +0000 (11:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Jan 2021 17:27:22 +0000 (18:27 +0100)
commit6bba7eff6b33f14ad40cc70d5dea5a561b472191
tree83eb910d10655da335dbc62ab870c4cae4351fd1
parent1ac4156de54973e405393a5da1f17fc748252c1b
dm integrity: fix flush with external metadata device

commit 9b5948267adc9e689da609eb61cf7ed49cae5fa8 upstream.

With external metadata device, flush requests are not passed down to the
data device.

Fix this by submitting the flush request in dm_integrity_flush_buffers. In
order to not degrade performance, we overlap the data device flush with
the metadata device flush.

Reported-by: Lukas Straub <lukasstraub2@web.de>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-bufio.c
drivers/md/dm-integrity.c
include/linux/dm-bufio.h