diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2020-01-11 11:27:46 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-02-27 14:43:55 -0500 |
commit | 25e195aa1e607f129ab912d29fcfc79239703307 (patch) | |
tree | 76f7d6755f9f8f163c7556fa29f7bf913fd46b2a /fs/namespace.c | |
parent | 26df6034fdb211857e069e7b07d25a368da646df (diff) | |
download | linux-25e195aa1e607f129ab912d29fcfc79239703307.tar.bz2 |
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.c | 9 |
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 */ |