OSDN Git Service

MD RAID1: Further conditionalize 'fullsync'
authorJonathan Brassow <jbrassow@redhat.com>
Tue, 22 May 2012 03:55:31 +0000 (13:55 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 22 May 2012 03:55:31 +0000 (13:55 +1000)
A RAID1 device does not necessarily need a fullsync if the bitmap can be used instead.

Similar to commit d6b212f4b19da5301e6b6eca562e5c7a2a6e8c8d in raid5.c, if a raid1
device can be brought back (i.e. from a transient failure) it shouldn't need a
complete resync.  Provided the bitmap is not to old, it will have recorded the areas
of the disk that need recovery.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c

index 8e717bd..835de71 100644 (file)
@@ -2600,7 +2600,8 @@ static struct r1conf *setup_conf(struct mddev *mddev)
                if (!disk->rdev ||
                    !test_bit(In_sync, &disk->rdev->flags)) {
                        disk->head_position = 0;
-                       if (disk->rdev)
+                       if (disk->rdev &&
+                           (disk->rdev->saved_raid_disk < 0))
                                conf->fullsync = 1;
                } else if (conf->last_used < 0)
                        /*