diff options
author | NeilBrown <neilb@suse.de> | 2011-01-12 09:03:35 +1100 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2011-04-30 16:53:01 +0200 |
commit | 2d43dcfb1bf7486f3208e8bb37e37fd41588353b (patch) | |
tree | 301549c3e7d612f549bf4cf544d547105756bb84 | |
parent | 25af68e330ba7d6f65394fcf3660000c892ec2e4 (diff) |
md: fix regression with re-adding devices to arrays with no metadata
commit bf572541ab44240163eaa2d486b06f306a31d45a upstream.
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.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-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 2c84cc90c5ed..b0c23a6e6cf7 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -4303,9 +4303,10 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info) /* set saved_raid_disk if appropriate */ if (!mddev->persistent) { if (info->state & (1<<MD_DISK_SYNC) && - info->raid_disk < mddev->raid_disks) + info->raid_disk < mddev->raid_disks) { rdev->raid_disk = info->raid_disk; - else + set_bit(In_sync, &rdev->flags); + } else rdev->raid_disk = -1; } else super_types[mddev->major_version]. |