summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Ledford <dledford@redhat.com>2010-04-06 23:02:47 -0400
committerDoug Ledford <dledford@redhat.com>2010-04-13 15:05:36 -0400
commit4eea172155fba6b2e57582ed647a0a98890f1670 (patch)
treea9469e6f64269554532be0955215af2adc7c4bf4
parent4146ba404a1134990d3e5918a0725eb7d962a50e (diff)
downloadmdadm-4eea172155fba6b2e57582ed647a0a98890f1670.tar.gz
mdadm-4eea172155fba6b2e57582ed647a0a98890f1670.tar.xz
mdadm-4eea172155fba6b2e57582ed647a0a98890f1670.zip
Only close lfd if we have an external metadata type since that's the only
time we'll have it open. If we weren't able to open the device file, assume the device is gone already and skip the sysfs_unique_holder test as it is guaranteed to fail. Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--Manage.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Manage.c b/Manage.c
index b15586b..a690cfc 100644
--- a/Manage.c
+++ b/Manage.c
@@ -811,6 +811,7 @@ int Manage_subdevs(char *devname, int fd,
* rely on the 'detached' checks
*/
if (strcmp(dv->devname, "detached") == 0 ||
+ tfd < 0 ||
sysfs_unique_holder(dnum, stb.st_rdev))
/* pass */;
else {
@@ -878,8 +879,8 @@ int Manage_subdevs(char *devname, int fd,
ping_manager(name);
free(name);
+ close(lfd);
}
- close(lfd);
if (verbose >= 0)
fprintf(stderr, Name ": hot removed %s\n",
dnprintable);