* [PATCH] autofs4 - use lookup access intent to support recursive bind mounts
@ 2008-04-28 6:14 Ian Kent
2008-04-28 6:22 ` Al Viro
0 siblings, 1 reply; 6+ messages in thread
From: Ian Kent @ 2008-04-28 6:14 UTC (permalink / raw)
To: Andrew Morton; +Cc: Kernel Mailing List, autofs mailing list, linux-fsdevel
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;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] autofs4 - use lookup access intent to support recursive bind mounts
2008-04-28 6:14 [PATCH] autofs4 - use lookup access intent to support recursive bind mounts Ian Kent
@ 2008-04-28 6:22 ` Al Viro
2008-04-28 6:38 ` Ian Kent
0 siblings, 1 reply; 6+ messages in thread
From: Al Viro @ 2008-04-28 6:22 UTC (permalink / raw)
To: Ian Kent
Cc: Andrew Morton, Kernel Mailing List, autofs mailing list,
linux-fsdevel
On Mon, Apr 28, 2008 at 02:14:54PM +0800, Ian Kent wrote:
>
> 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.
That's too fscking bad, since ->lookup() is about to lose access to
nameidata *and* flags for anything but the last step. IOW, we'll need
cleaner solution...
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] autofs4 - use lookup access intent to support recursive bind mounts
2008-04-28 6:22 ` Al Viro
@ 2008-04-28 6:38 ` Ian Kent
2008-04-28 7:05 ` Al Viro
0 siblings, 1 reply; 6+ messages in thread
From: Ian Kent @ 2008-04-28 6:38 UTC (permalink / raw)
To: Al Viro
Cc: Andrew Morton, Kernel Mailing List, autofs mailing list,
linux-fsdevel
On Mon, 2008-04-28 at 07:22 +0100, Al Viro wrote:
> On Mon, Apr 28, 2008 at 02:14:54PM +0800, Ian Kent wrote:
> >
> > 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.
>
> That's too fscking bad, since ->lookup() is about to lose access to
> nameidata *and* flags for anything but the last step. IOW, we'll need
> cleaner solution...
Spell it out for me please!
Ian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] autofs4 - use lookup access intent to support recursive bind mounts
2008-04-28 6:38 ` Ian Kent
@ 2008-04-28 7:05 ` Al Viro
2008-04-28 7:25 ` Ian Kent
0 siblings, 1 reply; 6+ messages in thread
From: Al Viro @ 2008-04-28 7:05 UTC (permalink / raw)
To: Ian Kent
Cc: Andrew Morton, Kernel Mailing List, autofs mailing list,
linux-fsdevel
On Mon, Apr 28, 2008 at 02:38:25PM +0800, Ian Kent wrote:
>
> On Mon, 2008-04-28 at 07:22 +0100, Al Viro wrote:
> > On Mon, Apr 28, 2008 at 02:14:54PM +0800, Ian Kent wrote:
> > >
> > > 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.
> >
> > That's too fscking bad, since ->lookup() is about to lose access to
> > nameidata *and* flags for anything but the last step. IOW, we'll need
> > cleaner solution...
>
> Spell it out for me please!
->lookup() and friends are going to stop getting struct nameidata *.
->follow_link() obviously will keep it; ->d_revalidate() should
lose the sucker, but we might have to split it in two methods (which
is probably what'll be needed in your case).
At the same time struct open_intent is going to die, BTW, but that
won't matter for autofs, AFAICT.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] autofs4 - use lookup access intent to support recursive bind mounts
2008-04-28 7:05 ` Al Viro
@ 2008-04-28 7:25 ` Ian Kent
2008-04-28 7:53 ` Ian Kent
0 siblings, 1 reply; 6+ messages in thread
From: Ian Kent @ 2008-04-28 7:25 UTC (permalink / raw)
To: Al Viro
Cc: Andrew Morton, Kernel Mailing List, autofs mailing list,
linux-fsdevel
On Mon, 2008-04-28 at 08:05 +0100, Al Viro wrote:
> On Mon, Apr 28, 2008 at 02:38:25PM +0800, Ian Kent wrote:
> >
> > On Mon, 2008-04-28 at 07:22 +0100, Al Viro wrote:
> > > On Mon, Apr 28, 2008 at 02:14:54PM +0800, Ian Kent wrote:
> > > >
> > > > 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.
> > >
> > > That's too fscking bad, since ->lookup() is about to lose access to
> > > nameidata *and* flags for anything but the last step. IOW, we'll need
> > > cleaner solution...
> >
> > Spell it out for me please!
>
> ->lookup() and friends are going to stop getting struct nameidata *.
> ->follow_link() obviously will keep it; ->d_revalidate() should
> lose the sucker, but we might have to split it in two methods (which
> is probably what'll be needed in your case).
Right.
I don't see that yet in 2.6.25-mm1, are there any preliminary patches I
could look at?
>
> At the same time struct open_intent is going to die, BTW, but that
> won't matter for autofs, AFAICT.
Yep, autofs doesn't care about this, it only cares about being able to
ask userspace to try a mount when needed.
Actually, using the flags to decide when to call back the daemon
wouldn't be needed at all except for mount storms caused by aggressive
GUI file system scanning and color ls and the like.
Ian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] autofs4 - use lookup access intent to support recursive bind mounts
2008-04-28 7:25 ` Ian Kent
@ 2008-04-28 7:53 ` Ian Kent
0 siblings, 0 replies; 6+ messages in thread
From: Ian Kent @ 2008-04-28 7:53 UTC (permalink / raw)
To: Al Viro
Cc: Andrew Morton, Kernel Mailing List, autofs mailing list,
linux-fsdevel
On Mon, 2008-04-28 at 15:25 +0800, Ian Kent wrote:
> > ->lookup() and friends are going to stop getting struct nameidata *.
> > ->follow_link() obviously will keep it; ->d_revalidate() should
> > lose the sucker, but we might have to split it in two methods (which
> > is probably what'll be needed in your case).
>
> Right.
Would it be sensible to use dentry->d_flags for this purpose?
Ian
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-04-28 7:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-28 6:14 [PATCH] autofs4 - use lookup access intent to support recursive bind mounts Ian Kent
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).