diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 8e221a20f5d9..1cd9bfb45e9a 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -2561,7 +2561,10 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
2561 | int err = -EINVAL; | 2561 | int err = -EINVAL; |
2562 | if (cmd_match(buf, "faulty") && rdev->mddev->pers) { | 2562 | if (cmd_match(buf, "faulty") && rdev->mddev->pers) { |
2563 | md_error(rdev->mddev, rdev); | 2563 | md_error(rdev->mddev, rdev); |
2564 | err = 0; | 2564 | if (test_bit(Faulty, &rdev->flags)) |
2565 | err = 0; | ||
2566 | else | ||
2567 | err = -EBUSY; | ||
2565 | } else if (cmd_match(buf, "remove")) { | 2568 | } else if (cmd_match(buf, "remove")) { |
2566 | if (rdev->raid_disk >= 0) | 2569 | if (rdev->raid_disk >= 0) |
2567 | err = -EBUSY; | 2570 | err = -EBUSY; |
@@ -5983,6 +5986,8 @@ static int set_disk_faulty(mddev_t *mddev, dev_t dev) | |||
5983 | return -ENODEV; | 5986 | return -ENODEV; |
5984 | 5987 | ||
5985 | md_error(mddev, rdev); | 5988 | md_error(mddev, rdev); |
5989 | if (!test_bit(Faulty, &rdev->flags)) | ||
5990 | return -EBUSY; | ||
5986 | return 0; | 5991 | return 0; |
5987 | } | 5992 | } |
5988 | 5993 | ||