aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2017-04-07 10:58:39 -0700
committerMoyster <oysterized@gmail.com>2017-05-21 18:43:56 +0200
commit98af4a26b931eb4dbf1aaf3ff0723866b62698eb (patch)
treedaa3ce59a5b15275f6f8516a8c0e620687b2dfe5
parentce598b7834070c25b07e9b3f38f6b05af7985a39 (diff)
f2fs: sync f2fs_lookup() with ext4_lookup()
As for ext4, now that fscrypt_has_permitted_context() correctly handles the case where we have the key for the parent directory but not the child, f2fs_lookup() no longer has to work around it. Also add the same warning message that ext4 uses. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--fs/f2fs/namei.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index a10520ebf..cc41ac99a 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -325,9 +325,10 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
if (f2fs_encrypted_inode(dir) &&
(S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) &&
!fscrypt_has_permitted_context(dir, inode)) {
- bool nokey = f2fs_encrypted_inode(inode) &&
- !fscrypt_has_encryption_key(inode);
- err = nokey ? -ENOKEY : -EPERM;
+ f2fs_msg(inode->i_sb, KERN_WARNING,
+ "Inconsistent encryption contexts: %lu/%lu",
+ dir->i_ino, inode->i_ino);
+ err = -EPERM;
goto err_out;
}
return d_splice_alias(inode, dentry);