diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2011-06-08 19:00:28 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-06-08 21:42:29 -0400 |
commit | d6b212f4b19da5301e6b6eca562e5c7a2a6e8c8d (patch) | |
tree | 0cf0ae9320ea9ebbb6bd1403659591cf399c16a1 /drivers | |
parent | 9c81075f436f867f580c2edf2350c0898cffc9d0 (diff) |
MD: raid5 do not set fullsync
Add check to determine if a device needs full resync or if partial resync will do
RAID 5 was assuming that if a device was not In_sync, it must undergo a full
resync. We add a check to see if 'saved_raid_disk' is the same as 'raid_disk'.
If it is, we can safely skip the full resync and rely on the bitmap for
partial recovery instead. This is the legitimate purpose of 'saved_raid_disk',
from md.h:
int saved_raid_disk; /* role that device used to have in the
* array and could again if we did a partial
* resync from the bitmap
*/
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/raid5.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 346e69bfdab3..f9d2fbc64977 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -4858,7 +4858,7 @@ static raid5_conf_t *setup_conf(mddev_t *mddev) | |||
4858 | printk(KERN_INFO "md/raid:%s: device %s operational as raid" | 4858 | printk(KERN_INFO "md/raid:%s: device %s operational as raid" |
4859 | " disk %d\n", | 4859 | " disk %d\n", |
4860 | mdname(mddev), bdevname(rdev->bdev, b), raid_disk); | 4860 | mdname(mddev), bdevname(rdev->bdev, b), raid_disk); |
4861 | } else | 4861 | } else if (rdev->saved_raid_disk != raid_disk) |
4862 | /* Cannot rely on bitmap to complete recovery */ | 4862 | /* Cannot rely on bitmap to complete recovery */ |
4863 | conf->fullsync = 1; | 4863 | conf->fullsync = 1; |
4864 | } | 4864 | } |