]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
Sanitize autofs_dev_ioctl_ismountpoint()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 24 Jan 2010 01:08:53 +0000 (20:08 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 3 Mar 2010 19:07:53 +0000 (14:07 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/autofs4/dev-ioctl.c

index 00bf8fcb245f13cfd7bab5fcd7bc0fdb92952087..c8a80dffb4557d80999b71c66b94cb4a7d2b75fe 100644 (file)
@@ -544,10 +544,9 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,
                        goto out;
                devid = new_encode_dev(path.mnt->mnt_sb->s_dev);
                err = 0;
-               if (path.dentry->d_inode &&
-                   path.mnt->mnt_root == path.dentry) {
+               if (path.mnt->mnt_root == path.dentry) {
                        err = 1;
-                       magic = path.dentry->d_inode->i_sb->s_magic;
+                       magic = path.mnt->mnt_sb->s_magic;
                }
        } else {
                dev_t dev = sbi->sb->s_dev;
@@ -560,10 +559,8 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,
 
                err = have_submounts(path.dentry);
 
-               if (path.mnt->mnt_mountpoint != path.mnt->mnt_root) {
-                       if (follow_down(&path))
-                               magic = path.mnt->mnt_sb->s_magic;
-               }
+               if (follow_down(&path))
+                       magic = path.mnt->mnt_sb->s_magic;
        }
 
        param->ismountpoint.out.devid = devid;