On Thu, 2010-09-30 at 19:15 +0100, David Howells wrote: > Add an AT_NO_AUTOMOUNT flag to suppress terminal automounting of directories > with follow_link semantics. This can be used by fstatat() users to permit the > gathering of attributes on an automount point and also prevent > mass-automounting of a directory of automount points by ls. > > Signed-off-by: David Howells <dhowells@xxxxxxxxxx> > Acked-by: Ian Kent <raven@xxxxxxxxxx> > --- > > fs/namei.c | 6 ++++++ > fs/stat.c | 4 +++- > include/linux/fcntl.h | 1 + > include/linux/namei.h | 2 ++ > 4 files changed, 12 insertions(+), 1 deletions(-) > > diff --git a/fs/namei.c b/fs/namei.c > index 86421f9..74bce3a 100644 > --- a/fs/namei.c > +++ b/fs/namei.c > @@ -625,6 +625,12 @@ static int follow_automount(struct path *path, unsigned flags, > if (!path->dentry->d_op || !path->dentry->d_op->d_automount) > return -EREMOTE; > > + /* We don't want to mount if someone supplied AT_NO_AUTOMOUNT > + * and this is the terminal part of the path. > + */ > + if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_CONTINUE)) > + return -EXDEV; /* we actually want to stop here */ Oops, we missed this -EXDEV when we made the change to -EISDIR. Ian -- To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html