- update patches, documentation and comments only change.
- rename patch and add to CVS.
This commit is contained in:
parent
d5fc0dc376
commit
6a06040828
@ -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>
|
From: Ian Kent <raven@themaw.net>
|
||||||
|
|
||||||
If a server exports file systems with the nohide option
|
If a server exports file systems that are automatically mounted by
|
||||||
autofs will mistakenly over mount them when it constructs
|
the kernel client autofs will mistakenly over mount them when it
|
||||||
and mounts its multi-mount triggers.
|
constructs and mounts its multi-mount triggers.
|
||||||
|
|
||||||
This patch makes autofs check for nohide mounts and ignores
|
This patch makes autofs check for this case and ignores them if the
|
||||||
them if the kernel mounts them while it mounts multi-mount
|
kernel mounts them while it mounts multi-mount triggers.
|
||||||
triggers.
|
|
||||||
|
|
||||||
We don't want to fight with NFS over mounting these because
|
We don't want to fight with NFS over mounting these because it
|
||||||
it confuses autofs and they magically go away when the owner
|
confuses autofs and they magically go away when the owner mount is
|
||||||
mount is umounted. This isn't ideal because autofs will mount
|
umounted. This isn't ideal because autofs will mount these mounts
|
||||||
the nohide exports while constructing its multi-mount triggers
|
while constructing its multi-mount triggers but it is unavoidable
|
||||||
but it is unavoidable at the moment.
|
at the moment.
|
||||||
---
|
---
|
||||||
|
|
||||||
|
CHANGELOG | 1 +
|
||||||
daemon/direct.c | 26 ++++++++++++++++++--------
|
daemon/direct.c | 26 ++++++++++++++++++--------
|
||||||
include/automount.h | 4 ++++
|
include/automount.h | 4 ++++
|
||||||
lib/parse_subs.c | 26 ++++++++++++++++++--------
|
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
|
--- autofs-5.0.3.orig/CHANGELOG
|
||||||
index a9dda87..c67f38a 100644
|
+++ autofs-5.0.3/CHANGELOG
|
||||||
--- a/daemon/direct.c
|
@@ -12,6 +12,7 @@
|
||||||
+++ b/daemon/direct.c
|
- init SASL callbacks on every ldap lookup library load.
|
||||||
@@ -664,12 +664,12 @@ int mount_autofs_offset(struct autofs_point *ap, struct mapent *me)
|
- 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)
|
if (ap->state != ST_READMAP)
|
||||||
warn(ap->logopt,
|
warn(ap->logopt,
|
||||||
"trigger %s already mounted", me->key);
|
"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);
|
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,
|
crit(ap->logopt,
|
||||||
"mnt_params value create failed for offset mount %s",
|
"mnt_params value create failed for offset mount %s",
|
||||||
me->key);
|
me->key);
|
||||||
@ -51,7 +59,7 @@ index a9dda87..c67f38a 100644
|
|||||||
}
|
}
|
||||||
mp->options = NULL;
|
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) {
|
if (!mp->options) {
|
||||||
mp->options = make_options_string(ap->path, ap->kpipefd, "offset");
|
mp->options = make_options_string(ap->path, ap->kpipefd, "offset");
|
||||||
if (!mp->options)
|
if (!mp->options)
|
||||||
@ -65,8 +73,8 @@ index a9dda87..c67f38a 100644
|
|||||||
+ /*
|
+ /*
|
||||||
+ * If the mount point directory is a real mount
|
+ * If the mount point directory is a real mount
|
||||||
+ * and it isn't the root offset then it must be
|
+ * and it isn't the root offset then it must be
|
||||||
+ * a "nohide" mount, automounted by the kernel NFS
|
+ * a mount that has been automatically mounted by
|
||||||
+ * client.
|
+ * the kernel NFS client.
|
||||||
+ */
|
+ */
|
||||||
+ if (me->multi != me &&
|
+ if (me->multi != me &&
|
||||||
+ is_mounted(_PROC_MOUNTS, me->key, MNTS_REAL))
|
+ 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
|
* If we recieve an error, and it's EEXIST
|
||||||
* we know the directory was not created.
|
* 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,
|
debug(ap->logopt,
|
||||||
"can't create mount directory: %s, %s",
|
"can't create mount directory: %s, %s",
|
||||||
me->key, estr);
|
me->key, estr);
|
||||||
@ -91,7 +99,7 @@ index a9dda87..c67f38a 100644
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* No errors so the directory was successfully created */
|
/* 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);
|
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)
|
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
|
--- autofs-5.0.3.orig/include/automount.h
|
||||||
index cd8ce7b..d59be77 100644
|
+++ autofs-5.0.3/include/automount.h
|
||||||
--- a/include/automount.h
|
|
||||||
+++ b/include/automount.h
|
|
||||||
@@ -468,6 +468,10 @@ struct autofs_point {
|
@@ -468,6 +468,10 @@ struct autofs_point {
|
||||||
|
|
||||||
/* Standard functions used by daemon or modules */
|
/* Standard functions used by daemon or modules */
|
||||||
@ -124,11 +130,9 @@ index cd8ce7b..d59be77 100644
|
|||||||
void *handle_mounts(void *arg);
|
void *handle_mounts(void *arg);
|
||||||
int umount_multi(struct autofs_point *ap, const char *path, int incl);
|
int umount_multi(struct autofs_point *ap, const char *path, int incl);
|
||||||
int send_ready(unsigned logopt, int ioctlfd, unsigned int wait_queue_token);
|
int send_ready(unsigned logopt, int ioctlfd, unsigned int wait_queue_token);
|
||||||
diff --git a/lib/parse_subs.c b/lib/parse_subs.c
|
--- autofs-5.0.3.orig/lib/parse_subs.c
|
||||||
index 5422fef..27cb0fc 100644
|
+++ autofs-5.0.3/lib/parse_subs.c
|
||||||
--- a/lib/parse_subs.c
|
@@ -390,7 +390,7 @@ int mount_multi_triggers(struct autofs_p
|
||||||
+++ b/lib/parse_subs.c
|
|
||||||
@@ -390,7 +390,7 @@ int mount_multi_triggers(struct autofs_point *ap, char *root, struct mapent *me,
|
|
||||||
struct list_head *pos = NULL;
|
struct list_head *pos = NULL;
|
||||||
unsigned int fs_path_len;
|
unsigned int fs_path_len;
|
||||||
unsigned int mounted;
|
unsigned int mounted;
|
||||||
@ -137,7 +141,7 @@ index 5422fef..27cb0fc 100644
|
|||||||
|
|
||||||
fs_path_len = strlen(root) + strlen(base);
|
fs_path_len = strlen(root) + strlen(base);
|
||||||
if (fs_path_len > PATH_MAX)
|
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);
|
oe = cache_lookup_offset(base, offset, start, &me->multi_list);
|
||||||
@ -167,7 +171,7 @@ index 5422fef..27cb0fc 100644
|
|||||||
cont:
|
cont:
|
||||||
offset = cache_get_offset(base,
|
offset = cache_get_offset(base,
|
||||||
offset, start, &me->multi_list, &pos);
|
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);
|
oe = cache_lookup_offset(mm_base, offset, start, &me->multi_list);
|
||||||
/* root offset is a special case */
|
/* root offset is a special case */
|
||||||
@ -176,7 +180,7 @@ index 5422fef..27cb0fc 100644
|
|||||||
continue;
|
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))) {
|
while ((offset = cache_get_offset(mm_base, offset, start, mm_root, &pos))) {
|
||||||
oe = cache_lookup_offset(mm_base, offset, start, &me->multi_list);
|
oe = cache_lookup_offset(mm_base, offset, start, &me->multi_list);
|
||||||
/* root offset is a special case */
|
/* root offset is a special case */
|
||||||
@ -185,7 +189,7 @@ index 5422fef..27cb0fc 100644
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
debug(ap->logopt, "umount offset %s", oe->key);
|
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)) {
|
if (is_mounted(_PATH_MOUNTED, root, MNTS_REAL)) {
|
||||||
info(ap->logopt, "unmounting dir = %s", root);
|
info(ap->logopt, "unmounting dir = %s", root);
|
||||||
if (umount_ent(ap, root)) {
|
if (umount_ent(ap, root)) {
|
@ -4,7 +4,7 @@
|
|||||||
Summary: A tool for automatically mounting and unmounting filesystems
|
Summary: A tool for automatically mounting and unmounting filesystems
|
||||||
Name: autofs
|
Name: autofs
|
||||||
Version: 5.0.3
|
Version: 5.0.3
|
||||||
Release: 16
|
Release: 17
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
License: GPL
|
License: GPL
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
@ -131,8 +131,9 @@ fi
|
|||||||
%{_libdir}/autofs/
|
%{_libdir}/autofs/
|
||||||
|
|
||||||
%changelog
|
%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.
|
- 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
|
* Mon May 12 2008 Ian Kent <ikent@redhat.com> - 5.0.3-14
|
||||||
- check for nohide mounts (bz 442618).
|
- check for nohide mounts (bz 442618).
|
||||||
|
Loading…
Reference in New Issue
Block a user