dm writecache: fix writing beyond end of underlying device when shrinking
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 9 Feb 2021 15:56:20 +0000 (10:56 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:38:45 +0000 (11:38 +0100)
commit0b2dbaa5db0a4a744d6bd110e50243de32ac9c88
treec6ee8421f026a0c4937beebd7317e5cf0aa5b0f4
parentf88a70bfd5d06f6bc275e42882988a431f63176a
dm writecache: fix writing beyond end of underlying device when shrinking

commit 4134455f2aafdfeab50cabb4cccb35e916034b93 upstream.

Do not attempt to write any data beyond the end of the underlying data
device while shrinking it.

The DM writecache device must be suspended when the underlying data
device is shrunk.

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-writecache.c