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>
This commit is contained in:
NeilBrown 2011-02-15 10:45:01 +11:00
parent f58dd43741
commit 47573b0015
1 changed files with 2 additions and 2 deletions

View File

@ -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) {