aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4
diff options
context:
space:
mode:
Diffstat (limited to 'fs/autofs4')
-rw-r--r--fs/autofs4/autofs_i.h13
-rw-r--r--fs/autofs4/dev-ioctl.c2
-rw-r--r--fs/autofs4/expire.c2
-rw-r--r--fs/autofs4/root.c11
4 files changed, 7 insertions, 21 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index 0fffe1c24cec..eb67953452bb 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -229,19 +229,6 @@ int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify);
229int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int); 229int autofs4_wait_release(struct autofs_sb_info *,autofs_wqt_t,int);
230void autofs4_catatonic_mode(struct autofs_sb_info *); 230void autofs4_catatonic_mode(struct autofs_sb_info *);
231 231
232static inline int autofs4_follow_mount(struct path *path)
233{
234 int res = 0;
235
236 while (d_mountpoint(path->dentry)) {
237 int followed = follow_down(path);
238 if (!followed)
239 break;
240 res = 1;
241 }
242 return res;
243}
244
245static inline u32 autofs4_get_dev(struct autofs_sb_info *sbi) 232static inline u32 autofs4_get_dev(struct autofs_sb_info *sbi)
246{ 233{
247 return new_encode_dev(sbi->sb->s_dev); 234 return new_encode_dev(sbi->sb->s_dev);
diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c
index eff9a419469a..1442da4860e5 100644
--- a/fs/autofs4/dev-ioctl.c
+++ b/fs/autofs4/dev-ioctl.c
@@ -551,7 +551,7 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,
551 551
552 err = have_submounts(path.dentry); 552 err = have_submounts(path.dentry);
553 553
554 if (follow_down(&path)) 554 if (follow_down_one(&path))
555 magic = path.mnt->mnt_sb->s_magic; 555 magic = path.mnt->mnt_sb->s_magic;
556 } 556 }
557 557
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index cc1d01365905..6a930b90d389 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -56,7 +56,7 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
56 56
57 path_get(&path); 57 path_get(&path);
58 58
59 if (!follow_down(&path)) 59 if (!follow_down_one(&path))
60 goto done; 60 goto done;
61 61
62 if (is_autofs4_dentry(path.dentry)) { 62 if (is_autofs4_dentry(path.dentry)) {
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 651e4ef563b1..20225636a4e9 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -234,7 +234,7 @@ static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
234 nd->flags); 234 nd->flags);
235 /* 235 /*
236 * For an expire of a covered direct or offset mount we need 236 * For an expire of a covered direct or offset mount we need
237 * to break out of follow_down() at the autofs mount trigger 237 * to break out of follow_down_one() at the autofs mount trigger
238 * (d_mounted--), so we can see the expiring flag, and manage 238 * (d_mounted--), so we can see the expiring flag, and manage
239 * the blocking and following here until the expire is completed. 239 * the blocking and following here until the expire is completed.
240 */ 240 */
@@ -243,7 +243,7 @@ static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
243 if (ino->flags & AUTOFS_INF_EXPIRING) { 243 if (ino->flags & AUTOFS_INF_EXPIRING) {
244 spin_unlock(&sbi->fs_lock); 244 spin_unlock(&sbi->fs_lock);
245 /* Follow down to our covering mount. */ 245 /* Follow down to our covering mount. */
246 if (!follow_down(&nd->path)) 246 if (!follow_down_one(&nd->path))
247 goto done; 247 goto done;
248 goto follow; 248 goto follow;
249 } 249 }
@@ -292,11 +292,10 @@ follow:
292 * multi-mount with no root offset so we don't need 292 * multi-mount with no root offset so we don't need
293 * to follow it. 293 * to follow it.
294 */ 294 */
295 if (d_mountpoint(dentry)) { 295 if (d_managed(dentry)) {
296 if (!autofs4_follow_mount(&nd->path)) { 296 status = follow_down(&nd->path, false);
297 status = -ENOENT; 297 if (status < 0)
298 goto out_error; 298 goto out_error;
299 }
300 } 299 }
301 300
302done: 301done: