aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2023-05-18 20:03:00 +0800
committerIan Kent <raven@themaw.net>2023-05-24 09:54:03 +0800
commit7319f1b96a623ede8e0b006ec051bec56c9589d5 (patch)
tree418e7b9883aba7a2518475d6ab4d811eaad603c3
parent501a54eaca4ce8355c94db5b9f4cbec3e64cf4b7 (diff)
downloadautofs-7319f1b96a623ede8e0b006ec051bec56c9589d5.tar.gz
autofs-5.1.8 - fix fix mount tree startup reconnect
In function master_mount_mounts() commit 635b90eccee9 checks if the current top level mount is already running by using two things, if the mount handling thread id is set in the autofs mount point structure and if the mount point path is a mounted autofs file system. But the top level master map entry for a direct mount map is the reserved path "/-" and doesn't have an actual mount associated with it so a mounted check can't be used. But we know that top level mounts start in state ST_INIT and once that state is changed it never changes back to it. So using the presence of the mount handling thread id and the state not being ST_INIT is sufficient to know if this is a new mount or not. Fixes: 635b90eccee9 ("autofs-5.1.8 - fix mount tree startup reconnect") Signed-off-by: Ian Kent <raven@themaw.net>
-rw-r--r--CHANGELOG1
-rw-r--r--daemon/master.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 4e2b3560..8c2f30eb 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -72,6 +72,7 @@
- fix mount tree startup reconnect.
- fix unterminated read in handle_cmd_pipe_fifo_message().
- fix memory leak in sasl_do_kinit()
+- fix fix mount tree startup reconnect.
19/10/2021 autofs-5.1.8
- add xdr_exports().
diff --git a/daemon/master.c b/daemon/master.c
index 3c2ed9d2..6885f7c7 100644
--- a/daemon/master.c
+++ b/daemon/master.c
@@ -1561,7 +1561,7 @@ int master_mount_mounts(struct master *master, time_t age)
}
cache_unlock(nc);
cont:
- if (ap->thid && is_mounted(this->path, MNTS_AUTOFS))
+ if (ap->thid && ap->state != ST_INIT)
check_update_map_sources(this, master->readall);
else {
if (!master_do_mount(this)) {