aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index d66aaeddf95d..b757da175180 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5159,7 +5159,7 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
5159 PTR_ERR(rdev)); 5159 PTR_ERR(rdev));
5160 return PTR_ERR(rdev); 5160 return PTR_ERR(rdev);
5161 } 5161 }
5162 /* set save_raid_disk if appropriate */ 5162 /* set saved_raid_disk if appropriate */
5163 if (!mddev->persistent) { 5163 if (!mddev->persistent) {
5164 if (info->state & (1<<MD_DISK_SYNC) && 5164 if (info->state & (1<<MD_DISK_SYNC) &&
5165 info->raid_disk < mddev->raid_disks) 5165 info->raid_disk < mddev->raid_disks)
@@ -5169,7 +5169,10 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
5169 } else 5169 } else
5170 super_types[mddev->major_version]. 5170 super_types[mddev->major_version].
5171 validate_super(mddev, rdev); 5171 validate_super(mddev, rdev);
5172 rdev->saved_raid_disk = rdev->raid_disk; 5172 if (test_bit(In_sync, &rdev->flags))
5173 rdev->saved_raid_disk = rdev->raid_disk;
5174 else
5175 rdev->saved_raid_disk = -1;
5173 5176
5174 clear_bit(In_sync, &rdev->flags); /* just to be sure */ 5177 clear_bit(In_sync, &rdev->flags); /* just to be sure */
5175 if (info->state & (1<<MD_DISK_WRITEMOSTLY)) 5178 if (info->state & (1<<MD_DISK_WRITEMOSTLY))