Skip to contentSkip to conversation

md-cluster: set correct sb->resync_offset

PATCH New Heming Zhao 1 participant 1 message Apr 22, 2021 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 md-cluster: set correct sb->resync_offset

mddev->in_sync is always zero in clustered array. It will trigger raid1 report misleading message on assembling:

Quoted 2 lines

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")

---
 drivers/md/md.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/md.c +1 -1
index 21da0c48f6c2..a8654d7a1ed9 100644
@@ -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);
Signature · 1 line
2.30.0