diff options
author | NeilBrown <neilb@suse.de> | 2011-01-11 17:03:35 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-01-11 17:03:35 -0500 |
commit | bf572541ab44240163eaa2d486b06f306a31d45a (patch) | |
tree | ef9630d692ce3681bf226877056622afd070f1c0 /drivers/md | |
parent | 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 (diff) |
md: fix regression with re-adding devices to arrays with no metadata
Commit 1a855a0606 (2.6.37-rc4) fixed a problem where devices were
re-added when they shouldn't be but caused a regression in a less
common case that means sometimes devices cannot be re-added when they
should be.
In particular, when re-adding a device to an array without metadata
we should always access the device, but after the above commit we
didn't.
This patch sets the In_sync flag in that case so that the re-add
succeeds.
This patch is suitable for any -stable kernel to which 1a855a0606 was
applied.
Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 175c424f201f..0da25daea9be 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -5159,9 +5159,10 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info) | |||
5159 | /* set saved_raid_disk if appropriate */ | 5159 | /* set saved_raid_disk if appropriate */ |
5160 | if (!mddev->persistent) { | 5160 | if (!mddev->persistent) { |
5161 | if (info->state & (1<<MD_DISK_SYNC) && | 5161 | if (info->state & (1<<MD_DISK_SYNC) && |
5162 | info->raid_disk < mddev->raid_disks) | 5162 | info->raid_disk < mddev->raid_disks) { |
5163 | rdev->raid_disk = info->raid_disk; | 5163 | rdev->raid_disk = info->raid_disk; |
5164 | else | 5164 | set_bit(In_sync, &rdev->flags); |
5165 | } else | ||
5165 | rdev->raid_disk = -1; | 5166 | rdev->raid_disk = -1; |
5166 | } else | 5167 | } else |
5167 | super_types[mddev->major_version]. | 5168 | super_types[mddev->major_version]. |