Re: [PATCH 9/9] raid5: skip resync if cache(log) is enabled
From: NeilBrown <hidden>
Date: 2015-08-05 04:16:57
On Wed, 29 Jul 2015 17:38:49 -0700 Shaohua Li [off-list ref] wrote:
quoted hunk ↗ jump to hunk
If cache(log) is enabled, the log structure will guarantee data consistency, so skip resync for unclean shutdown Signed-off-by: Shaohua Li <redacted> --- drivers/md/raid5.c | 9 +++++++++ 1 file changed, 9 insertions(+)diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 26ea100..330550a 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c@@ -6967,6 +6967,15 @@ static int run(struct mddev *mddev) } } + if (conf->log) { + if (mddev->recovery_cp == 0) { + printk(KERN_NOTICE + "md/raid:%s: skip resync with caching enabled\n", + mdname(mddev)); + mddev->recovery_cp = MaxSector; + } + } + return 0; abort: md_unregister_thread(&mddev->thread);
I don't think this is correct. When a RAID6 is started, recovery_cp will be zero and we really do want a resync to happen even if there is a log. Rather, I think that recovery_cp should not be set to zero when a log is being used. So keep the array appearing to be "clean". If recovery_cp ever does get set to zero (mdadm --assemble --update=resync can do this), then do the resync. Thanks, NeilBrown