From: Ian Kent <raven@themaw.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>,
autofs mailing list <autofs@linux.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: [PATCH] autofs4 - use lookup access intent to support recursive bind mounts
Date: Mon, 28 Apr 2008 14:14:54 +0800 (WST) [thread overview]
Message-ID: <Pine.LNX.4.64.0804281410160.10684@raven.themaw.net> (raw)
Hi Andrew,
For autofs maps that recursively reference other map entries in their
mount point path we need to ensure that these mounts are performed
prior to the current mount request being done. We've used the access
system call, made just prior to performing the mount, to make this
happen. In the case of bind mounts, however, the lookup flags in
the path walk don't trigger a mount. To do this we need to also
trigger a mount when we see the LOOKUP_ACCESS flag.
Signed-off-by: Ian Kent <raven@themaw.net>
Ian
---
diff -up linux-2.6.25-mm1/fs/autofs4/root.c.lookup-access-intent-trigger linux-2.6.25-mm1/fs/autofs4/root.c
--- linux-2.6.25-mm1/fs/autofs4/root.c.lookup-access-intent-trigger 2008-04-28 11:33:20.000000000 +0800
+++ linux-2.6.25-mm1/fs/autofs4/root.c 2008-04-28 11:36:06.000000000 +0800
@@ -19,6 +19,8 @@
#include <linux/time.h>
#include "autofs_i.h"
+#define LOOKUP_TRIGGER_FLAGS (LOOKUP_CONTINUE|LOOKUP_DIRECTORY|LOOKUP_ACCESS)
+
static int autofs4_dir_symlink(struct inode *,struct dentry *,const char *);
static int autofs4_dir_unlink(struct inode *,struct dentry *);
static int autofs4_dir_rmdir(struct inode *,struct dentry *);
@@ -291,7 +293,7 @@ static int try_to_fill_dentry(struct den
return status;
}
/* Trigger mount for path component or follow link */
- } else if (flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY) ||
+ } else if (flags & LOOKUP_TRIGGER_FLAGS ||
current->link_count) {
DPRINTK("waiting for mount name=%.*s",
dentry->d_name.len, dentry->d_name.name);
@@ -335,7 +337,7 @@ static void *autofs4_follow_link(struct
nd->flags);
/* If it's our master or we shouldn't trigger a mount we're done */
- lookup_type = nd->flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY);
+ lookup_type = nd->flags & LOOKUP_TRIGGER_FLAGS;
if (oz_mode || !lookup_type)
goto done;
next reply other threads:[~2008-04-28 6:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-28 6:14 Ian Kent [this message]
2008-04-28 6:22 ` Al Viro
2008-04-28 6:38 ` Ian Kent
2008-04-28 7:05 ` Al Viro
2008-04-28 7:25 ` Ian Kent
2008-04-28 7:53 ` 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=Pine.LNX.4.64.0804281410160.10684@raven.themaw.net \
--to=raven@themaw.net \
--cc=akpm@linux-foundation.org \
--cc=autofs@linux.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®