From: Dan Williams Date: Wed, 25 Feb 2009 01:45:57 +0000 (-0700) Subject: Manage: permit '--remove detached' for containers X-Git-Tag: mdadm-3.0-devel3~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85f9b5f798f7fded7145df7b250744e216251ad7;p=thirdparty%2Fmdadm.git Manage: permit '--remove detached' for containers Skip the unique holder check in the detached case... pretty sure no one is holding on to it if open() returns ENXIO. Signed-off-by: Dan Williams --- 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,