summaryrefslogtreecommitdiffstats
path: root/fs/autofs4/root.c
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2005-06-21 17:16:38 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 19:07:35 -0700
commit9b1e3afd6d56937ced3914971621d0f053ea9178 (patch)
tree059762a20c069273247b423b6075adcd89624e42 /fs/autofs4/root.c
parent8818760512424f60ad9fafb7a087b007a9274eb3 (diff)
downloadlinux-9b1e3afd6d56937ced3914971621d0f053ea9178.tar.gz
linux-9b1e3afd6d56937ced3914971621d0f053ea9178.tar.bz2
linux-9b1e3afd6d56937ced3914971621d0f053ea9178.zip
[PATCH] autofs4: avoid panic on bind mount of autofs owned directory
While this is not a solution to bind and move mounts on autofs owned directories it is necessary to fix the trady error handling. At least it avoids the kernel panic I observed checking out bug #4589. Signed-off-by: Ian Kent <raven@themaw.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/autofs4/root.c')
-rw-r--r--fs/autofs4/root.c6
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)
struct vfsmount *fp_mnt = mntget(mnt);
struct dentry *fp_dentry = dget(dentry);
- while (follow_down(&fp_mnt, &fp_dentry) && d_mountpoint(fp_dentry));
+ if (!autofs4_follow_mount(&fp_mnt, &fp_dentry)) {
+ dput(fp_dentry);
+ mntput(fp_mnt);
+ return -ENOENT;
+ }
fp = dentry_open(fp_dentry, fp_mnt, file->f_flags);
status = PTR_ERR(fp);