• Hou Tao's avatar
    md/bitmap: clear BITMAP_WRITE_ERROR bit before writing it to sb · 97f0eb9f
    Hou Tao authored
    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: default avatarHou Tao <houtao1@huawei.com>
    Signed-off-by: default avatarShaohua Li <shli@fb.com>
    97f0eb9f
md-bitmap.c 68.7 KB