[PATCH] Create.c: close mdfd and generate uevent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
---
 Create.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/Create.c b/Create.c
index 0efa19c..51f8826 100644
--- a/Create.c
+++ b/Create.c
@@ -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:
-- 
2.25.0




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux