Skip to content

Commit

Permalink
md: Don't allow slot_store while resync/recovery is happening.
Browse files Browse the repository at this point in the history
Activating a spare in an array while resync/recovery is already
happening can lead the that spare being marked in-sync when it isn't
really.
So don't allow the 'slot' to be set (this activating the device)
while resync/recovery is happening.

Signed-off-by: NeilBrown <neilb@suse.de>
  • Loading branch information
NeilBrown committed Feb 2, 2011
1 parent 7281f81 commit c6751b2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -2463,6 +2463,9 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len)
if (rdev->raid_disk != -1)
return -EBUSY;

if (test_bit(MD_RECOVERY_RUNNING, &rdev->mddev->recovery))
return -EBUSY;

if (rdev->mddev->pers->hot_add_disk == NULL)
return -EINVAL;

Expand Down

0 comments on commit c6751b2

Please sign in to comment.