Skip to content

Commit 815d405

Browse files
Trond Myklebusttorvalds
authored andcommitted
VFS: Fix the remaining automounter semantics regressions
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>
1 parent d94c177 commit 815d405

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/namespace.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,7 @@ static int do_loopback(struct path *path, char *old_name,
17571757
return err;
17581758
if (!old_name || !*old_name)
17591759
return -EINVAL;
1760-
err = kern_path(old_name, LOOKUP_FOLLOW, &old_path);
1760+
err = kern_path(old_name, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &old_path);
17611761
if (err)
17621762
return err;
17631763

‎fs/nfs/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2798,7 +2798,7 @@ static struct dentry *nfs_follow_remote_path(struct vfsmount *root_mnt,
27982798
goto out_put_mnt_ns;
27992799

28002800
ret = vfs_path_lookup(root_mnt->mnt_root, root_mnt,
2801-
export_path, LOOKUP_FOLLOW, &path);
2801+
export_path, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &path);
28022802

28032803
nfs_referral_loop_unprotect();
28042804
put_mnt_ns(ns_private);

‎fs/quota/quota.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special,
355355
* resolution (think about autofs) and thus deadlocks could arise.
356356
*/
357357
if (cmds == Q_QUOTAON) {
358-
ret = user_path_at(AT_FDCWD, addr, LOOKUP_FOLLOW, &path);
358+
ret = user_path_at(AT_FDCWD, addr, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &path);
359359
if (ret)
360360
pathp = ERR_PTR(ret);
361361
else

0 commit comments

Comments
 (0)