autofs-5.1.8 - dont delay expire From: Ian Kent There's a delay on expire of submounts that can be as much as the expire timeout. This was originally an attempt to reduce re-reading the map but it can cause very long delays on expire. So get rid of the delay and allow submounts to expire normally. Signed-off-by: Ian Kent --- CHANGELOG | 1 + daemon/master.c | 9 ++++----- daemon/state.c | 30 ++++-------------------------- 3 files changed, 9 insertions(+), 31 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index c24a7c82..de25c072 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -59,6 +59,7 @@ - fix return status of mount_autofs(). - don't close lookup at umount. - fix deadlock in lookups. +- dont delay expire. 19/10/2021 autofs-5.1.8 - add xdr_exports(). diff --git a/daemon/master.c b/daemon/master.c index c082d319..178fb842 100644 --- a/daemon/master.c +++ b/daemon/master.c @@ -1259,17 +1259,16 @@ int master_notify_submount(struct autofs_point *ap, const char *path, enum state st_wait_task(this->ap, state, 0); /* - * If our submount gets to state ST_SHUTDOWN, ST_SHUTDOWN_PENDING or - * ST_SHUTDOWN_FORCE we need to wait until it goes away or changes - * to ST_READY. + * If our submount gets to state ST_SHUTDOWN_PENDING or + * ST_SHUTDOWN_FORCE we need to wait until it goes away + * or changes to state ST_SHUTDOWN or ST_READY. */ st_mutex_lock(); while ((sbmnt = mnts_find_submount(path))) { struct timespec t = { 0, 300000000 }; struct timespec r; - if (sbmnt->ap->state != ST_SHUTDOWN && - sbmnt->ap->state != ST_SHUTDOWN_PENDING && + if (sbmnt->ap->state != ST_SHUTDOWN_PENDING && sbmnt->ap->state != ST_SHUTDOWN_FORCE) { ret = 0; mnts_put_mount(sbmnt); diff --git a/daemon/state.c b/daemon/state.c index 4e70a330..28ad68ca 100644 --- a/daemon/state.c +++ b/daemon/state.c @@ -99,36 +99,14 @@ void expire_cleanup(void *arg) /* * If we're a submount and we've just pruned or * expired everything away, try to shut down. - * - * Since we use the the fact that a mount will not - * expire for at least ap->exp_timeout to avoid a - * mount <-> expire race we need to wait before - * letting a submount expire away. We also need - * them to go away fairly quickly so the owner - * mount expires in a reasonable time. Just skip - * one expire check after it's no longer busy before - * allowing it to shutdown. - * - * But if this mount point is an amd format map it - * is better to keep the mount around longer. This - * is because of the common heavy reuse of maps in - * amd maps and we want to try and avoid constantly - * re-reading large maps. */ if (ap->submount && !success) { rv = ops->askumount(ap->logopt, ap->ioctlfd, &idle); - if (!rv && idle && ap->submount > 1) { - struct map_source *map = ap->entry->maps; - - if (ap->submount > 4 || - !(map->flags & MAP_FLAG_FORMAT_AMD)) { - next = ST_SHUTDOWN_PENDING; - break; - } + if (!rv && idle) { + next = ST_SHUTDOWN_PENDING; + break; } - ap->submount++; - } else if (ap->submount > 1) - ap->submount = 1; + } if (ap->state == ST_EXPIRE) conditional_alarm_add(ap, ap->exp_runfreq);