diff options
author | NeilBrown <neilb@suse.de> | 2011-02-01 19:57:13 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-02-01 19:57:13 -0500 |
commit | c6751b2bde477f56ceef67aa1d298ce44e8e2e23 (patch) | |
tree | 59916ec74802396ec4b3f871d27232550848bc8c /drivers/md/md.c | |
parent | 7281f8129c362436237b82c8c026494dd36479dc (diff) |
md: Don't allow slot_store while resync/recovery is happening.
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>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index f2d5628d51cb..1138d1053e9a 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -2463,6 +2463,9 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
2463 | if (rdev->raid_disk != -1) | 2463 | if (rdev->raid_disk != -1) |
2464 | return -EBUSY; | 2464 | return -EBUSY; |
2465 | 2465 | ||
2466 | if (test_bit(MD_RECOVERY_RUNNING, &rdev->mddev->recovery)) | ||
2467 | return -EBUSY; | ||
2468 | |||
2466 | if (rdev->mddev->pers->hot_add_disk == NULL) | 2469 | if (rdev->mddev->pers->hot_add_disk == NULL) |
2467 | return -EINVAL; | 2470 | return -EINVAL; |
2468 | 2471 | ||