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>
This commit is contained in:
Dan Williams 2009-02-24 18:45:57 -07:00
parent 04a8ac089c
commit 85f9b5f798
1 changed files with 8 additions and 1 deletions

View File

@ -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,