mdadm/0103-Create.c-close-mdfd-and-generate-uevent.patch
Neil Brown 52a13dbb79 Accepting request 860474 from home:colyli:branches:Base:System
- Incremental: Remove redundant spare movement logic
  (jsc#SLE-13700, bsc#1180220)
  0112-Incremental-Remove-redundant-spare-movement-logic.patch
- Dump: get stat from a wrong metadata file when restoring metadata
  (jsc#SLE-13700)
  0113-Dump-get-stat-from-a-wrong-metadata-file-when-restor.patch

OBS-URL: https://build.opensuse.org/request/show/860474
OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=193
2021-01-05 21:14:09 +00:00

42 lines
1.1 KiB
Diff

From ce559078a5650afb9f635204b31a89a1fa0061e3 Mon Sep 17 00:00:00 2001
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Date: Tue, 24 Nov 2020 13:39:49 +0100
Subject: [PATCH 09/17] Create.c: close mdfd and generate uevent
Git-commit: ce559078a5650afb9f635204b31a89a1fa0061e3
References: jsc#SLE-13700
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>
Signed-off-by: Coly Li <colyli@suse.de>
---
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.26.2