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
b545e14a21
commit
5b660791b4
4
Manage.c
4
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) {
|
||||
|
|
Loading…
Reference in New Issue