Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=82b16528405131eadc18285da982d4806f6db34e
Commit:     82b16528405131eadc18285da982d4806f6db34e
Parent:     a5f5e43e2b1377392f9afe93aca29b9abf1d6a44
Author:     Dmitriy Monakhov <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 5 00:30:46 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Mar 5 07:57:53 2007 -0800

    [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 <[EMAIL PROTECTED]>
    Acked-by: Michael Halcrow <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/ecryptfs/main.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to