From: "Gordon Lack" <gml4410@ggr.co.uk>
To: autofs@linux.kernel.org
Subject: autofsv5 bug. Non-existent dirs get "mounted"!
Date: Fri, 10 Nov 2006 11:58:36 +0000 [thread overview]
Message-ID: <4554696C.5030400@ggr.co.uk> (raw)
In-Reply-To: <44AE7785.74E63D70@ggr.co.uk>
[-- Attachment #1: Type: text/plain, Size: 720 bytes --]
If you have a wildcard entry in an automount map and refer to an
entry which does not exist on the NFS server the entry actually appears
within the autofs tree (but with nothing mounted on it).
This causes havoc if you are testing for the existence of a
directory in an automount point.
It took a while to track it down, since all of the code to remove
the locally-created dir if the mount failed was in place. I eventually
found an incorrect reuse of a status variable, which is overwriting the
return code from the mount (failed), with that of a mutex unlock (which
must succeed, or the process dies..).
This happens in daemon/spawn.c
Patch (against distro as on 10 Nov 2006) attached.
[-- Attachment #2: spawn.c.patch --]
[-- Type: text/plain, Size: 858 bytes --]
--- daemon/spawn.c.orig 2006-11-10 10:28:47.270474000 +0000
+++ daemon/spawn.c 2006-11-10 10:11:22.917315000 +0000
@@ -202,11 +202,25 @@
if (waitpid(f, &status, 0) != f)
status = -1; /* waitpid() failed */
- if (use_lock) {
+/* GML - Bug.
+ * This code used status, hence wiping out the result of the mount!
+ * Hence we always return from here with success, even when the
+ * mount actually fails, meaning we get directories created for
+ * non-existent entries...
+ */
+#if 0
+ if (use_lock) {
status = pthread_mutex_unlock(&spawn_mutex);
if (status)
fatal(status);
}
+#endif
+ if (use_lock) {
+ int lstatus;
+ lstatus = pthread_mutex_unlock(&spawn_mutex);
+ if (lstatus)
+ fatal(lstatus);
+ }
pthread_sigmask(SIG_SETMASK, &oldsig, NULL);
pthread_setcancelstate(cancel_state, NULL);
[-- Attachment #3: Type: text/plain, Size: 140 bytes --]
_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs
next prev parent reply other threads:[~2006-11-10 11:58 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-07 15:02 -hosts and -null enabling for autofs v4.1.x Gordon Lack
2006-07-13 13:10 ` Ian Kent
2006-07-13 13:42 ` Jeff Moyer
2006-07-14 11:33 ` Gordon Lack
2006-07-14 13:31 ` Jeff Moyer
2006-07-14 15:58 ` Gordon Lack
2006-08-07 6:56 ` Ian Kent
2006-08-22 14:03 ` Bug (and patch) in autofs init.d script (v4.1.4) Gordon Lack
2006-08-22 14:18 ` Enhancement patch for autofs v4.1.4 init.d script Gordon Lack
2006-09-08 11:31 ` Bug in autofs v4.1.4 init.d script (and fix) Gordon Lack
2006-09-12 12:58 ` Bug in autofs v4.1.4 init.d script for reload " Gordon Lack
2006-09-13 9:42 ` Gordon Lack
2006-11-10 11:58 ` Gordon Lack [this message]
2006-11-10 12:05 ` autofsv5 enhancement - map names in /proc/mounts Gordon Lack
2006-11-10 17:33 ` autofsv5 - mouting files (not dirs) Gordon Lack
2006-11-11 2:58 ` Ian Kent
2006-11-11 2:53 ` autofsv5 enhancement - map names in /proc/mounts Ian Kent
2006-11-13 10:09 ` Gordon Lack
2006-11-13 15:44 ` Ian Kent
2006-11-13 16:58 ` Gordon Lack
2006-11-14 2:00 ` Ian Kent
2006-11-14 10:00 ` Gordon Lack
2006-11-14 11:42 ` Ian Kent
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4554696C.5030400@ggr.co.uk \
--to=gml4410@ggr.co.uk \
--cc=autofs@linux.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.