md/raid10: avoid fullsync when not necessary.
authorNeilBrown <neilb@suse.de>
Tue, 14 Jan 2014 05:30:10 +0000 (16:30 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 14 Jan 2014 05:44:21 +0000 (16:44 +1100)
This is the raid10 equivalent of

commit 4f0a5e012cf41321d611e7cad63e1017d143d138
    MD RAID1: Further conditionalize 'fullsync'

If a device in a newly assembled array is not fully recovered we
currently do a fully resync by don't need to.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid10.c

index 06eeb99..8d39d63 100644 (file)
@@ -3747,7 +3747,8 @@ static int run(struct mddev *mddev)
                    !test_bit(In_sync, &disk->rdev->flags)) {
                        disk->head_position = 0;
                        mddev->degraded++;
-                       if (disk->rdev)
+                       if (disk->rdev &&
+                           disk->rdev->saved_raid_disk < 0)
                                conf->fullsync = 1;
                }
                disk->recovery_disabled = mddev->recovery_disabled - 1;