Przemyslaw Czarnowski: fix: IncrementalRemove leaves open handle

Martin F. Krafft madduck at alioth.debian.org
Sun Aug 29 11:55:03 UTC 2010


Module: mdadm
Branch: fixes/udev-blkid
Commit: aae3cdc35afd38b8e67fa4a8b4384c9c9d345c60
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=aae3cdc35afd38b8e67fa4a8b4384c9c9d345c60

Author: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski at intel.com>
Date:   Tue Jul  6 16:47:02 2010 +1000

fix: IncrementalRemove leaves open handle

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski at intel.com<mailto:przemyslaw.hawrylewicz.czarnowski at intel.com>>

---

 Incremental.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Incremental.c b/Incremental.c
index 96bfcec..eb27784 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -883,6 +883,7 @@ int Incremental_container(struct supertype *st, char *devname, int verbose,
 int IncrementalRemove(char *devname, int verbose)
 {
 	int mdfd;
+	int rv;
 	struct mdstat_ent *ent;
 	struct mddev_dev_s devlist;
 
@@ -907,5 +908,7 @@ int IncrementalRemove(char *devname, int verbose)
 	devlist.disposition = 'f';
 	Manage_subdevs(ent->dev, mdfd, &devlist, verbose, 0);
 	devlist.disposition = 'r';
-	return Manage_subdevs(ent->dev, mdfd, &devlist, verbose, 0);
+	rv = Manage_subdevs(ent->dev, mdfd, &devlist, verbose, 0);
+	close(mdfd);
+	return rv;
 }




More information about the pkg-mdadm-commits mailing list