mddev->in_sync is always zero in clustered array. It will trigger raid1 report misleading message on assembling: > md/raid1:md0: not clean -- starting background reconstruction > md/raid1:md0: active with 2 out of 2 mirrors This patch allows clustered array to set correct resync_offset. If this patch is accepted, mdadm can remove commit f7a6246bab1541 ("super1.c: avoid useless sync when bitmap switches from clustered to none") Signed-off-by: Heming Zhao <heming.zhao@xxxxxxxx> --- drivers/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 21da0c48f6c2..a8654d7a1ed9 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2010,7 +2010,7 @@ static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev) sb->utime = cpu_to_le64((__u64)mddev->utime); sb->events = cpu_to_le64(mddev->events); - if (mddev->in_sync) + if (mddev->in_sync || mddev_is_clustered(mddev)) sb->resync_offset = cpu_to_le64(mddev->recovery_cp); else if (test_bit(MD_JOURNAL_CLEAN, &mddev->flags)) sb->resync_offset = cpu_to_le64(MaxSector); -- 2.30.0