Skip to content

Commit ffa2332

Browse files
committed
md/bitmap: update dirty flag when bitmap bits are explicitly set.
There is a sysfs file which allows bits in the write-intent bitmap to be explicit set - indicating that the block is thought to be 'dirty'. When this happens we should really set recovery_cp backwards to include the block to reflect this dirtiness. In particular, a 'resync' process will refuse to start if recovery_cp is beyond the end of the array, so this is needed to allow a resync to be triggered. Signed-off-by: NeilBrown <neilb@suse.de>
1 parent ece5cff commit ffa2332

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/md/bitmap.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,12 @@ void bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long e)
15661566
sector_t sec = (sector_t)chunk << CHUNK_BLOCK_SHIFT(bitmap);
15671567
bitmap_set_memory_bits(bitmap, sec, 1);
15681568
bitmap_file_set_bit(bitmap, sec);
1569+
if (sec < bitmap->mddev->recovery_cp)
1570+
/* We are asserting that the array is dirty,
1571+
* so move the recovery_cp address back so
1572+
* that it is obvious that it is dirty
1573+
*/
1574+
bitmap->mddev->recovery_cp = sec;
15691575
}
15701576
}
15711577

0 commit comments

Comments
 (0)