From: Czarnowska, Anna Sent: Monday, July 05, 2010 11:24 AM To: Neil Brown Cc: linux-raid@xxxxxxxxxxxxxxx; Czarnowska, Anna; Hawrylewicz Czarnowski, Przemyslaw; Labun, Marcin; Neubauer, Wojciech; Williams, Dan J; Ciechanowski, Ed; dledford@xxxxxxxxxx Subject: [PATCH 11/33] fix: IncrementalRemove leaves open handle From: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@xxxxxxxxx> Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@xxxxxxxxx> --- Incremental.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/Incremental.c b/Incremental.c index 3501bc1..4455a89 100644 --- a/Incremental.c +++ b/Incremental.c @@ -866,6 +866,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; @@ -890,7 +891,9 @@ int IncrementalRemove(char *devname, int verbose) devlist.disposition = 'f'; Manage_subdevs(ent->dev, mdfd, &devlist, verbose); devlist.disposition = 'r'; - return Manage_subdevs(ent->dev, mdfd, &devlist, verbose); + rv = Manage_subdevs(ent->dev, mdfd, &devlist, verbose); + close(mdfd); + return rv; } /* -- 1.6.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html