diff --git a/CHANGELOG b/CHANGELOG index 227cf02..bd51756 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,7 @@ of auto.net. - fix included map recursive map key lookup. - and fix the recursive map key lookup for browsable map case. +- review and fix master map options update for map reload. 1/9/2006 autofs-5.0.1 rc2 ------------------------- diff --git a/daemon/direct.c b/daemon/direct.c index cfa13ad..e6e20fc 100644 --- a/daemon/direct.c +++ b/daemon/direct.c @@ -308,8 +308,29 @@ int do_mount_autofs_direct(struct autofs INIT_LIST_HEAD(&list); if (tree_get_mnt_list(mnts, &list, me->key, 1)) { - if (ap->state == ST_READMAP) + if (ap->state == ST_READMAP) { + time_t tout = ap->exp_timeout; + int save_ioctlfd, ioctlfd; + + save_ioctlfd = ioctlfd = me->ioctlfd; + + if (ioctlfd == -1) + ioctlfd = open(me->key, O_RDONLY); + + if (ioctlfd < 0) { + error(ap->logopt, + "failed to create ioctl fd for %s", + me->key); + return 0; + } + + ioctl(ioctlfd, AUTOFS_IOC_SETTIMEOUT, &tout); + + if (save_ioctlfd == -1) + close(ioctlfd); + return 0; + } if (!unlink_mount_tree(ap, &list)) { debug(ap->logopt, "already mounted as other than autofs " diff --git a/daemon/lookup.c b/daemon/lookup.c index 978f276..d13886b 100644 --- a/daemon/lookup.c +++ b/daemon/lookup.c @@ -937,7 +937,7 @@ int lookup_prune_cache(struct autofs_poi key = strdup(me->key); me = cache_enumerate(mc, me); - if (!key) + if (!key || *key == '*') continue; path = make_fullpath(ap->path, key); diff --git a/lib/master.c b/lib/master.c index 0ee7d38..b145cf0 100644 --- a/lib/master.c +++ b/lib/master.c @@ -896,12 +896,12 @@ #endif break; } next: - state_mutex_unlock(ap); - if (next != ST_INVAL) debug(ap->logopt, "sig %d switching %s from %d to %d", sig, ap->path, ap->state, next); + + state_mutex_unlock(ap); } master_mutex_unlock(); diff --git a/lib/master_parse.y b/lib/master_parse.y index 1a6a3a2..a3adf97 100644 --- a/lib/master_parse.y +++ b/lib/master_parse.y @@ -493,21 +493,22 @@ int master_parse_entry(const char *buffe } set_mnt_logging(entry->ap); } else { -/* struct autofs_point *ap = entry->ap; - unsigned int tout = timeout; */ + struct autofs_point *ap = entry->ap; + time_t tout = timeout; /* - * TODO: how do we know if this is the first read entry - * during a map re-read? - * * Second and subsequent instances of a mount point * use the ghost, log and timeout of the first */ -/* ap->ghost = ghost; - ap->logopt = logopt; - ap->exp_timeout = timeout; - if (ap->ioctlfd != -1 && ap->type == LKP_INDIRECT) - ioctl(ap->ioctlfd, AUTOFS_IOC_SETTIMEOUT, &tout); */ + if (entry->age < age) { + ap->ghost = ghost; + ap->logopt = logopt; + ap->exp_timeout = timeout; + ap->exp_runfreq = (ap->exp_timeout + CHECK_RATIO - 1) / CHECK_RATIO; + if (ap->ioctlfd != -1 && ap->type == LKP_INDIRECT) + ioctl(ap->ioctlfd, AUTOFS_IOC_SETTIMEOUT, &tout); + } + set_mnt_logging(ap); } /*