summaryrefslogtreecommitdiff
path: root/Assemble.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-11-01 10:50:13 +1100
committerNeilBrown <neilb@suse.de>2012-11-20 12:08:56 +1100
commitb20c8a502ddf846adf5258a646b6c9340778ab8e (patch)
treebea6963663259c31d6c13d3648a2f8d59ca3a933 /Assemble.c
parentd5a221a5254846d6149eb6365cdd8b4c4d60e71e (diff)
Assemble: fix call to wait_for
Recent patch closed 'mdfd' before calling wait_for, which means it doesn't work. Put the close back in the right place. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Assemble.c b/Assemble.c
index 0e51fa47..c2fa0961 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1654,11 +1654,11 @@ try_again:
clean, avail, start_partial_ok);
if (rv == 1 && !pre_exist)
ioctl(mdfd, STOP_ARRAY, NULL);
- close(mdfd);
free(devices);
map_unlock(&map);
if (rv == 0) {
wait_for(chosen_name, mdfd);
+ close(mdfd);
if (auto_assem) {
int usecs = 1;
/* There is a nasty race with 'mdadm --monitor'.
@@ -1685,7 +1685,9 @@ try_again:
usecs <<= 1;
}
}
- }
+ } else
+ close(mdfd);
+
/* '2' means 'OK, but not started yet' */
return rv == 2 ? 0 : rv;
}