diff options
author | Guoqing Jiang <gqjiang@suse.com> | 2015-12-21 10:50:59 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2016-01-06 11:38:36 +1100 |
commit | 659b254fa7392e32b59a30d4b61fb12c4cd440ff (patch) | |
tree | 7e9a11ac79c881e7b6f712e804d35fda95cfbb07 /drivers/md/md-cluster.c | |
parent | ac277c6a8a39bc50f891a3477625330c276bd7f5 (diff) |
md-cluster: remove a disk asynchronously from cluster environment
For cluster raid, if one disk couldn't be reach in one node, then
other nodes would receive the REMOVE message for the disk.
In receiving node, we can't call md_kick_rdev_from_array to remove
the disk from array synchronously since the disk might still be busy
in this node. So let's set a ClusterRemove flag on the disk, then
let the thread to do the removal job eventually.
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md/md-cluster.c')
-rw-r--r-- | drivers/md/md-cluster.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c index e57bbfed1638..3fd7301fd7af 100644 --- a/drivers/md/md-cluster.c +++ b/drivers/md/md-cluster.c @@ -440,8 +440,11 @@ static void process_remove_disk(struct mddev *mddev, struct cluster_msg *msg) struct md_rdev *rdev = md_find_rdev_nr_rcu(mddev, le32_to_cpu(msg->raid_slot)); - if (rdev) - md_kick_rdev_from_array(rdev); + if (rdev) { + set_bit(ClusterRemove, &rdev->flags); + set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); + md_wakeup_thread(mddev->thread); + } else pr_warn("%s: %d Could not find disk(%d) to REMOVE\n", __func__, __LINE__, le32_to_cpu(msg->raid_slot)); |