]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix regression with removing 'failed' and 'detached' devices.
authorNeilBrown <neilb@suse.de>
Mon, 14 Feb 2011 23:45:01 +0000 (10:45 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 14 Feb 2011 23:45:42 +0000 (10:45 +1100)
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>
Manage.c

index 6e9d4a03b45e76c7e3cfb71c816ade60a6a06b0d..1b474798c51b91a50aca78822d795473efcd0ced 100644 (file)
--- 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) {