]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
md/raid1: don't clear bitmap bits on interrupted recovery.
authorNate Dailey <nate.dailey@stratus.com>
Thu, 7 Feb 2019 19:19:01 +0000 (14:19 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Feb 2019 09:29:14 +0000 (10:29 +0100)
commitd3028da7d556a7a0e2cd80ea3f31d67659296912
treeeb17edf9473397af5c0c5256d63d10fb597cef28
parentf2be76753b93473ccc86541b99544294df08392a
md/raid1: don't clear bitmap bits on interrupted recovery.

commit dfcc34c99f3ebc16b787b118763bf9cb6b1efc7a upstream.

sync_request_write no longer submits writes to a Faulty device. This has
the unfortunate side effect that bitmap bits can be incorrectly cleared
if a recovery is interrupted (previously, end_sync_write would have
prevented this). This means the next recovery may not copy everything
it should, potentially corrupting data.

Add a function for doing the proper md_bitmap_end_sync, called from
end_sync_write and the Faulty case in sync_request_write.

backport note to 4.14: s/md_bitmap_end_sync/bitmap_end_sync
Cc: stable@vger.kernel.org 4.14+
Fixes: 0c9d5b127f69 ("md/raid1: avoid reusing a resync bio after error handling.")
Reviewed-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Tested-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Nate Dailey <nate.dailey@stratus.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/raid1.c