]> 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:01 +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 481c16541bc381a04318ae87813d8108093deb58..8c86a5328abf5750b8b3b69422164010f74b1a0a 100644 (file)
--- 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) {