Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[firefly-linux-kernel-4.4.55.git] / fs / ecryptfs / main.c
index a3efdccbbcc842ca6fb84ef6cc86872af4f830d8..fc4a3a22464182ebb80e130c2d2013e102905776 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 1997-2003 Erez Zadok
  * Copyright (C) 2001-2003 Stony Brook University
- * Copyright (C) 2004-2006 International Business Machines Corp.
+ * Copyright (C) 2004-2007 International Business Machines Corp.
  *   Author(s): Michael A. Halcrow <mahalcro@us.ibm.com>
  *              Michael C. Thompson <mcthomps@us.ibm.com>
  *              Tyler Hicks <tyhicks@ou.edu>
@@ -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_free;
+               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;
@@ -641,11 +635,21 @@ static struct ecryptfs_cache_info {
                .name = "ecryptfs_headers_2",
                .size = PAGE_CACHE_SIZE,
        },
+       {
+               .cache = &ecryptfs_xattr_cache,
+               .name = "ecryptfs_xattr_cache",
+               .size = PAGE_CACHE_SIZE,
+       },
        {
                .cache = &ecryptfs_lower_page_cache,
                .name = "ecryptfs_lower_page_cache",
                .size = PAGE_CACHE_SIZE,
        },
+       {
+               .cache = &ecryptfs_key_record_cache,
+               .name = "ecryptfs_key_record_cache",
+               .size = sizeof(struct ecryptfs_key_record),
+       },
 };
 
 static void ecryptfs_free_kmem_caches(void)