All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ecryptfs: lower root result must be adirectory
@ 2007-02-28  4:06 Dmitriy Monakhov
  0 siblings, 0 replies; only message in thread
From: Dmitriy Monakhov @ 2007-02-28  4:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Michael Halcrow

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

patch against lastest mm tree.

- 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>


[-- Attachment #2: diff-ms-ecryptfs-read_super-fix-b --]
[-- Type: text/plain, Size: 810 bytes --]

diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 812427e..fc4a3a2 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;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-28  4:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-28  4:06 [PATCH] ecryptfs: lower root result must be adirectory Dmitriy Monakhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.