summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ialloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/ialloc.c')
-rw-r--r--fs/ext4/ialloc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 3da4cf8d18b6..35f351895b89 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -767,10 +767,10 @@ struct inode *__ext4_new_inode(handle_t *handle, struct inode *dir,
767 if ((ext4_encrypted_inode(dir) || 767 if ((ext4_encrypted_inode(dir) ||
768 DUMMY_ENCRYPTION_ENABLED(EXT4_SB(dir->i_sb))) && 768 DUMMY_ENCRYPTION_ENABLED(EXT4_SB(dir->i_sb))) &&
769 (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode))) { 769 (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode))) {
770 err = ext4_get_encryption_info(dir); 770 err = fscrypt_get_encryption_info(dir);
771 if (err) 771 if (err)
772 return ERR_PTR(err); 772 return ERR_PTR(err);
773 if (ext4_encryption_info(dir) == NULL) 773 if (!fscrypt_has_encryption_key(dir))
774 return ERR_PTR(-EPERM); 774 return ERR_PTR(-EPERM);
775 if (!handle) 775 if (!handle)
776 nblocks += EXT4_DATA_TRANS_BLOCKS(dir->i_sb); 776 nblocks += EXT4_DATA_TRANS_BLOCKS(dir->i_sb);
@@ -1115,7 +1115,8 @@ got:
1115 } 1115 }
1116 1116
1117 if (encrypt) { 1117 if (encrypt) {
1118 err = ext4_inherit_context(dir, inode); 1118 /* give pointer to avoid set_context with journal ops. */
1119 err = fscrypt_inherit_context(dir, inode, &encrypt, true);
1119 if (err) 1120 if (err)
1120 goto fail_free_drop; 1121 goto fail_free_drop;
1121 } 1122 }