All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] md-cluster: set correct sb->resync_offset
@ 2021-04-22 16:09 Heming Zhao
  0 siblings, 0 replies; only message in thread
From: Heming Zhao @ 2021-04-22 16:09 UTC (permalink / raw)
  To: linux-raid, song; +Cc: Heming Zhao, lidong.zhong, xni, colyli, jes

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@suse.com>
---
 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-22 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22 16:09 [PATCH] md-cluster: set correct sb->resync_offset Heming Zhao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.