Merge tag 'arm-soc-omap-genpd-5.11' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / fs / ext4 / namei.c
index 3350926..5fa8436 100644 (file)
@@ -643,13 +643,7 @@ static struct stats dx_show_leaf(struct inode *dir,
 
                                name  = de->name;
                                len = de->name_len;
-                               if (IS_ENCRYPTED(dir))
-                                       res = fscrypt_get_encryption_info(dir);
-                               if (res) {
-                                       printk(KERN_WARNING "Error setting up"
-                                              " fname crypto: %d\n", res);
-                               }
-                               if (!fscrypt_has_encryption_key(dir)) {
+                               if (!IS_ENCRYPTED(dir)) {
                                        /* Directory is not encrypted */
                                        ext4fs_dirhash(dir, de->name,
                                                de->name_len, &h);
@@ -1010,7 +1004,7 @@ static int htree_dirblock_to_tree(struct file *dir_file,
                                           EXT4_DIR_REC_LEN(0));
        /* Check if the directory is encrypted */
        if (IS_ENCRYPTED(dir)) {
-               err = fscrypt_get_encryption_info(dir);
+               err = fscrypt_prepare_readdir(dir);
                if (err < 0) {
                        brelse(bh);
                        return err;
@@ -2195,6 +2189,9 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
        if (!dentry->d_name.len)
                return -EINVAL;
 
+       if (fscrypt_is_nokey_name(dentry))
+               return -ENOKEY;
+
 #ifdef CONFIG_UNICODE
        if (sb_has_strict_encoding(sb) && IS_CASEFOLDED(dir) &&
            sb->s_encoding && utf8_validate(sb->s_encoding, &dentry->d_name))