summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-02-15 10:45:01 +1100
committerNeilBrown <neilb@suse.de>2011-02-15 10:45:42 +1100
commit47573b0015943efd0564a6db6fd17fd8a7e76b39 (patch)
tree20e0879f5c8ea5a19b974c77eb4e3ac34493317e
parentf58dd437412348b77bc09b79c656cf3472e9913d (diff)
downloadmdadm-47573b0015943efd0564a6db6fd17fd8a7e76b39.tar.gz
Fix regression with removing 'failed' and 'detached' devices.
If a request to remove all 'failed' or 'detached' devices chooses to remove the first device, it will not actually try the removal and will skip any following devices. This fixes it. Reported-by: Rémi Rérolle <rrerolle@lacie.com> Tested-by: Rémi Rérolle <rrerolle@lacie.com> Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--Manage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Manage.c b/Manage.c
index 6e9d4a0..1b47479 100644
--- a/Manage.c
+++ b/Manage.c
@@ -417,7 +417,7 @@ int Manage_subdevs(char *devname, int fd,
dnprintable = dvname;
break;
}
- if (jnext == 0)
+ if (next != dv)
continue;
} else if (strcmp(dv->devname, "detached") == 0) {
if (dv->disposition != 'r' && dv->disposition != 'f') {
@@ -457,7 +457,7 @@ int Manage_subdevs(char *devname, int fd,
dnprintable = dvname;
break;
}
- if (jnext == 0)
+ if (next != dv)
continue;
} else if (strcmp(dv->devname, "missing") == 0) {
if (dv->disposition != 'a' || dv->re_add == 0) {