Skip to content

Commit

Permalink
MD RAID1: Further conditionalize 'fullsync'
Browse files Browse the repository at this point in the history
A RAID1 device does not necessarily need a fullsync if the bitmap can be used instead.

Similar to commit d6b212f 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>
  • Loading branch information
Jonathan Brassow authored and NeilBrown committed May 22, 2012
1 parent c32fb9e commit 4f0a5e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
/*
Expand Down

0 comments on commit 4f0a5e0

Please sign in to comment.