summaryrefslogtreecommitdiff
path: root/Manage.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-07-09 17:14:16 +1000
committerNeilBrown <neilb@suse.de>2012-07-09 17:14:16 +1000
commitc8e1a230b73c44aff5beeeb74d32e36219bed12d (patch)
treea0b605d5bffe3e94ce6e7bbaeba033b3b3782229 /Manage.c
parente7b84f9d5029338980d99d04b479ce814d4c4fcb (diff)
Remove re_add flag in favour of new disposition.
Instead of disposition == 'a' re_add == 1 use disposition == 'A' to record that a re-add was requested. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Manage.c')
-rw-r--r--Manage.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/Manage.c b/Manage.c
index a7d6a1e8..a596363c 100644
--- a/Manage.c
+++ b/Manage.c
@@ -524,7 +524,7 @@ int Manage_subdevs(char *devname, int fd,
if (next != dv)
continue;
} else if (strcmp(dv->devname, "missing") == 0) {
- if (dv->disposition != 'a' || dv->re_add == 0) {
+ if (dv->disposition != 'A') {
pr_err("'missing' only meaningful "
"with --re-add\n");
goto abort;
@@ -610,6 +610,7 @@ int Manage_subdevs(char *devname, int fd,
dv->devname, dv->disposition);
goto abort;
case 'a':
+ case 'A':
/* add the device */
if (subarray) {
pr_err("Cannot add disks to a"
@@ -724,8 +725,7 @@ int Manage_subdevs(char *devname, int fd,
break;
}
/* FIXME this is a bad test to be using */
- if (!tst->sb &&
- dv->re_add) {
+ if (!tst->sb && dv->disposition == 'A') {
/* we are re-adding a device to a
* completely dead array - have to depend
* on kernel to check
@@ -857,7 +857,7 @@ int Manage_subdevs(char *devname, int fd,
}
continue;
}
- if (dv->re_add) {
+ if (dv->disposition == 'A') {
if (tfd >= 0)
close(tfd);
pr_err("--re-add for %s to %s is not possible\n",
@@ -943,7 +943,7 @@ int Manage_subdevs(char *devname, int fd,
close(dfd);
goto abort;
}
- } else if (dv->re_add) {
+ } else if (dv->disposition == 'A') {
/* this had better be raid1.
* As we are "--re-add"ing we must find a spare slot
* to fill.
@@ -1269,7 +1269,6 @@ int move_spare(char *from_devname, char *to_devname, dev_t devid)
devlist.next = NULL;
devlist.used = 0;
- devlist.re_add = 0;
devlist.writemostly = 0;
devlist.devname = devname;
sprintf(devname, "%d:%d", major(devid), minor(devid));