diff options
Diffstat (limited to 'fs/autofs4/root.c')
-rw-r--r-- | fs/autofs4/root.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 3765c047f157..e137acf0543d 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -205,7 +205,11 @@ static int autofs4_dir_open(struct inode *inode, struct file *file) | |||
205 | struct vfsmount *fp_mnt = mntget(mnt); | 205 | struct vfsmount *fp_mnt = mntget(mnt); |
206 | struct dentry *fp_dentry = dget(dentry); | 206 | struct dentry *fp_dentry = dget(dentry); |
207 | 207 | ||
208 | while (follow_down(&fp_mnt, &fp_dentry) && d_mountpoint(fp_dentry)); | 208 | if (!autofs4_follow_mount(&fp_mnt, &fp_dentry)) { |
209 | dput(fp_dentry); | ||
210 | mntput(fp_mnt); | ||
211 | return -ENOENT; | ||
212 | } | ||
209 | 213 | ||
210 | fp = dentry_open(fp_dentry, fp_mnt, file->f_flags); | 214 | fp = dentry_open(fp_dentry, fp_mnt, file->f_flags); |
211 | status = PTR_ERR(fp); | 215 | status = PTR_ERR(fp); |