Hi Goldwyn,
diff --git a/drivers/md/md.c b/drivers/md/md.c
index bc11551..0c65e51 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2291,11 +2291,12 @@ static void export_rdev(struct md_rdev * rdev)
kobject_put(&rdev->kobj);
}
-static void kick_rdev_from_array(struct md_rdev * rdev)
+void md_kick_rdev_from_array(struct md_rdev * rdev)
{
unbind_rdev_from_array(rdev);
export_rdev(rdev);
}
+EXPORT_SYMBOL_GPL(md_kick_rdev_from_array);
static void export_array(struct mddev *mddev)
{
@@ -2306,7 +2307,7 @@ static void export_array(struct mddev *mddev)
MD_BUG();
continue;
}
- kick_rdev_from_array(rdev);
+ md_kick_rdev_from_array(rdev);
}
if (!list_empty(&mddev->disks))
MD_BUG();
@@ -2750,9 +2751,11 @@ 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))
+ if (mddev_is_clustered(mddev)) {
md_cluster_ops->metadata_update_start(mddev);
- kick_rdev_from_array(rdev);
+ md_cluster_ops->remove_disk(mddev, rdev);
+ }
+ md_kick_rdev_from_array(rdev);
For md-cluster, seems it is possible that md_kick_rdev_from_array could
be called twice,
is this what you want? Thanks.
No, it would be called only once. There are two types of nodes in this
case: one is sender and other received. The sender calls
md_kick_rdev_from_array() in the regular flow of
state_store/hot_remove_disk() while the receiver calls
md_kick_rdev_from_array() in the process_remove_disk().
Thanks for explanation, both sender node and receiver node need to kick
the disk from array. I misunderstood it, :(.
Regards,
Guoqing
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html