summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorShminderjit Singh <shminderjit.singh@oracle.com>2024-06-24 10:58:51 +0200
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-07-02 12:15:46 +0200
commit3cbe13403ec0c78374343dcd889609aefe791f9b (patch)
tree4aa37b64750e1c2729150ea5853daf6accd08673 /mdadm.h
parentCI: fix excluded files in checkpatch.conf (diff)
downloadmdadm-3cbe13403ec0c78374343dcd889609aefe791f9b.tar.xz
mdadm-3cbe13403ec0c78374343dcd889609aefe791f9b.zip
mdadm: Fix socket connection failure when mdmon runs in foreground mode.
While creating an IMSM RAID, mdadm will wait for the mdmon main process to finish if mdmon runs in forking mode. This is because with "Type=forking" in the mdmon service unit file, "systemctl start service" will block until the main process of mdmon exits. At that moment, mdmon has already created the socket, so the subsequent socket connect from mdadm will succeed. However, when mdmon runs in foreground mode (without "Type=forking" in the service unit file), "systemctl start service" will return once the mdmon process starts. This causes mdadm and mdmon to run in parallel, which may lead to a socket connection failure since mdmon has not yet initialized the socket when mdadm tries to connect. If the next instruction/command is to access this device and try to write to it, a permission error will occur since mdmon has not yet set the array to RW mode. Signed-off-by: Shminderjit Singh <shminderjit.singh@oracle.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/mdadm.h b/mdadm.h
index e9f764a2..27009154 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -1776,6 +1776,7 @@ extern int is_subarray_active(char *subarray, char *devname);
extern int open_subarray(char *dev, char *subarray, struct supertype *st, int quiet);
extern struct superswitch *version_to_superswitch(char *vers);
+extern mdadm_status_t wait_for_mdmon_control_socket(const char *container_devnm);
extern int mdmon_running(const char *devnm);
extern int mdmon_pid(const char *devnm);
extern mdadm_status_t wait_for_mdmon(const char *devnm);