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>
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'.
usecs <<= 1;
}
}
- }
+ } else
+ close(mdfd);
+
/* '2' means 'OK, but not started yet' */
return rv == 2 ? 0 : rv;
}