Merge tag 'for-f2fs-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk...
[sfrench/cifs-2.6.git] / fs / f2fs / namei.c
index 8b5f596ed7387a644dd627502cf4e884c90b9fc6..c31b40e5f9cf6dce167f3c24381df1e31c63acf2 100644 (file)
@@ -324,9 +324,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);