From 9935cf0f64f3f1e70e7840385e9838c30487dc64 Mon Sep 17 00:00:00 2001 From: Mateusz Grzonka Date: Tue, 21 Nov 2023 01:58:23 +0100 Subject: Mdmonitor: Improve udev event handling Mdmonitor is waiting for udev queue to become empty. Even if the queue becomes empty, udev might still be processing last event. However we want to wait and wake up mdmonitor when udev finished processing events.. Also, the udev queue interface is considered legacy and should not be used outside of udev. Use udev monitor instead, and wake up mdmonitor on every event triggered by udev for md block device. We need to generate more change events from kernel, because they are missing in some situations, for example, when rebuild started. This will be addressed in a separate patch. Move udev specific code into separate functions, and place them in udev.c file. Also move use_udev() logic from lib.c into newly created file. Signed-off-by: Mateusz Grzonka Signed-off-by: Kinga Tanska Signed-off-by: Jes Sorensen --- mdadm.h | 1 + 1 file changed, 1 insertion(+) (limited to 'mdadm.h') diff --git a/mdadm.h b/mdadm.h index b48e6f86..9514cbe5 100644 --- a/mdadm.h +++ b/mdadm.h @@ -1656,6 +1656,7 @@ extern char *conf_line(FILE *file); extern char *conf_word(FILE *file, int allow_key); extern void print_quoted(char *str); extern int use_udev(void); +extern void print_escape(char *str); extern unsigned long GCD(unsigned long a, unsigned long b); extern int conf_name_is_free(char *name); extern bool is_devname_ignore(const char *devname); -- cgit v1.2.3