diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-01-23 20:08:53 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-03-03 14:07:53 -0500 |
commit | f598f9f1252b33410ffc52f51e117645ac5116c4 (patch) | |
tree | 78191ec2ccdf725c5fa8a8f23828c4761abe84ed /fs/autofs4 | |
parent | b1e4594ba097634e9436cc4c6ba95f70a2d627ff (diff) |
Sanitize autofs_dev_ioctl_ismountpoint()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/autofs4')
-rw-r--r-- | fs/autofs4/dev-ioctl.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c index 00bf8fcb245f..c8a80dffb455 100644 --- a/fs/autofs4/dev-ioctl.c +++ b/fs/autofs4/dev-ioctl.c | |||
@@ -544,10 +544,9 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp, | |||
544 | goto out; | 544 | goto out; |
545 | devid = new_encode_dev(path.mnt->mnt_sb->s_dev); | 545 | devid = new_encode_dev(path.mnt->mnt_sb->s_dev); |
546 | err = 0; | 546 | err = 0; |
547 | if (path.dentry->d_inode && | 547 | if (path.mnt->mnt_root == path.dentry) { |
548 | path.mnt->mnt_root == path.dentry) { | ||
549 | err = 1; | 548 | err = 1; |
550 | magic = path.dentry->d_inode->i_sb->s_magic; | 549 | magic = path.mnt->mnt_sb->s_magic; |
551 | } | 550 | } |
552 | } else { | 551 | } else { |
553 | dev_t dev = sbi->sb->s_dev; | 552 | dev_t dev = sbi->sb->s_dev; |
@@ -560,10 +559,8 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp, | |||
560 | 559 | ||
561 | err = have_submounts(path.dentry); | 560 | err = have_submounts(path.dentry); |
562 | 561 | ||
563 | if (path.mnt->mnt_mountpoint != path.mnt->mnt_root) { | 562 | if (follow_down(&path)) |
564 | if (follow_down(&path)) | 563 | magic = path.mnt->mnt_sb->s_magic; |
565 | magic = path.mnt->mnt_sb->s_magic; | ||
566 | } | ||
567 | } | 564 | } |
568 | 565 | ||
569 | param->ismountpoint.out.devid = devid; | 566 | param->ismountpoint.out.devid = devid; |