From: NeilBrown Date: Mon, 14 Feb 2011 23:45:01 +0000 (+1100) Subject: Fix regression with removing 'failed' and 'detached' devices. X-Git-Tag: mdadm-3.2.1~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b660791b4afb9b24b13cbf4877ea62e4e832537;p=thirdparty%2Fmdadm.git 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 Tested-by: Rémi Rérolle Signed-off-by: NeilBrown --- diff --git a/Manage.c b/Manage.c index 481c1654..8c86a532 100644 --- a/Manage.c +++ b/Manage.c @@ -421,7 +421,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') { @@ -461,7 +461,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) {