aboutsummaryrefslogtreecommitdiff
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2017-04-07 10:58:38 -0700
committerTheodore Ts'o <tytso@mit.edu>2017-05-04 11:44:33 -0400
commit8c68084bff7a852252cf91985fa8111ae4673f91 (patch)
treeceda8d80e64f8ed57eb6bc08701e2f1c9ec19582 /fs/ext4/namei.c
parent272f98f6846277378e1758a49a49d7bf39343c02 (diff)
downloadlinux-stericsson-8c68084bff7a852252cf91985fa8111ae4673f91.tar.gz
ext4: remove "nokey" check from ext4_lookup()
Now that fscrypt_has_permitted_context() correctly handles the case where we have the key for the parent directory but not the child, we don't need to try to work around this in ext4_lookup(). Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r--fs/ext4/namei.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 07e5e1405771..df3f9d799e2d 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1616,16 +1616,9 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsi
if (!IS_ERR(inode) && ext4_encrypted_inode(dir) &&
(S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) &&
!fscrypt_has_permitted_context(dir, inode)) {
- int nokey = ext4_encrypted_inode(inode) &&
- !fscrypt_has_encryption_key(inode);
- if (nokey) {
- iput(inode);
- return ERR_PTR(-ENOKEY);
- }
ext4_warning(inode->i_sb,
"Inconsistent encryption contexts: %lu/%lu",
- (unsigned long) dir->i_ino,
- (unsigned long) inode->i_ino);
+ dir->i_ino, inode->i_ino);
iput(inode);
return ERR_PTR(-EPERM);
}