- update patches, documentation and comments only change.

- rename patch and add to CVS.
This commit is contained in:
Ian Kent 2008-05-14 06:02:09 +00:00
parent d5fc0dc376
commit 6a06040828
2 changed files with 44 additions and 39 deletions

View File

@ -1,33 +1,41 @@
autofs 5.0.3 - check for nohide mounts
autofs 5.0.3 - check for exported mounts automatically mounted by kernel
From: Ian Kent <raven@themaw.net>
If a server exports file systems with the nohide option
autofs will mistakenly over mount them when it constructs
and mounts its multi-mount triggers.
If a server exports file systems that are automatically mounted by
the kernel client autofs will mistakenly over mount them when it
constructs and mounts its multi-mount triggers.
This patch makes autofs check for nohide mounts and ignores
them if the kernel mounts them while it mounts multi-mount
triggers.
This patch makes autofs check for this case and ignores them if the
kernel mounts them while it mounts multi-mount triggers.
We don't want to fight with NFS over mounting these because
it confuses autofs and they magically go away when the owner
mount is umounted. This isn't ideal because autofs will mount
the nohide exports while constructing its multi-mount triggers
but it is unavoidable at the moment.
We don't want to fight with NFS over mounting these because it
confuses autofs and they magically go away when the owner mount is
umounted. This isn't ideal because autofs will mount these mounts
while constructing its multi-mount triggers but it is unavoidable
at the moment.
---
CHANGELOG | 1 +
daemon/direct.c | 26 ++++++++++++++++++--------
include/automount.h | 4 ++++
lib/parse_subs.c | 26 ++++++++++++++++++--------
3 files changed, 40 insertions(+), 16 deletions(-)
4 files changed, 41 insertions(+), 16 deletions(-)
diff --git a/daemon/direct.c b/daemon/direct.c
index a9dda87..c67f38a 100644
--- a/daemon/direct.c
+++ b/daemon/direct.c
@@ -664,12 +664,12 @@ int mount_autofs_offset(struct autofs_point *ap, struct mapent *me)
--- autofs-5.0.3.orig/CHANGELOG
+++ autofs-5.0.3/CHANGELOG
@@ -12,6 +12,7 @@
- init SASL callbacks on every ldap lookup library load.
- fix incorrect match of map type name when included in map name.
- fix incorrect pthreads condition handling for mount requests.
+- add check for exports automatically mounted by NFS kernel client.
14/01/2008 autofs-5.0.3
-----------------------
--- autofs-5.0.3.orig/daemon/direct.c
+++ autofs-5.0.3/daemon/direct.c
@@ -664,12 +664,12 @@ int mount_autofs_offset(struct autofs_po
if (ap->state != ST_READMAP)
warn(ap->logopt,
"trigger %s already mounted", me->key);
@ -42,7 +50,7 @@ index a9dda87..c67f38a 100644
}
status = pthread_once(&key_mnt_params_once, key_mnt_params_init);
@@ -683,7 +683,7 @@ int mount_autofs_offset(struct autofs_point *ap, struct mapent *me)
@@ -683,7 +683,7 @@ int mount_autofs_offset(struct autofs_po
crit(ap->logopt,
"mnt_params value create failed for offset mount %s",
me->key);
@ -51,7 +59,7 @@ index a9dda87..c67f38a 100644
}
mp->options = NULL;
@@ -697,12 +697,22 @@ int mount_autofs_offset(struct autofs_point *ap, struct mapent *me)
@@ -697,12 +697,22 @@ int mount_autofs_offset(struct autofs_po
if (!mp->options) {
mp->options = make_options_string(ap->path, ap->kpipefd, "offset");
if (!mp->options)
@ -65,8 +73,8 @@ index a9dda87..c67f38a 100644
+ /*
+ * If the mount point directory is a real mount
+ * and it isn't the root offset then it must be
+ * a "nohide" mount, automounted by the kernel NFS
+ * client.
+ * a mount that has been automatically mounted by
+ * the kernel NFS client.
+ */
+ if (me->multi != me &&
+ is_mounted(_PROC_MOUNTS, me->key, MNTS_REAL))
@ -75,7 +83,7 @@ index a9dda87..c67f38a 100644
/*
* If we recieve an error, and it's EEXIST
* we know the directory was not created.
@@ -721,13 +731,13 @@ int mount_autofs_offset(struct autofs_point *ap, struct mapent *me)
@@ -721,13 +731,13 @@ int mount_autofs_offset(struct autofs_po
debug(ap->logopt,
"can't create mount directory: %s, %s",
me->key, estr);
@ -91,7 +99,7 @@ index a9dda87..c67f38a 100644
}
} else {
/* No errors so the directory was successfully created */
@@ -787,7 +797,7 @@ int mount_autofs_offset(struct autofs_point *ap, struct mapent *me)
@@ -787,7 +797,7 @@ int mount_autofs_offset(struct autofs_po
debug(ap->logopt, "mounted trigger %s", me->key);
@ -109,10 +117,8 @@ index a9dda87..c67f38a 100644
}
static int expire_direct(int ioctlfd, const char *path, unsigned int when, unsigned int logopt)
diff --git a/include/automount.h b/include/automount.h
index cd8ce7b..d59be77 100644
--- a/include/automount.h
+++ b/include/automount.h
--- autofs-5.0.3.orig/include/automount.h
+++ autofs-5.0.3/include/automount.h
@@ -468,6 +468,10 @@ struct autofs_point {
/* Standard functions used by daemon or modules */
@ -124,11 +130,9 @@ index cd8ce7b..d59be77 100644
void *handle_mounts(void *arg);
int umount_multi(struct autofs_point *ap, const char *path, int incl);
int send_ready(unsigned logopt, int ioctlfd, unsigned int wait_queue_token);
diff --git a/lib/parse_subs.c b/lib/parse_subs.c
index 5422fef..27cb0fc 100644
--- a/lib/parse_subs.c
+++ b/lib/parse_subs.c
@@ -390,7 +390,7 @@ int mount_multi_triggers(struct autofs_point *ap, char *root, struct mapent *me,
--- autofs-5.0.3.orig/lib/parse_subs.c
+++ autofs-5.0.3/lib/parse_subs.c
@@ -390,7 +390,7 @@ int mount_multi_triggers(struct autofs_p
struct list_head *pos = NULL;
unsigned int fs_path_len;
unsigned int mounted;
@ -137,7 +141,7 @@ index 5422fef..27cb0fc 100644
fs_path_len = strlen(root) + strlen(base);
if (fs_path_len > PATH_MAX)
@@ -411,15 +411,25 @@ int mount_multi_triggers(struct autofs_point *ap, char *root, struct mapent *me,
@@ -411,15 +411,25 @@ int mount_multi_triggers(struct autofs_p
}
oe = cache_lookup_offset(base, offset, start, &me->multi_list);
@ -167,7 +171,7 @@ index 5422fef..27cb0fc 100644
cont:
offset = cache_get_offset(base,
offset, start, &me->multi_list, &pos);
@@ -457,7 +467,7 @@ int umount_multi_triggers(struct autofs_point *ap, char *root, struct mapent *me
@@ -457,7 +467,7 @@ int umount_multi_triggers(struct autofs_
oe = cache_lookup_offset(mm_base, offset, start, &me->multi_list);
/* root offset is a special case */
@ -176,7 +180,7 @@ index 5422fef..27cb0fc 100644
continue;
/*
@@ -481,7 +491,7 @@ int umount_multi_triggers(struct autofs_point *ap, char *root, struct mapent *me
@@ -481,7 +491,7 @@ int umount_multi_triggers(struct autofs_
while ((offset = cache_get_offset(mm_base, offset, start, mm_root, &pos))) {
oe = cache_lookup_offset(mm_base, offset, start, &me->multi_list);
/* root offset is a special case */
@ -185,7 +189,7 @@ index 5422fef..27cb0fc 100644
continue;
debug(ap->logopt, "umount offset %s", oe->key);
@@ -505,7 +515,7 @@ int umount_multi_triggers(struct autofs_point *ap, char *root, struct mapent *me
@@ -505,7 +515,7 @@ int umount_multi_triggers(struct autofs_
if (is_mounted(_PATH_MOUNTED, root, MNTS_REAL)) {
info(ap->logopt, "unmounting dir = %s", root);
if (umount_ent(ap, root)) {

View File

@ -4,7 +4,7 @@
Summary: A tool for automatically mounting and unmounting filesystems
Name: autofs
Version: 5.0.3
Release: 16
Release: 17
Epoch: 1
License: GPL
Group: System Environment/Daemons
@ -131,8 +131,9 @@ fi
%{_libdir}/autofs/
%changelog
* Mon May 12 2008 Ian Kent <ikent@redhat.com> - 5.0.3-16
* Wed May 14 2008 Ian Kent <ikent@redhat.com> - 5.0.3-16
- update patches, documentation and comments only change.
- rename patch and add to CVS.
* Mon May 12 2008 Ian Kent <ikent@redhat.com> - 5.0.3-14
- check for nohide mounts (bz 442618).