Skip to content

Commit

Permalink
md: fix regression with re-adding devices to arrays with no metadata
Browse files Browse the repository at this point in the history
Commit 1a855a0 (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 1a855a0 was
applied.

Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
  • Loading branch information
NeilBrown committed Jan 11, 2011
1 parent 3c0eee3 commit bf57254
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -5159,9 +5159,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].
Expand Down

0 comments on commit bf57254

Please sign in to comment.