]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
VFS: Fix the remaining automounter semantics regressions
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 25 Oct 2011 11:59:47 +0000 (13:59 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Nov 2011 17:36:22 +0000 (09:36 -0800)
commit 815d405ceff0d6964683f033e18b9b23a88fba87 upstream.

The concensus seems to be that system calls such as stat() etc should
not trigger an automount.  Neither should the l* versions.

This patch therefore adds a LOOKUP_AUTOMOUNT flag to tag those lookups
that _should_ trigger an automount on the last path element.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
[ Edited to leave out the cases that are already covered by LOOKUP_OPEN,
  LOOKUP_DIRECTORY and LOOKUP_CREATE - all of which also fundamentally
  force automounting for their own reasons   - Linus ]

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/namespace.c
fs/nfs/super.c
fs/quota/quota.c

index 304a55d0aa823523d68f99bf4d9a68ac729769e6..537dd96bea0890a897f8fdd9b6772189e163f39a 100644 (file)
@@ -1758,7 +1758,7 @@ static int do_loopback(struct path *path, char *old_name,
                return err;
        if (!old_name || !*old_name)
                return -EINVAL;
-       err = kern_path(old_name, LOOKUP_FOLLOW, &old_path);
+       err = kern_path(old_name, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &old_path);
        if (err)
                return err;
 
index ce40e5c568ba393ec297fbdbc4d288b750491e5a..858d31be29c8a452fb389ce51319f063a01fbd56 100644 (file)
@@ -2793,7 +2793,7 @@ static struct dentry *nfs_follow_remote_path(struct vfsmount *root_mnt,
                goto out_put_mnt_ns;
 
        ret = vfs_path_lookup(root_mnt->mnt_root, root_mnt,
-                       export_path, LOOKUP_FOLLOW, nd);
+                       export_path, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, nd);
 
        nfs_referral_loop_unprotect();
        put_mnt_ns(ns_private);
index b34bdb25490c8956b4733c29771bea3109ec2fcf..10b6be3ca280963e90e5de2b11f5556e576cea4a 100644 (file)
@@ -355,7 +355,7 @@ SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special,
         * resolution (think about autofs) and thus deadlocks could arise.
         */
        if (cmds == Q_QUOTAON) {
-               ret = user_path_at(AT_FDCWD, addr, LOOKUP_FOLLOW, &path);
+               ret = user_path_at(AT_FDCWD, addr, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &path);
                if (ret)
                        pathp = ERR_PTR(ret);
                else