From: Ian Kent <raven@themaw.net>
To: Leonardo Chiquitto <leonardo.lists@gmail.com>
Cc: autofs@linux.kernel.org, David Howells <dhowells@redhat.com>
Subject: Re: stat -L triggering mount (behavior change starting with 2.6.38-rc1)
Date: Fri, 01 Apr 2011 12:55:42 +0800 [thread overview]
Message-ID: <1301633742.2880.25.camel@perseus> (raw)
In-Reply-To: <1301632038.2880.11.camel@perseus>
On Fri, 2011-04-01 at 12:27 +0800, Ian Kent wrote:
> On Mon, 2011-03-28 at 19:53 -0300, Leonardo Chiquitto wrote:
>
> There where two significant patch series merged in 2.6.38 which were to
> similar parts of the VFS. One was the vfs-scale series and the other was
> the vfs-automount series. So 2.6.38 had significant autofs changes.
>
> I think the mount storm your seeing would be due to this check not
> catching lstat(2) calls, but AFAICS it should catch this case:
>
Oh, hang on, we have this comment in the VFS code!
/* We want to mount if someone is trying to open/create a file of any
* type under the mountpoint, wants to traverse through the mountpoint
* or wants to open the mounted directory.
*
* We don't want to mount if someone's just doing a stat and they've
* set AT_SYMLINK_NOFOLLOW - unless they're stat'ing a directory and
* appended a '/' to the name.
*/
> if (!(flags & LOOKUP_FOLLOW) &&
> !(flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY |
> LOOKUP_OPEN | LOOKUP_CREATE)))
> return -EISDIR;
>
But "stat -L" says de-reference (a stat(2) call, not an lstat(2) call)
the symlink so AT_SYMLINK_NOFOLLOW is not set and consequently
LOOKUP_FOLLOW will be set. Since automounting modules no longer see the
lookup flags autofs doesn't know about this.
I missed this case, oops!
I'm not even sure what we can do about it either since this code is
shared by other file systems than autofs that don't need to tell lies
when stat()ing a directory to prevent mount storms.
mmm ...
next prev parent reply other threads:[~2011-04-01 4:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-28 22:53 stat -L triggering mount (behavior change starting with 2.6.38-rc1) Leonardo Chiquitto
2011-04-01 4:27 ` Ian Kent
2011-04-01 4:55 ` Ian Kent [this message]
2011-04-01 9:19 ` David Howells
2011-04-01 12:20 ` Leonardo Chiquitto
2011-04-01 14:27 ` David Howells
2011-08-03 14:16 ` Leonardo Chiquitto
2011-04-01 4:38 ` Ian Kent
2011-04-01 12:13 ` Leonardo Chiquitto
2013-03-26 12:56 ` toto
2013-03-26 20:41 ` Leonardo Chiquitto
2013-03-27 0:13 ` Guillaume Apostoly
2013-03-27 4:06 ` Ian Kent
-- strict thread matches above, loose matches on Subject: below --
2011-03-30 16:19 Leonardo Chiquitto
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=1301633742.2880.25.camel@perseus \
--to=raven@themaw.net \
--cc=autofs@linux.kernel.org \
--cc=dhowells@redhat.com \
--cc=leonardo.lists@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.