rpms/autofs/devel autofs-5.0.1-rc2-master-map-reload-options-update.patch, NONE, 1.1 autofs.spec, 1.150, 1.151
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Wed Sep 27 10:11:43 UTC 2006
Author: ikent
Update of /cvs/dist/rpms/autofs/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv13167
Modified Files:
autofs.spec
Added Files:
autofs-5.0.1-rc2-master-map-reload-options-update.patch
Log Message:
* Wed Sep 27 2006 Ian Kent <ikent at redhat.com> - 5.0.1-0.rc2.8
- review and fix master map options update for map reload.
autofs-5.0.1-rc2-master-map-reload-options-update.patch:
CHANGELOG | 1 +
daemon/direct.c | 23 ++++++++++++++++++++++-
daemon/lookup.c | 2 +-
lib/master.c | 4 ++--
lib/master_parse.y | 21 +++++++++++----------
5 files changed, 37 insertions(+), 14 deletions(-)
--- NEW FILE autofs-5.0.1-rc2-master-map-reload-options-update.patch ---
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 iand 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);
}
/*
Index: autofs.spec
===================================================================
RCS file: /cvs/dist/rpms/autofs/devel/autofs.spec,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -r1.150 -r1.151
--- autofs.spec 27 Sep 2006 04:13:42 -0000 1.150
+++ autofs.spec 27 Sep 2006 10:11:40 -0000 1.151
@@ -4,7 +4,7 @@
Summary: A tool for automatically mounting and unmounting filesystems.
Name: autofs
%define version 5.0.1
-%define release 0.rc2.7
+%define release 0.rc2.8
Version: %{version}
Release: %{release}
Epoch: 1
@@ -19,6 +19,7 @@
Patch5: autofs-5.0.1-rc2-remove-UNDERSCORETODOT.patch
Patch6: autofs-5.0.1-rc2-default-master-uses-hosts.patch
Patch7: autofs-5.0.1-rc2-included-map-recursive-key-lookup.patch
+Patch8: autofs-5.0.1-rc2-master-map-reload-options-update.patch
Buildroot: /var/tmp/autofs-tmp
BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, libxml2-devel, cyrus-sasl-devel, openssl-devel
Prereq: chkconfig
@@ -66,6 +67,7 @@
%patch5 -p1
%patch6 -p1
%patch7 -p1
+%patch8 -p1
%build
#CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir}
@@ -122,6 +124,9 @@
%{_libdir}/autofs/*
%changelog
+* Wed Sep 27 2006 Ian Kent <ikent at redhat.com> - 5.0.1-0.rc2.8
+- review and fix master map options update for map reload.
+
* Wed Sep 27 2006 Ian Kent <ikent at redhat.com> - 5.0.1-0.rc2.7
- make default installed master map for /net use "-hosts" instead
of auto.net.
More information about the fedora-cvs-commits
mailing list