summaryrefslogtreecommitdiffstats
path: root/Manage.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-02-24 18:45:57 -0700
committerDan Williams <dan.j.williams@intel.com>2009-02-24 18:45:57 -0700
commit85f9b5f798f7fded7145df7b250744e216251ad7 (patch)
tree6523cc320f99545ad00d4689bc55df3dde07c450 /Manage.c
parent04a8ac089c1d295c59380419c927d2bc49f33454 (diff)
downloadmdadm-85f9b5f798f7fded7145df7b250744e216251ad7.tar.gz
mdadm-85f9b5f798f7fded7145df7b250744e216251ad7.tar.xz
mdadm-85f9b5f798f7fded7145df7b250744e216251ad7.zip
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 <dan.j.williams@intel.com>
Diffstat (limited to 'Manage.c')
-rw-r--r--Manage.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Manage.c b/Manage.c
index f2b3266..7afd89b 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,