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:
parent
f58dd43741
commit
47573b0015
4
Manage.c
4
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) {
|
||||
|
|
Loading…
Reference in New Issue