Commit 035241d3 authored by Michael Halcrow's avatar Michael Halcrow Committed by Linus Torvalds

eCryptfs: initialize persistent lower file on inode create

Initialize persistent lower file on inode create.
Signed-off-by: default avatarMichael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d6a13c17
...@@ -47,15 +47,16 @@ struct kmem_cache *ecryptfs_inode_info_cache; ...@@ -47,15 +47,16 @@ struct kmem_cache *ecryptfs_inode_info_cache;
*/ */
static struct inode *ecryptfs_alloc_inode(struct super_block *sb) static struct inode *ecryptfs_alloc_inode(struct super_block *sb)
{ {
struct ecryptfs_inode_info *ecryptfs_inode; struct ecryptfs_inode_info *inode_info;
struct inode *inode = NULL; struct inode *inode = NULL;
ecryptfs_inode = kmem_cache_alloc(ecryptfs_inode_info_cache, inode_info = kmem_cache_alloc(ecryptfs_inode_info_cache, GFP_KERNEL);
GFP_KERNEL); if (unlikely(!inode_info))
if (unlikely(!ecryptfs_inode))
goto out; goto out;
ecryptfs_init_crypt_stat(&ecryptfs_inode->crypt_stat); ecryptfs_init_crypt_stat(&inode_info->crypt_stat);
inode = &ecryptfs_inode->vfs_inode; mutex_init(&inode_info->lower_file_mutex);
inode_info->lower_file = NULL;
inode = &inode_info->vfs_inode;
out: out:
return inode; return inode;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment