diff options
author | Kinga Stefaniuk <kinga.stefaniuk@intel.com> | 2024-05-07 05:38:56 +0200 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-05-14 11:08:06 +0200 |
commit | aa1cc5815d2b14a8b47add18cfaa8264e19c10ce (patch) | |
tree | 19b8e321caa9d3107ca951b26c735e06372fea8c /Assemble.c | |
parent | util.c: change devnm to const in mdmon functions (diff) | |
download | mdadm-aa1cc5815d2b14a8b47add18cfaa8264e19c10ce.tar.xz mdadm-aa1cc5815d2b14a8b47add18cfaa8264e19c10ce.zip |
Wait for mdmon when it is stared via systemd
When mdmon is being started it may need few seconds to start.
For now, we didn't wait for it. Introduce wait_for_mdmon()
function, which waits up to 5 seconds for mdmon to start completely.
Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Diffstat (limited to 'Assemble.c')
-rw-r--r-- | Assemble.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2173,8 +2173,8 @@ int assemble_container_content(struct supertype *st, int mdfd, if (!mdmon_running(st->container_devnm)) start_mdmon(st->container_devnm); ping_monitor(st->container_devnm); - if (mdmon_running(st->container_devnm) && - st->update_tail == NULL) + if (wait_for_mdmon(st->container_devnm) == MDADM_STATUS_SUCCESS && + !st->update_tail) st->update_tail = &st->updates; } |