Re: [PATCH] VFS: Suppress automount on [l]stat, [l]getxattr, etc.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 26, 2011 at 5:59 PM, Trond Myklebust
<Trond.Myklebust@xxxxxxxxxx> wrote:
> diff --git a/fs/namei.c b/fs/namei.c
> index f478836..5b1608f 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -724,25 +724,9 @@ static int follow_automount(struct path *path, unsigned flags,
>        /* We don't want to mount if someone supplied AT_NO_AUTOMOUNT
>         * and this is the terminal part of the path.
>         */
> -       if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_PARENT))
> +       if (!(flags & LOOKUP_AUTOMOUNT) && !(flags & LOOKUP_PARENT))
>                return -EISDIR; /* we actually want to stop here */
>
> -       /* We don't want to mount if someone's just doing a stat -
> -        * unless they're stat'ing a directory and appended a '/' to
> -        * the name.
> -        *
> -        * We do, however, want to mount if someone wants to open or
> -        * create a file of any type under the mountpoint, wants to
> -        * traverse through the mountpoint or wants to open the
> -        * mounted directory.  Also, autofs may mark negative dentries
> -        * as being automount points.  These will need the attentions
> -        * of the daemon to instantiate them before they can be used.
> -        */
> -       if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |
> -                    LOOKUP_OPEN | LOOKUP_CREATE)) &&
> -           path->dentry->d_inode)
> -               return -EISDIR;
> -
>        current->total_link_count++;
>        if (current->total_link_count >= 40)
>                return -ELOOP;

So I think that dropping the d_inode test is wrong, even if we were to
at some point decide that we want explicit LOOKUP_AUTOMOUNT
everywhere.

Of course, it may be that the comment is wrong. But assuming the
comment is correct, then it's really the test above that is
fundamentally wrong.

Ian may know the answer. Ian?

Regardless, I applied the minimal and obviously safe part of the
patch, so hopefully we have no actual regressions left in this area,
and it's just a discussion about possible future cleanups.

                    Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux