linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: raven@themaw.net
To: Mike Waychison <mike@waychison.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	linux-fsdevel@vger.kernel.org, jamie@shareable.org,
	viro@parcelfarce.linux.theplanet.co.uk
Subject: Re: [RFC][PATCH 1/8] namespace: use global namespace semaphore
Date: Sat, 4 Jun 2005 12:32:39 +0800 (WST)	[thread overview]
Message-ID: <Pine.LNX.4.62.0506041226340.1619@donald.themaw.net> (raw)
In-Reply-To: <42A091EB.7030902@waychison.com>

On Fri, 3 Jun 2005, Mike Waychison wrote:

> Ian Kent wrote:
> > On Wed, 1 Jun 2005, Miklos Szeredi wrote:
> > 
> > 
> > > > >This way the autofs mount won't be followed by the mount program,
> > > > >since looking up '.' does not follow mounts.
> > > >
> > > >But a path walk must be carried out in order to set pwd (or chroot), at
> > > >which time the mount is carried out and remains busy due to the reference
> > > >that is held.
> > >
> > >Huh?  Path walk of '.' will do nothing.  It does not follow mounts or
> > >anything.
> > 
> > 
> > Does "chdir ." make sense. Looks a bit like a noop to me.
> > Surely if your current working directory is "." you've had to set it with a
> > provided path at some point.
> 
> Just to make sure we are all on the same page:

I think we're going to confuse the hell out of Miklos here.

Each talking about fundamentally different automount implementations using 
similar approaches.

Sorry Miklos.

> 
> If you use follow_link logic on a _directory_, it becomes impossible for
> userspace to open(2) that given directory.  However, if the kernel knows all,
> and can do an open(2) on it, and pass that to the userspace autofs handler.

Indeed, analysing the implications of open(2) is where I'm upto at the 
moment. So I'm not quite on the same page here just yet.

> 
> Now, the userspace autofs bits can fchdir(fd) on that fd, and the kernel will
> happily change current's cwd to that magic directory.
> 
> Then, with the cwd set to that magic directory, userspace can do a 'mount
> --move /tmp/temp_mountpoint .', which moves the filesystem mounted at
> /tmp/temp_mountpoint on top of the magic directory.
> 
> Now, the magic directory is covered up, and ->follow_link will never be called
> again because the VFS will directly walk over it during a follow_down loop.
> 
> Care has to be taken to ensure that multiple processes that 
> ->follow_link get put on the same wait_queue waiting for the mount to occur.
> 
> Take a look at fs/autofsng/request.c for an implementation of this.
> 
> > 
> > 
> > > > >So the result is two sibling mounts: the original autofs and the
> > > > >actual filesystem.  But subsequent lookups will see the later mount
> > > > >only, since it's placed earlier on the hash chain, and lookup_mnt()
> > > > >will
> > > > >always return that.
> > > >
> > > >Don't know that I care about that to much.
> > > >It yields correct behaviour except for expires.
> > > >In this case the expire can only determine timeouts relative to busyness
> > > >as walks scoot over the top. Indirect mounts (the other class of autofs
> > > >mounts) update usage on every access (or walk).
> > >
> > >Yes, but with direct mounts you cannot use this to check busyness.
> > 
> > 
> > That's not entirely right but your point is well made.
> > 
> > 
> > >But there's ->mnt_expiry_mark, I think you can use that to check if
> > >mount was recently walked over.
> > 
> > 
> > I'll check that.
> > 
> > I'll probably be reluctant to go that way simply because I want to backport
> > this to 2.4. But maybe that will become secondary as work progresses.
> > 
> > Never the less it may well provide the extra functionality I need.
> > 
> 
> The one problem with mnt_expiry_mark is that it isn't recursive, so if you
> want to expire a tree of mountpoints (like autofs4 currently does), you have
> to feed it steroids:
> 
> http://marc.theaimsgroup.com/?l=linux-fsdevel&m=109875168418269&w=2
> http://marc.theaimsgroup.com/?l=linux-kernel&m=109875147222911&w=2
> http://marc.theaimsgroup.com/?l=linux-fsdevel&m=109871584122188&w=2
> 
> > 
> > >So for direct mounts, the sibling mount (as opposed to the overmount)
> > >has the advantage of not having to do ugly recursion checking hacks in
> > >autofs.
> > 
> > 
> > I've found that all I really need to do is check that the follow_mount is
> > successful and respond accordingly.
> > 
> > Ian
> > 
> 


  reply	other threads:[~2005-06-04  4:43 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-30 13:19 [RFC][PATCH 1/8] namespace: use global namespace semaphore Miklos Szeredi
2005-05-31  2:58 ` Ian Kent
2005-05-31  3:23   ` Mike Waychison
2005-05-31  7:02     ` Ian Kent
2005-05-31  7:56       ` Miklos Szeredi
2005-05-31  9:34         ` Ian Kent
2005-05-31 10:05           ` Miklos Szeredi
2005-05-31 10:13             ` Miklos Szeredi
2005-05-31 15:43               ` Mike Waychison
2005-06-01  5:04               ` Ian Kent
2005-06-01  8:35                 ` Miklos Szeredi
2005-06-03  2:10                   ` Ian Kent
2005-06-03  5:28                     ` Miklos Szeredi
2005-06-04  4:13                       ` raven
2005-06-04  6:32                         ` Miklos Szeredi
2005-06-04  6:50                           ` raven
2005-06-04  7:20                             ` Miklos Szeredi
2005-06-04  7:27                               ` raven
2005-06-03 17:22                     ` Mike Waychison
2005-06-04  4:32                       ` raven [this message]
2005-06-03 17:13               ` Mike Waychison
2005-06-03 18:20                 ` Miklos Szeredi
2005-06-01  4:36             ` Ian Kent
2005-06-03 17:24               ` Mike Waychison
2005-06-04  4:38                 ` raven
2005-05-31 15:55       ` Mike Waychison
2005-05-31 16:08         ` Miklos Szeredi
2005-06-01  4:18           ` Ian Kent
2005-06-01  8:28             ` Miklos Szeredi
2005-06-03  2:23               ` Ian Kent
2005-06-03  5:18                 ` Miklos Szeredi
2005-06-04  4:53                   ` raven
2005-06-04  6:57                     ` Miklos Szeredi
2005-06-04  7:13                       ` raven
2005-06-03 17:26             ` Mike Waychison
2005-06-01  3:57         ` Ian Kent
2005-06-03 17:07           ` Mike Waychison

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.62.0506041226340.1619@donald.themaw.net \
    --to=raven@themaw.net \
    --cc=jamie@shareable.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mike@waychison.com \
    --cc=miklos@szeredi.hu \
    --cc=viro@parcelfarce.linux.theplanet.co.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).