diff options
Diffstat (limited to 'fs/ecryptfs/inode.c')
-rw-r--r-- | fs/ecryptfs/inode.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 7192a810bbe6..c746b5d8a336 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -119,10 +119,23 @@ ecryptfs_do_create(struct inode *directory_inode, | |||
119 | } | 119 | } |
120 | rc = ecryptfs_create_underlying_file(lower_dir_dentry->d_inode, | 120 | rc = ecryptfs_create_underlying_file(lower_dir_dentry->d_inode, |
121 | ecryptfs_dentry, mode, nd); | 121 | ecryptfs_dentry, mode, nd); |
122 | if (unlikely(rc)) { | 122 | if (rc) { |
123 | ecryptfs_printk(KERN_ERR, | 123 | struct inode *ecryptfs_inode = ecryptfs_dentry->d_inode; |
124 | "Failure to create underlying file\n"); | 124 | struct ecryptfs_inode_info *inode_info = |
125 | goto out_lock; | 125 | ecryptfs_inode_to_private(ecryptfs_inode); |
126 | |||
127 | printk(KERN_WARNING "%s: Error creating underlying file; " | ||
128 | "rc = [%d]; checking for existing\n", __FUNCTION__, rc); | ||
129 | if (inode_info) { | ||
130 | mutex_lock(&inode_info->lower_file_mutex); | ||
131 | if (!inode_info->lower_file) { | ||
132 | mutex_unlock(&inode_info->lower_file_mutex); | ||
133 | printk(KERN_ERR "%s: Failure to set underlying " | ||
134 | "file; rc = [%d]\n", __FUNCTION__, rc); | ||
135 | goto out_lock; | ||
136 | } | ||
137 | mutex_unlock(&inode_info->lower_file_mutex); | ||
138 | } | ||
126 | } | 139 | } |
127 | rc = ecryptfs_interpose(lower_dentry, ecryptfs_dentry, | 140 | rc = ecryptfs_interpose(lower_dentry, ecryptfs_dentry, |
128 | directory_inode->i_sb, 0); | 141 | directory_inode->i_sb, 0); |
@@ -252,6 +265,8 @@ ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry, | |||
252 | { | 265 | { |
253 | int rc; | 266 | int rc; |
254 | 267 | ||
268 | /* ecryptfs_do_create() calls ecryptfs_interpose(), which opens | ||
269 | * the crypt_stat->lower_file (persistent file) */ | ||
255 | rc = ecryptfs_do_create(directory_inode, ecryptfs_dentry, mode, nd); | 270 | rc = ecryptfs_do_create(directory_inode, ecryptfs_dentry, mode, nd); |
256 | if (unlikely(rc)) { | 271 | if (unlikely(rc)) { |
257 | ecryptfs_printk(KERN_WARNING, "Failed to create file in" | 272 | ecryptfs_printk(KERN_WARNING, "Failed to create file in" |