* [PATCH] autofs4 - detect invalid direct mount requests
@ 2008-06-20 5:13 Ian Kent
2008-06-20 13:00 ` Jeff Moyer
2008-07-01 21:17 ` Andrew Morton
0 siblings, 2 replies; 10+ messages in thread
From: Ian Kent @ 2008-06-20 5:13 UTC (permalink / raw)
To: Andrew Morton; +Cc: Kernel Mailing List, autofs mailing list, linux-fsdevel
autofs v5 dierct and offset mounts within an autofs filesystem are
triggered by existing autofs triger mounts so the mount point dentry
must be positive. If the mount point dentry is negative then the
trigger doesn't exist so we can return fail immediately.
Signed-off-by: Ian Kent <raven@themaw.net>
---
fs/autofs4/waitq.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index cd21fd4..ae637d9 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -307,6 +307,10 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
if (sbi->catatonic)
return -ENOENT;
+ if (!dentry->d_inode &&
+ (sbi->type & (AUTOFS_TYPE_DIRECT | AUTOFS_TYPE_OFFSET)))
+ return -ENOENT;
+
name = kmalloc(NAME_MAX + 1, GFP_KERNEL);
if (!name)
return -ENOMEM;
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] autofs4 - detect invalid direct mount requests
2008-06-20 5:13 [PATCH] autofs4 - detect invalid direct mount requests Ian Kent
@ 2008-06-20 13:00 ` Jeff Moyer
2008-06-20 13:12 ` Ian Kent
2008-07-02 13:46 ` Ian Kent
2008-07-01 21:17 ` Andrew Morton
1 sibling, 2 replies; 10+ messages in thread
From: Jeff Moyer @ 2008-06-20 13:00 UTC (permalink / raw)
To: Ian Kent
Cc: Andrew Morton, Kernel Mailing List, autofs mailing list,
linux-fsdevel
Ian Kent <raven@themaw.net> writes:
> autofs v5 dierct and offset mounts within an autofs filesystem are
> triggered by existing autofs triger mounts so the mount point dentry
> must be positive. If the mount point dentry is negative then the
> trigger doesn't exist so we can return fail immediately.
What are the conditions that lead us here in that case?
-Jeff
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] autofs4 - detect invalid direct mount requests
2008-06-20 13:00 ` Jeff Moyer
@ 2008-06-20 13:12 ` Ian Kent
2008-07-02 13:46 ` Ian Kent
1 sibling, 0 replies; 10+ messages in thread
From: Ian Kent @ 2008-06-20 13:12 UTC (permalink / raw)
To: Jeff Moyer
Cc: Andrew Morton, Kernel Mailing List, autofs mailing list,
linux-fsdevel
On Fri, 2008-06-20 at 09:00 -0400, Jeff Moyer wrote:
> Ian Kent <raven@themaw.net> writes:
>
> > autofs v5 dierct and offset mounts within an autofs filesystem are
> > triggered by existing autofs triger mounts so the mount point dentry
> > must be positive. If the mount point dentry is negative then the
> > trigger doesn't exist so we can return fail immediately.
>
> What are the conditions that lead us here in that case?
v5 doesn't need to get those dir/otherdir messages that we can't avoid
for v4.
Basically, attempts to access a non-existent directory in multi-mount
tree leads to a negative dentry being sent to the wait queue, but v5
direct and offset mounts must always have an existing (non-negative
dentry) directory upon which to mount. This is only relevant for
multi-mounts that don't have an explicit multi-mount root so that the
lookups occur within the autofs file system.
Sorry, I still can't think of a way to avoid this for v4.
Ian
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] autofs4 - detect invalid direct mount requests
2008-06-20 13:00 ` Jeff Moyer
2008-06-20 13:12 ` Ian Kent
@ 2008-07-02 13:46 ` Ian Kent
1 sibling, 0 replies; 10+ messages in thread
From: Ian Kent @ 2008-07-02 13:46 UTC (permalink / raw)
To: Jeff Moyer
Cc: Andrew Morton, Kernel Mailing List, autofs mailing list,
linux-fsdevel
On Fri, 2008-06-20 at 09:00 -0400, Jeff Moyer wrote:
> Ian Kent <raven@themaw.net> writes:
>
> > autofs v5 dierct and offset mounts within an autofs filesystem are
> > triggered by existing autofs triger mounts so the mount point dentry
> > must be positive. If the mount point dentry is negative then the
> > trigger doesn't exist so we can return fail immediately.
>
> What are the conditions that lead us here in that case?
A multi-mount that has no root mount gets a lookup for an offset that
doesn't exist (ie. the trigger hasn't been mounted). Then ->lookup()
will create a negative dentry and send a mount request to the daemon. It
is a bit of a special case but it helps a little.
Ian
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] autofs4 - detect invalid direct mount requests
2008-06-20 5:13 [PATCH] autofs4 - detect invalid direct mount requests Ian Kent
2008-06-20 13:00 ` Jeff Moyer
@ 2008-07-01 21:17 ` Andrew Morton
2008-07-02 8:59 ` Ian Kent
1 sibling, 1 reply; 10+ messages in thread
From: Andrew Morton @ 2008-07-01 21:17 UTC (permalink / raw)
To: Ian Kent; +Cc: linux-kernel, autofs, linux-fsdevel
On Fri, 20 Jun 2008 13:13:03 +0800
Ian Kent <raven@themaw.net> wrote:
> autofs v5 dierct and offset mounts within an autofs filesystem are
> triggered by existing autofs triger mounts so the mount point dentry
> must be positive. If the mount point dentry is negative then the
> trigger doesn't exist so we can return fail immediately.
>
> Signed-off-by: Ian Kent <raven@themaw.net>
>
> ---
>
> fs/autofs4/waitq.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
>
> diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
> index cd21fd4..ae637d9 100644
> --- a/fs/autofs4/waitq.c
> +++ b/fs/autofs4/waitq.c
> @@ -307,6 +307,10 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
> if (sbi->catatonic)
> return -ENOENT;
>
> + if (!dentry->d_inode &&
> + (sbi->type & (AUTOFS_TYPE_DIRECT | AUTOFS_TYPE_OFFSET)))
> + return -ENOENT;
> +
> name = kmalloc(NAME_MAX + 1, GFP_KERNEL);
> if (!name)
> return -ENOMEM;
A good changelog would allow little old me to determine whether this
patch should be merged into 2.6.25 and/or 2.6.26 and/or 2.6.27. This
wasn't a good changelog :(
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] autofs4 - detect invalid direct mount requests
2008-07-01 21:17 ` Andrew Morton
@ 2008-07-02 8:59 ` Ian Kent
2008-07-02 13:42 ` Jeff Moyer
0 siblings, 1 reply; 10+ messages in thread
From: Ian Kent @ 2008-07-02 8:59 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, autofs, linux-fsdevel
On Tue, 2008-07-01 at 14:17 -0700, Andrew Morton wrote:
> On Fri, 20 Jun 2008 13:13:03 +0800
> Ian Kent <raven@themaw.net> wrote:
>
> > autofs v5 dierct and offset mounts within an autofs filesystem are
> > triggered by existing autofs triger mounts so the mount point dentry
> > must be positive. If the mount point dentry is negative then the
> > trigger doesn't exist so we can return fail immediately.
> >
> > Signed-off-by: Ian Kent <raven@themaw.net>
> >
> > ---
> >
> > fs/autofs4/waitq.c | 4 ++++
> > 1 files changed, 4 insertions(+), 0 deletions(-)
> >
> >
> > diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
> > index cd21fd4..ae637d9 100644
> > --- a/fs/autofs4/waitq.c
> > +++ b/fs/autofs4/waitq.c
> > @@ -307,6 +307,10 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
> > if (sbi->catatonic)
> > return -ENOENT;
> >
> > + if (!dentry->d_inode &&
> > + (sbi->type & (AUTOFS_TYPE_DIRECT | AUTOFS_TYPE_OFFSET)))
> > + return -ENOENT;
> > +
> > name = kmalloc(NAME_MAX + 1, GFP_KERNEL);
> > if (!name)
> > return -ENOMEM;
>
> A good changelog would allow little old me to determine whether this
> patch should be merged into 2.6.25 and/or 2.6.26 and/or 2.6.27. This
> wasn't a good changelog :(
Sorry, I guess I shouldn't have included it along with the other more
serious bug fixes. It gets rid of an annoyance more than anything as the
daemon still has to check for it.
It isn't important or urgent, just useful.
Ian
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] autofs4 - detect invalid direct mount requests
2008-07-02 8:59 ` Ian Kent
@ 2008-07-02 13:42 ` Jeff Moyer
2008-07-02 13:50 ` Ian Kent
0 siblings, 1 reply; 10+ messages in thread
From: Jeff Moyer @ 2008-07-02 13:42 UTC (permalink / raw)
To: Ian Kent; +Cc: Andrew Morton, linux-kernel, autofs, linux-fsdevel
Ian Kent <raven@themaw.net> writes:
> On Tue, 2008-07-01 at 14:17 -0700, Andrew Morton wrote:
>> On Fri, 20 Jun 2008 13:13:03 +0800
>> Ian Kent <raven@themaw.net> wrote:
>>
>> > autofs v5 dierct and offset mounts within an autofs filesystem are
>> > triggered by existing autofs triger mounts so the mount point dentry
>> > must be positive. If the mount point dentry is negative then the
>> > trigger doesn't exist so we can return fail immediately.
>> >
>> > Signed-off-by: Ian Kent <raven@themaw.net>
>> >
>> > ---
>> >
>> > fs/autofs4/waitq.c | 4 ++++
>> > 1 files changed, 4 insertions(+), 0 deletions(-)
>> >
>> >
>> > diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
>> > index cd21fd4..ae637d9 100644
>> > --- a/fs/autofs4/waitq.c
>> > +++ b/fs/autofs4/waitq.c
>> > @@ -307,6 +307,10 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
>> > if (sbi->catatonic)
>> > return -ENOENT;
>> >
>> > + if (!dentry->d_inode &&
>> > + (sbi->type & (AUTOFS_TYPE_DIRECT | AUTOFS_TYPE_OFFSET)))
>> > + return -ENOENT;
>> > +
>> > name = kmalloc(NAME_MAX + 1, GFP_KERNEL);
>> > if (!name)
>> > return -ENOMEM;
>>
>> A good changelog would allow little old me to determine whether this
>> patch should be merged into 2.6.25 and/or 2.6.26 and/or 2.6.27. This
>> wasn't a good changelog :(
>
> Sorry, I guess I shouldn't have included it along with the other more
> serious bug fixes. It gets rid of an annoyance more than anything as the
> daemon still has to check for it.
>
> It isn't important or urgent, just useful.
And I'd still like to see a comment in there! ;)
-jeff
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] autofs4 - detect invalid direct mount requests
2008-07-02 13:42 ` Jeff Moyer
@ 2008-07-02 13:50 ` Ian Kent
2008-07-02 16:54 ` Andrew Morton
0 siblings, 1 reply; 10+ messages in thread
From: Ian Kent @ 2008-07-02 13:50 UTC (permalink / raw)
To: Jeff Moyer; +Cc: Andrew Morton, linux-kernel, autofs, linux-fsdevel
On Wed, 2008-07-02 at 09:42 -0400, Jeff Moyer wrote:
> Ian Kent <raven@themaw.net> writes:
>
> > On Tue, 2008-07-01 at 14:17 -0700, Andrew Morton wrote:
> >> On Fri, 20 Jun 2008 13:13:03 +0800
> >> Ian Kent <raven@themaw.net> wrote:
> >>
> >> > autofs v5 dierct and offset mounts within an autofs filesystem are
> >> > triggered by existing autofs triger mounts so the mount point dentry
> >> > must be positive. If the mount point dentry is negative then the
> >> > trigger doesn't exist so we can return fail immediately.
> >> >
> >> > Signed-off-by: Ian Kent <raven@themaw.net>
> >> >
> >> > ---
> >> >
> >> > fs/autofs4/waitq.c | 4 ++++
> >> > 1 files changed, 4 insertions(+), 0 deletions(-)
> >> >
> >> >
> >> > diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
> >> > index cd21fd4..ae637d9 100644
> >> > --- a/fs/autofs4/waitq.c
> >> > +++ b/fs/autofs4/waitq.c
> >> > @@ -307,6 +307,10 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
> >> > if (sbi->catatonic)
> >> > return -ENOENT;
> >> >
> >> > + if (!dentry->d_inode &&
> >> > + (sbi->type & (AUTOFS_TYPE_DIRECT | AUTOFS_TYPE_OFFSET)))
> >> > + return -ENOENT;
> >> > +
> >> > name = kmalloc(NAME_MAX + 1, GFP_KERNEL);
> >> > if (!name)
> >> > return -ENOMEM;
> >>
> >> A good changelog would allow little old me to determine whether this
> >> patch should be merged into 2.6.25 and/or 2.6.26 and/or 2.6.27. This
> >> wasn't a good changelog :(
> >
> > Sorry, I guess I shouldn't have included it along with the other more
> > serious bug fixes. It gets rid of an annoyance more than anything as the
> > daemon still has to check for it.
> >
> > It isn't important or urgent, just useful.
>
> And I'd still like to see a comment in there! ;)
OK.
Andrew, could you drop that patch and I'll re-submit it with a better
change log entry.
Ian
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] autofs4 - detect invalid direct mount requests
2008-07-02 13:50 ` Ian Kent
@ 2008-07-02 16:54 ` Andrew Morton
2008-07-03 1:57 ` Ian Kent
0 siblings, 1 reply; 10+ messages in thread
From: Andrew Morton @ 2008-07-02 16:54 UTC (permalink / raw)
To: Ian Kent; +Cc: Jeff Moyer, linux-kernel, autofs, linux-fsdevel
On Wed, 02 Jul 2008 21:50:21 +0800 Ian Kent <raven@themaw.net> wrote:
> > > serious bug fixes. It gets rid of an annoyance more than anything as the
> > > daemon still has to check for it.
> > >
> > > It isn't important or urgent, just useful.
> >
> > And I'd still like to see a comment in there! ;)
>
> OK.
>
> Andrew, could you drop that patch and I'll re-submit it with a better
> change log entry.
nope ;)
Today is try-to-get-rc8-mm1-to-work day and that's likely the last
2.6.26-rcX-mmY. We need to get everything we can runtime tested a bit.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] autofs4 - detect invalid direct mount requests
2008-07-02 16:54 ` Andrew Morton
@ 2008-07-03 1:57 ` Ian Kent
0 siblings, 0 replies; 10+ messages in thread
From: Ian Kent @ 2008-07-03 1:57 UTC (permalink / raw)
To: Andrew Morton; +Cc: autofs, linux-fsdevel, linux-kernel
On Wed, 2008-07-02 at 09:54 -0700, Andrew Morton wrote:
> On Wed, 02 Jul 2008 21:50:21 +0800 Ian Kent <raven@themaw.net> wrote:
>
> > > > serious bug fixes. It gets rid of an annoyance more than anything as the
> > > > daemon still has to check for it.
> > > >
> > > > It isn't important or urgent, just useful.
> > >
> > > And I'd still like to see a comment in there! ;)
> >
> > OK.
> >
> > Andrew, could you drop that patch and I'll re-submit it with a better
> > change log entry.
>
> nope ;)
Hahahaha, OK.
>
> Today is try-to-get-rc8-mm1-to-work day and that's likely the last
> 2.6.26-rcX-mmY. We need to get everything we can runtime tested a bit.
Yep, understood.
Ian
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-07-03 1:57 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-20 5:13 [PATCH] autofs4 - detect invalid direct mount requests Ian Kent
2008-06-20 13:00 ` Jeff Moyer
2008-06-20 13:12 ` Ian Kent
2008-07-02 13:46 ` Ian Kent
2008-07-01 21:17 ` Andrew Morton
2008-07-02 8:59 ` Ian Kent
2008-07-02 13:42 ` Jeff Moyer
2008-07-02 13:50 ` Ian Kent
2008-07-02 16:54 ` Andrew Morton
2008-07-03 1:57 ` 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).