summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDmitriy Monakhov <dmonakhov@sw.ru>2007-03-05 09:30:46 +0100
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-05 16:57:53 +0100
commit82b16528405131eadc18285da982d4806f6db34e (patch)
tree0c59a2cfa72c0833c364a94d16e6017f42154e9f /fs
parent[PATCH] fix "NMI appears to be stuck" (diff)
downloadlinux-82b16528405131eadc18285da982d4806f6db34e.tar.xz
linux-82b16528405131eadc18285da982d4806f6db34e.zip
[PATCH] ecryptfs: lower root result must be adirectory
- Currently after path_lookup succeed we dot't have any guarantie what it is DIR. This must be explicitly demanded. - path_lookup can't return negative dentry, So inode check is useless. Signed-off-by: Dmitriy Monakhov <dmonakhov@openvz.org> Acked-by: Michael Halcrow <mhalcrow@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ecryptfs/main.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 812427e6805c..fc4a3a224641 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -484,18 +484,12 @@ static int ecryptfs_read_super(struct super_block *sb, const char *dev_name)
struct vfsmount *lower_mnt;
memset(&nd, 0, sizeof(struct nameidata));
- rc = path_lookup(dev_name, LOOKUP_FOLLOW, &nd);
+ rc = path_lookup(dev_name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &nd);
if (rc) {
ecryptfs_printk(KERN_WARNING, "path_lookup() failed\n");
goto out;
}
lower_root = nd.dentry;
- if (!lower_root->d_inode) {
- ecryptfs_printk(KERN_WARNING,
- "No directory to interpose on\n");
- rc = -ENOENT;
- goto out_free;
- }
lower_mnt = nd.mnt;
ecryptfs_set_superblock_lower(sb, lower_root->d_sb);
sb->s_maxbytes = lower_root->d_sb->s_maxbytes;