summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2015-10-12 17:21:27 +0800
committerGoldwyn Rodrigues <rgoldwyn@suse.com>2015-10-12 11:58:15 -0500
commita9720903d1415317e18f439917f760ec592f3e3b (patch)
tree54f05817f86eb319d167e4874ea8147edc4ea7b2 /drivers/md
parent86b572770e7964f006d438c4e05008914e9db79b (diff)
downloadlinux-a9720903d1415317e18f439917f760ec592f3e3b.tar.bz2
md-cluster: only call kick_rdev_from_array after remove disk successfully
For cluster raid, we should not kick it from array if the disk can't be remove from array successfully. Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 8a6f67f55d3d..d39a72aec316 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2548,13 +2548,16 @@ state_store(struct md_rdev *rdev, const char *buf, size_t len)
err = -EBUSY;
else {
struct mddev *mddev = rdev->mddev;
- if (mddev_is_clustered(mddev))
- md_cluster_ops->remove_disk(mddev, rdev);
- md_kick_rdev_from_array(rdev);
- if (mddev->pers)
- md_update_sb(mddev, 1);
- md_new_event(mddev);
err = 0;
+ if (mddev_is_clustered(mddev))
+ err = md_cluster_ops->remove_disk(mddev, rdev);
+
+ if (err == 0) {
+ md_kick_rdev_from_array(rdev);
+ if (mddev->pers)
+ md_update_sb(mddev, 1);
+ md_new_event(mddev);
+ }
}
} else if (cmd_match(buf, "writemostly")) {
set_bit(WriteMostly, &rdev->flags);