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 ...


_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to