diff options
Diffstat (limited to 'fs/ecryptfs/inode.c')
-rw-r--r-- | fs/ecryptfs/inode.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 337352a94751..bd33f87a1907 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -185,15 +185,13 @@ static int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry) | |||
185 | "context; rc = [%d]\n", rc); | 185 | "context; rc = [%d]\n", rc); |
186 | goto out; | 186 | goto out; |
187 | } | 187 | } |
188 | if (!ecryptfs_inode_to_private(ecryptfs_dentry->d_inode)->lower_file) { | 188 | rc = ecryptfs_init_persistent_file(ecryptfs_dentry); |
189 | rc = ecryptfs_init_persistent_file(ecryptfs_dentry); | 189 | if (rc) { |
190 | if (rc) { | 190 | printk(KERN_ERR "%s: Error attempting to initialize " |
191 | printk(KERN_ERR "%s: Error attempting to initialize " | 191 | "the persistent file for the dentry with name " |
192 | "the persistent file for the dentry with name " | 192 | "[%s]; rc = [%d]\n", __func__, |
193 | "[%s]; rc = [%d]\n", __func__, | 193 | ecryptfs_dentry->d_name.name, rc); |
194 | ecryptfs_dentry->d_name.name, rc); | 194 | goto out; |
195 | goto out; | ||
196 | } | ||
197 | } | 195 | } |
198 | rc = ecryptfs_write_metadata(ecryptfs_dentry); | 196 | rc = ecryptfs_write_metadata(ecryptfs_dentry); |
199 | if (rc) { | 197 | if (rc) { |
@@ -302,15 +300,13 @@ int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, | |||
302 | rc = -ENOMEM; | 300 | rc = -ENOMEM; |
303 | goto out; | 301 | goto out; |
304 | } | 302 | } |
305 | if (!ecryptfs_inode_to_private(ecryptfs_dentry->d_inode)->lower_file) { | 303 | rc = ecryptfs_init_persistent_file(ecryptfs_dentry); |
306 | rc = ecryptfs_init_persistent_file(ecryptfs_dentry); | 304 | if (rc) { |
307 | if (rc) { | 305 | printk(KERN_ERR "%s: Error attempting to initialize " |
308 | printk(KERN_ERR "%s: Error attempting to initialize " | 306 | "the persistent file for the dentry with name " |
309 | "the persistent file for the dentry with name " | 307 | "[%s]; rc = [%d]\n", __func__, |
310 | "[%s]; rc = [%d]\n", __func__, | 308 | ecryptfs_dentry->d_name.name, rc); |
311 | ecryptfs_dentry->d_name.name, rc); | 309 | goto out_free_kmem; |
312 | goto out_free_kmem; | ||
313 | } | ||
314 | } | 310 | } |
315 | crypt_stat = &ecryptfs_inode_to_private( | 311 | crypt_stat = &ecryptfs_inode_to_private( |
316 | ecryptfs_dentry->d_inode)->crypt_stat; | 312 | ecryptfs_dentry->d_inode)->crypt_stat; |
@@ -441,7 +437,6 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, | |||
441 | struct qstr lower_name; | 437 | struct qstr lower_name; |
442 | int rc = 0; | 438 | int rc = 0; |
443 | 439 | ||
444 | d_set_d_op(ecryptfs_dentry, &ecryptfs_dops); | ||
445 | if ((ecryptfs_dentry->d_name.len == 1 | 440 | if ((ecryptfs_dentry->d_name.len == 1 |
446 | && !strcmp(ecryptfs_dentry->d_name.name, ".")) | 441 | && !strcmp(ecryptfs_dentry->d_name.name, ".")) |
447 | || (ecryptfs_dentry->d_name.len == 2 | 442 | || (ecryptfs_dentry->d_name.len == 2 |