linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: Ian Kent <raven@themaw.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	David Howells <dhowells@redhat.com>,
	miklos@szeredi.hu, viro@zeniv.linux.org.uk, gregkh@suse.de,
	linux-nfs@vger.kernel.org, leonardo.lists@gmail.com
Subject: Re: [PATCH] VFS: Suppress automount on [l]stat, [l]getxattr, etc.
Date: Thu, 22 Sep 2011 14:44:53 -0400	[thread overview]
Message-ID: <20110922144453.6cf53a25@barsoom.rdu.redhat.com> (raw)
In-Reply-To: <20110922133529.6d3ea8de@barsoom.rdu.redhat.com>

On Thu, 22 Sep 2011 13:35:29 -0400
Jeff Layton <jlayton@redhat.com> wrote:

> On Fri, 23 Sep 2011 00:45:35 +0800
> Ian Kent <raven@themaw.net> wrote:
> 
> > On Thu, 2011-09-22 at 09:30 -0700, Linus Torvalds wrote:
> > > On Thu, Sep 22, 2011 at 9:04 AM, Ian Kent <raven@themaw.net> wrote:
> > > >
> > > > I haven't checked what the side effects would be but using the
> > > > LOOKUP_DIRECTORY flag in walks that get caught by the removal of the
> > > > LOOKUP_FOLLOW test in follow_automount() and retaining Miklos's original
> > > > patch is probably a more natural solution IMO.
> > > 
> > > Ok, I do have to agree with that.
> > > 
> > > So instead of adding a new flag, let's just document a few *logical*
> > > rules for what causes auto-mounting:
> > > 
> > >  - opening the mount-point itself with LOOKUP_DIRECTORY does so
> > > 
> > >    Logic: when you use LOOKUP_DIRECTORY, you expect to see the
> > > *contents* of the mount-point.
> > > 
> > >  - looking something up *under* the mount-point does so.
> > > 
> > >    This may be obvious, but it actually has a non-obvious special
> > > case: what about the pathname "mountpoint" vs "mountpoint/"
> > > 
> > > And I think the "LOOKUP_DIRECTORY" rule ends up automatically also
> > > resolving that special case: when we have a slash at the end of the
> > > last component, it not only implies that we care about the contents,
> > > it will also automatically set LOOKUP_DIRECTORY.
> > > 
> > > So I'm getting more and more convinced that LOOKUP_DIRECTORY is
> > > actually the right thing to trigger on. It automatically means that
> > > "opendir()" on the mountpoint will do the right thing (because
> > > O_DIRECTORY results in LOOKUP_DIRECTORY), and it automatically - and
> > > very naturally - gives user processes the ability to choose whether
> > > they want to see auto-monting or not ("path" doesn't get auto-mounted,
> > > but "path/" does).
> > > 
> > > Yet at the same time it keeps the "stupid default behavior for
> > > processes that only look at each directory entry and don't even think
> > > about automounting" be the "don't auto-mount when not necessary"
> > > behavior.
> > > 
> > > So: no new flag. Just make nfs4 use LOOKUP_DIRECTORY, and let's add
> > > big documentation notes about this.
> > 
> > Yes, that's what I think is best.
> > 
> > It's late here so I'll survey the code and see if I can find any other
> > instances of this and post a patch, tomorrow.
> > 
> > Jeff, could you test adding LOOKUP_DIRECTORY to the walk in
> > nfs_follow_remote_path() please, just in case I've got this all wrong.
> > 
> 
> Yep, adding LOOKUP_DIRECTORY also fixes the problem. I'll go ahead and
> send a patch to Trond...
> 

To be clear... I tested this with LOOKUP_FOLLOW|LOOKUP_DIRECTORY.

Also, Ian requested that I hold off on pushing a patch to Trond until
he can audit the rest of the code for similar problems.

