aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-04-23 21:42:41 -0400
committerNeilBrown <neilb@suse.de>2013-04-23 21:42:41 -0400
commit3ea8929da3e61b54d4adcab1bf9a0034648d578e (patch)
tree5746cb05e180e46bb4a05d93ff55fbbdf0a0e078 /drivers/md/md.c
parent746d3207ae2f9cf71fd87c9df884aa104fdaafa6 (diff)
md: HOT_DISK_REMOVE shouldn't make a read-auto device active.
If a fail device or a spare is removed from an array, there is not need to make the array 'active'. If/when the array does become active for some other reason the metadata will be update to reflect the removal. If that never happens and the array is stopped while still read-auto, then there is no loss in forgetting the that the device had 'failed'. A read-only array will leave failed devices attached to the array personality, so we need to explicitly call remove_and_add_spares() to free it (clearing Blocked just like we do in store_slot()). Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 07f207e53ba9..802c2a379d8f 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5883,6 +5883,9 @@ static int hot_remove_disk(struct mddev * mddev, dev_t dev)
5883 if (!rdev) 5883 if (!rdev)
5884 return -ENXIO; 5884 return -ENXIO;
5885 5885
5886 clear_bit(Blocked, &rdev->flags);
5887 remove_and_add_spares(mddev, rdev);
5888
5886 if (rdev->raid_disk >= 0) 5889 if (rdev->raid_disk >= 0)
5887 goto busy; 5890 goto busy;
5888 5891
@@ -6496,6 +6499,10 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
6496 err = md_set_readonly(mddev, bdev); 6499 err = md_set_readonly(mddev, bdev);
6497 goto done_unlock; 6500 goto done_unlock;
6498 6501
6502 case HOT_REMOVE_DISK:
6503 err = hot_remove_disk(mddev, new_decode_dev(arg));
6504 goto done_unlock;
6505
6499 case BLKROSET: 6506 case BLKROSET:
6500 if (get_user(ro, (int __user *)(arg))) { 6507 if (get_user(ro, (int __user *)(arg))) {
6501 err = -EFAULT; 6508 err = -EFAULT;
@@ -6566,10 +6573,6 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
6566 goto done_unlock; 6573 goto done_unlock;
6567 } 6574 }
6568 6575
6569 case HOT_REMOVE_DISK:
6570 err = hot_remove_disk(mddev, new_decode_dev(arg));
6571 goto done_unlock;
6572
6573 case HOT_ADD_DISK: 6576 case HOT_ADD_DISK:
6574 err = hot_add_disk(mddev, new_decode_dev(arg)); 6577 err = hot_add_disk(mddev, new_decode_dev(arg));
6575 goto done_unlock; 6578 goto done_unlock;