public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Ian Kent <raven@themaw.net>
Cc: autofs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/6] autofs4: allow RCU-walk to walk through autofs4.
Date: Tue, 29 Jul 2014 11:51:01 +1000	[thread overview]
Message-ID: <20140729115101.0805ecd8@notabene.brown> (raw)
In-Reply-To: <1405592252.20621.63.camel@perseus.fritz.box>

[-- Attachment #1: Type: text/plain, Size: 2519 bytes --]

On Thu, 17 Jul 2014 18:17:32 +0800 Ian Kent <raven@themaw.net> wrote:

> 
> On Thu, 2014-07-17 at 18:04 +1000, NeilBrown wrote:
> > If there some documentation about the interactions between the automountd and
> > the kernel?
> 
> Not really, only the ioctl interaction described in
> Documentation/filesystems/autofs4-mount-control.txt
> 
> > It looks like:
> >  With V5, every name in the root directory gets something mounted on it,
> >       either another autofs or the target filesystem.
> >  With V4, you don't mount an autofs onto an autofs, but when a name in the
> >       root is automounted, all the names beneath there are created and the
> >       target filesystems are mounted before the top level automount is
> >       acknowledged.
> > 
> > Does that sound at all right (I suspect I haven't explained it very clearly).
> 
> Mostly, but let me try and simplify it (or perhaps confuse you even more
> and bore you as a bonus, ;)) and offer a broader picture.

Thanks for going into all that detail!  Having read that, and read the code
(a few times) and having tried to document it myself I think I really
understand it all now.

I wanted to be sure I understood from the perspective of what the module
actually supports rather than just how the automount daemon uses it, so I put
together a document describing the module.  At 3000 words, I'm not sure
whether to call it "verbose" or "thorough".  I'll post it separately.

I did discover one thing that is important for the RCU-walk work.
If you have a "root-less multimount" then the top-level directory will have
DCACHE_NEED_AUTOMOUNT set even though it is not a mount-trap.
As it contains a sub-directory (or more), d_manage will return -EISDIR so
normal REF-walking will side-step d_automount and it will be treated as a
normal directory.
However in RCU-walk mode, d_manage cannot usefully return -EISDIR so the VFS
will always drop into REF-walk mode, which negates some of the value of my
RCU-walk patches.

I see two ways to fix this:
 1- clear DCACHE_NEED_AUTOMOUNT when creating a subdir or symlink, just like
    we do with protocol-version 4
 2- teach the VFS to accept -EISDIR from d_manage and to ignore
    DCACHE_NEED_AUTOMOUNT in that case.  I have a patch to do this and it is
    fairly straight forward.

I think I prefer 2 (it seems easier to document:-) but thought I'd ask if you
have an opinion before I post it (I haven't even tested it properly yet).

Thanks,
NeilBrown


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2014-07-29  1:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-09 23:41 [PATCH 0/6] autofs4: support RCU-walk NeilBrown
2014-07-09 23:41 ` [PATCH 2/6] autofs4: remove a redundant assignment NeilBrown
2014-07-16  3:27   ` Ian Kent
2014-07-09 23:41 ` [PATCH 5/6] autofs4: avoid taking fs_lock during rcu-walk NeilBrown
2014-07-16  9:52   ` Ian Kent
2014-07-09 23:41 ` [PATCH 6/6] autofs4: don't take spinlock when not needed in autofs4_lookup_expiring NeilBrown
2014-07-16  3:42   ` Ian Kent
2014-07-16  6:10     ` NeilBrown
2014-07-09 23:41 ` [PATCH 4/6] autofs4: factor should_expire() out of autofs4_expire_indirect NeilBrown
2014-07-14  0:53   ` [PATCH 4/6 v2] " NeilBrown
2014-07-15  3:48     ` Ian Kent
2014-07-15  4:05       ` NeilBrown
2014-07-15  7:44         ` Ian Kent
2014-07-16  7:50     ` Ian Kent
2014-07-17  4:34       ` NeilBrown
2014-07-09 23:41 ` [PATCH 1/6] autofs4: remove unused autofs4_ispending() NeilBrown
2014-07-16  3:26   ` Ian Kent
2014-07-09 23:41 ` [PATCH 3/6] autofs4: allow RCU-walk to walk through autofs4 NeilBrown
2014-07-16  4:44   ` Ian Kent
2014-07-16  5:51     ` NeilBrown
2014-07-16  6:56       ` Ian Kent
2014-07-17  5:00         ` Ian Kent
2014-07-17  8:04           ` NeilBrown
2014-07-17 10:17             ` Ian Kent
2014-07-29  1:51               ` NeilBrown [this message]
2014-07-29  6:37                 ` Ian Kent
2014-07-10  7:43 ` [PATCH 0/6] autofs4: support RCU-walk Ian Kent
2014-07-10  7:45   ` Ian Kent
2014-07-10  8:25   ` NeilBrown
2014-07-11  2:49     ` Ian Kent
2014-07-16  3:24 ` Ian Kent
2014-07-16  6:00   ` NeilBrown
2014-07-16  7:21     ` Ian Kent

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=20140729115101.0805ecd8@notabene.brown \
    --to=neilb@suse.de \
    --cc=autofs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raven@themaw.net \
    /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