diff options
Diffstat (limited to 'fs/ecryptfs/inode.c')
-rw-r--r-- | fs/ecryptfs/inode.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 4e685ac1024d..121114e9a464 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/dcache.h> | 29 | #include <linux/dcache.h> |
30 | #include <linux/namei.h> | 30 | #include <linux/namei.h> |
31 | #include <linux/mount.h> | 31 | #include <linux/mount.h> |
32 | #include <linux/crypto.h> | ||
33 | #include <linux/fs_stack.h> | 32 | #include <linux/fs_stack.h> |
34 | #include <linux/slab.h> | 33 | #include <linux/slab.h> |
35 | #include <linux/xattr.h> | 34 | #include <linux/xattr.h> |
@@ -397,11 +396,9 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, | |||
397 | int rc = 0; | 396 | int rc = 0; |
398 | 397 | ||
399 | lower_dir_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry->d_parent); | 398 | lower_dir_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry->d_parent); |
400 | inode_lock(d_inode(lower_dir_dentry)); | 399 | lower_dentry = lookup_one_len_unlocked(ecryptfs_dentry->d_name.name, |
401 | lower_dentry = lookup_one_len(ecryptfs_dentry->d_name.name, | ||
402 | lower_dir_dentry, | 400 | lower_dir_dentry, |
403 | ecryptfs_dentry->d_name.len); | 401 | ecryptfs_dentry->d_name.len); |
404 | inode_unlock(d_inode(lower_dir_dentry)); | ||
405 | if (IS_ERR(lower_dentry)) { | 402 | if (IS_ERR(lower_dentry)) { |
406 | rc = PTR_ERR(lower_dentry); | 403 | rc = PTR_ERR(lower_dentry); |
407 | ecryptfs_printk(KERN_DEBUG, "%s: lookup_one_len() returned " | 404 | ecryptfs_printk(KERN_DEBUG, "%s: lookup_one_len() returned " |
@@ -419,18 +416,16 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, | |||
419 | dput(lower_dentry); | 416 | dput(lower_dentry); |
420 | rc = ecryptfs_encrypt_and_encode_filename( | 417 | rc = ecryptfs_encrypt_and_encode_filename( |
421 | &encrypted_and_encoded_name, &encrypted_and_encoded_name_size, | 418 | &encrypted_and_encoded_name, &encrypted_and_encoded_name_size, |
422 | NULL, mount_crypt_stat, ecryptfs_dentry->d_name.name, | 419 | mount_crypt_stat, ecryptfs_dentry->d_name.name, |
423 | ecryptfs_dentry->d_name.len); | 420 | ecryptfs_dentry->d_name.len); |
424 | if (rc) { | 421 | if (rc) { |
425 | printk(KERN_ERR "%s: Error attempting to encrypt and encode " | 422 | printk(KERN_ERR "%s: Error attempting to encrypt and encode " |
426 | "filename; rc = [%d]\n", __func__, rc); | 423 | "filename; rc = [%d]\n", __func__, rc); |
427 | goto out; | 424 | goto out; |
428 | } | 425 | } |
429 | inode_lock(d_inode(lower_dir_dentry)); | 426 | lower_dentry = lookup_one_len_unlocked(encrypted_and_encoded_name, |
430 | lower_dentry = lookup_one_len(encrypted_and_encoded_name, | ||
431 | lower_dir_dentry, | 427 | lower_dir_dentry, |
432 | encrypted_and_encoded_name_size); | 428 | encrypted_and_encoded_name_size); |
433 | inode_unlock(d_inode(lower_dir_dentry)); | ||
434 | if (IS_ERR(lower_dentry)) { | 429 | if (IS_ERR(lower_dentry)) { |
435 | rc = PTR_ERR(lower_dentry); | 430 | rc = PTR_ERR(lower_dentry); |
436 | ecryptfs_printk(KERN_DEBUG, "%s: lookup_one_len() returned " | 431 | ecryptfs_printk(KERN_DEBUG, "%s: lookup_one_len() returned " |
@@ -502,7 +497,6 @@ static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry, | |||
502 | dir->i_sb)->mount_crypt_stat; | 497 | dir->i_sb)->mount_crypt_stat; |
503 | rc = ecryptfs_encrypt_and_encode_filename(&encoded_symname, | 498 | rc = ecryptfs_encrypt_and_encode_filename(&encoded_symname, |
504 | &encoded_symlen, | 499 | &encoded_symlen, |
505 | NULL, | ||
506 | mount_crypt_stat, symname, | 500 | mount_crypt_stat, symname, |
507 | strlen(symname)); | 501 | strlen(symname)); |
508 | if (rc) | 502 | if (rc) |