]> git.baikalelectronics.ru Git - kernel.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)
committerSong Liu <songliubraving@fb.com>
Tue, 12 Feb 2019 22:06:58 +0000 (14:06 -0800)
commit207788dd4475833a1718232cc9abe35d0790ac48
tree1019fd0794fb6db7465d218b0a7444d8e68ed223
parent9a6659c8090c474a6789fa6087ee659502b8b8cf
md/raid1: don't clear bitmap bits on interrupted recovery.

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: 2924b70079b4 ("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>
drivers/md/raid1.c