summaryrefslogtreecommitdiffstats
path: root/Manage.c
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2015-08-20 07:56:31 +0200
committerNeilBrown <neilb@suse.com>2015-09-28 06:55:02 +0200
commitbff96f736696a75dab5311b15c0f77a24a177743 (patch)
treefd8acd1fb01abb6f3629be0dc4614428f7ba7ea6 /Manage.c
parentFix --incremental handling on cluster array. (diff)
downloadmdadm-bff96f736696a75dab5311b15c0f77a24a177743.tar.xz
mdadm-bff96f736696a75dab5311b15c0f77a24a177743.zip
mdadm: make cluster raid also could support re-add
If it is a cluster raid, the disc.state need to be changed accordingly when do re-add. Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'Manage.c')
-rw-r--r--Manage.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Manage.c b/Manage.c
index 494cca92..b5450dd0 100644
--- a/Manage.c
+++ b/Manage.c
@@ -669,6 +669,15 @@ int attempt_re_add(int fd, int tfd, struct mddev_dev *dv,
disc.number = mdi.disk.number;
disc.raid_disk = mdi.disk.raid_disk;
disc.state = mdi.disk.state;
+ if (array->state & (1 << MD_SB_CLUSTERED)) {
+ /* extra flags are needed when adding to a cluster as
+ * there are two cases to distinguish
+ */
+ if (dv->disposition == 'c')
+ disc.state |= (1 << MD_DISK_CANDIDATE);
+ else
+ disc.state |= (1 << MD_DISK_CLUSTER_ADD);
+ }
if (dv->writemostly == 1)
disc.state |= 1 << MD_DISK_WRITEMOSTLY;
if (dv->writemostly == 2)