提交 faac7fd9 编写于 作者: E Eric Biggers 提交者: Theodore Ts'o

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: NEric Biggers <ebiggers@google.com>
Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
上级 8c68084b
...@@ -324,9 +324,10 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, ...@@ -324,9 +324,10 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
if (f2fs_encrypted_inode(dir) && if (f2fs_encrypted_inode(dir) &&
(S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) && (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) &&
!fscrypt_has_permitted_context(dir, inode)) { !fscrypt_has_permitted_context(dir, inode)) {
bool nokey = f2fs_encrypted_inode(inode) && f2fs_msg(inode->i_sb, KERN_WARNING,
!fscrypt_has_encryption_key(inode); "Inconsistent encryption contexts: %lu/%lu",
err = nokey ? -ENOKEY : -EPERM; dir->i_ino, inode->i_ino);
err = -EPERM;
goto err_out; goto err_out;
} }
return d_splice_alias(inode, dentry); return d_splice_alias(inode, dentry);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册