X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=Manage.c;h=7afd89b7ce7b56c81aa6871ed8c149961cf02382;hb=fdb482f99b9ad2ef8cd1724902fdfeedaa8796a1;hp=f2b32662ede7d1dd69de30e654cebf158beab08e;hpb=78fbcc10312649f2f4f88283e3f19dce9b205733;p=thirdparty%2Fmdadm.git diff --git a/Manage.c b/Manage.c index f2b32662..7afd89b7 100644 --- a/Manage.c +++ b/Manage.c @@ -746,7 +746,14 @@ int Manage_subdevs(char *devname, int fd, " to container - odd\n"); return 1; } - if (!sysfs_unique_holder(dnum, stb.st_rdev)) { + /* in the detached case it is not possible to + * check if we are the unique holder, so just + * rely on the 'detached' checks + */ + if (strcmp(dv->devname, "detached") == 0 || + sysfs_unique_holder(dnum, stb.st_rdev)) + /* pass */; + else { fprintf(stderr, Name ": %s is %s, cannot remove.\n", dnprintable,