md/bitmap: clear BITMAP_WRITE_ERROR bit before writing it to sb
authorHou Tao <houtao1@huawei.com>
Mon, 6 Nov 2017 02:11:25 +0000 (10:11 +0800)
committerShaohua Li <shli@fb.com>
Thu, 9 Nov 2017 15:30:50 +0000 (07:30 -0800)
commit97f0eb9f0fec0563c1c796d95123e871b8bb65c0
tree083bd0c08b7f665b762a84ff3142b3d62fbc4509
parentdb0505d320660b6ad92418847e7eca6b61b246ac
md/bitmap: clear BITMAP_WRITE_ERROR bit before writing it to sb

For a RAID1 device using a file-based bitmap, if a bitmap write error
occurs but the later writes succeed, it's possible both BITMAP_STALE
and BITMAP_WRITE_ERROR bits will be written to the bitmap super block,
the BITMAP_STALE bit will be handled properly and be cleared, but the
BITMAP_WRITE_ERROR bit in sb->flags will make bitmap_create() to fail.

So clear it to protect against the write failure-and-then-recovery case.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/md-bitmap.c