aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2020-01-11 11:27:46 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2020-02-27 14:43:55 -0500
commit25e195aa1e607f129ab912d29fcfc79239703307 (patch)
tree76f7d6755f9f8f163c7556fa29f7bf913fd46b2a /fs/namespace.c
parentfix automount/automount race properly (diff)
downloadwireguard-linux-25e195aa1e607f129ab912d29fcfc79239703307.tar.xz
wireguard-linux-25e195aa1e607f129ab912d29fcfc79239703307.zip
follow_automount(): get rid of dead^Wstillborn code
1) no instances of ->d_automount() have ever made use of the "return ERR_PTR(-EISDIR) if you don't feel like mounting anything" - that's a rudiment of plans that got superseded before the thing went into the tree. Despite the comment in follow_automount(), autofs has never done that. 2) if there's no ->d_automount() in dentry_operations, filesystems should not set DCACHE_NEED_AUTOMOUNT in the first place. None have ever done so... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 777c3116e62e..743980380a8f 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2824,9 +2824,16 @@ static int do_new_mount(struct path *path, const char *fstype, int sb_flags,
int finish_automount(struct vfsmount *m, struct path *path)
{
struct dentry *dentry = path->dentry;
- struct mount *mnt = real_mount(m);
struct mountpoint *mp;
+ struct mount *mnt;
int err;
+
+ if (!m)
+ return 0;
+ if (IS_ERR(m))
+ return PTR_ERR(m);
+
+ mnt = real_mount(m);
/* The new mount record should have at least 2 refs to prevent it being
* expired before we get a chance to add it
*/