-- 
Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2011-09-22 18:41 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 13:45 [PATCH] VFS: Suppress automount on [l]stat, [l]getxattr, etc David Howells
2011-09-22 14:33 ` Miklos Szeredi
2011-09-22 16:04 ` Ian Kent
2011-09-22 16:30   ` Linus Torvalds
2011-09-22 16:45     ` Ian Kent
2011-09-22 17:35       ` Jeff Layton
2011-09-22 18:44         ` Jeff Layton [this message]
2011-09-22 19:20           ` Trond Myklebust
2011-09-22 22:57             ` Linus Torvalds
2011-09-23  0:56               ` Myklebust, Trond
2011-09-23  1:04                 ` Linus Torvalds
2011-09-23  1:21                   ` Trond Myklebust
2011-09-23  7:25                     ` Miklos Szeredi
2011-09-23 10:57                       ` Ian Kent
2011-09-23  3:15                   ` Ian Kent
2011-09-23 10:33                   ` David Howells
2011-09-23 14:34                     ` Trond Myklebust
2011-09-23 14:46                       ` Linus Torvalds
2011-09-23 15:01                         ` Trond Myklebust
2011-09-23 15:15                           ` Linus Torvalds
2011-09-23 15:41                         ` Ian Kent
2011-09-23 16:19                           ` Miklos Szeredi
2011-09-23 16:21                           ` Linus Torvalds
2011-09-23 16:26                             ` Linus Torvalds
     [not found]                             ` <13920.1316796007@redhat.com! >
2011-09-23 16:54                               ` David Howells
2011-09-23 17:18                                 ` Linus Torvalds
2011-09-23 16:40                           ` David Howells
2011-09-23 16:47                             ` Linus Torvalds
2011-09-23 15:18                       ` David Howells
2011-09-23 16:10                         ` Miklos Szeredi
2011-09-24  1:30                           ` Ian Kent
2011-09-24  1:44                             ` Linus Torvalds
2011-09-24  2:31                               ` Ian Kent
2011-09-24 11:36                               ` Jeff Layton
2011-09-24 15:56                                 ` Linus Torvalds
2011-09-26  5:11                                   ` Ian Kent
2011-09-26 20:48                                     ` Linus Torvalds
2011-09-26 21:13                                       ` Trond Myklebust
2011-09-26 21:24                                         ` Linus Torvalds
2011-09-26 21:31                                           ` Trond Myklebust
2011-09-26 22:24                                             ` Linus Torvalds
2011-09-26 22:33                                               ` Trond Myklebust
2011-09-26 22:56                                                 ` Linus Torvalds
2011-09-26 23:09                                                   ` Trond Myklebust
2011-09-26 23:26                                                     ` Linus Torvalds
2011-09-27  0:59                                                       ` Trond Myklebust
2011-09-27  1:18                                                         ` Linus Torvalds
2011-09-27  4:24                                                           ` Ian Kent
2011-09-27  3:57                                                         ` Linus Torvalds
2011-09-27  4:16                                                           ` Ian Kent
2011-09-27  4:35                                                             ` Linus Torvalds
2011-09-27  4:51                                                               ` Ian Kent
2011-09-27 14:32                                                                 ` Linus Torvalds
2011-09-27 15:11                                                                   ` Myklebust, Trond
2011-09-29  9:32                                                                   ` Ian Kent
2011-09-27 15:22                                                                 ` Linus Torvalds
2011-09-27 17:38                                                                   ` Greg KH
2011-09-27 17:51                                                                     ` Linus Torvalds
2011-09-27 18:00                                                                       ` Greg KH
2011-09-27 20:18                                                                         ` Miklos Szeredi
2011-09-27 22:38                                                                           ` Greg KH
2011-09-27 13:34                                                       ` [PATCH 1/2] VFS: Fix the remaining automounter semantics regressions Trond Myklebust
2011-09-27 13:34                                                         ` [PATCH 2/2] VFS: Document automounter semantics Trond Myklebust
2011-09-23 15:23                       ` [PATCH] VFS: Suppress automount on [l]stat, [l]getxattr, etc David Howells

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=20110922144453.6cf53a25@barsoom.rdu.redhat.com \
    --to=jlayton@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=gregkh@suse.de \
    --cc=leonardo.lists@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=raven@themaw.net \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).