Create.c: close mdfd and generate uevent

During mdfd closing change event is not generated because open() is
called before start watching mddevice by udev.
Device is ready at this stage. Unblock device, close fd and
generate event to give a chance next layers to work.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
This commit is contained in:
Mariusz Tkaczyk 2020-11-24 13:39:49 +01:00 committed by Jes Sorensen
parent c3129b39a7
commit ce559078a5
1 changed files with 2 additions and 5 deletions

View File

@ -1083,12 +1083,9 @@ int Create(struct supertype *st, char *mddev,
} else {
pr_err("not starting array - not enough devices.\n");
}
close(mdfd);
/* Give udev a moment to process the Change event caused
* by the close.
*/
usleep(100*1000);
udev_unblock();
close(mdfd);
sysfs_uevent(&info, "change");
return 0;
abort: