summaryrefslogtreecommitdiffstats
path: root/fs/ext4/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/file.c')
-rw-r--r--fs/ext4/file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index df44c877892a..4f615cdd22ca 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -303,10 +303,10 @@ static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma)
303 struct inode *inode = file->f_mapping->host; 303 struct inode *inode = file->f_mapping->host;
304 304
305 if (ext4_encrypted_inode(inode)) { 305 if (ext4_encrypted_inode(inode)) {
306 int err = ext4_get_encryption_info(inode); 306 int err = fscrypt_get_encryption_info(inode);
307 if (err) 307 if (err)
308 return 0; 308 return 0;
309 if (ext4_encryption_info(inode) == NULL) 309 if (!fscrypt_has_encryption_key(inode))
310 return -ENOKEY; 310 return -ENOKEY;
311 } 311 }
312 file_accessed(file); 312 file_accessed(file);
@@ -362,16 +362,16 @@ static int ext4_file_open(struct inode * inode, struct file * filp)
362 } 362 }
363 } 363 }
364 if (ext4_encrypted_inode(inode)) { 364 if (ext4_encrypted_inode(inode)) {
365 ret = ext4_get_encryption_info(inode); 365 ret = fscrypt_get_encryption_info(inode);
366 if (ret) 366 if (ret)
367 return -EACCES; 367 return -EACCES;
368 if (ext4_encryption_info(inode) == NULL) 368 if (!fscrypt_has_encryption_key(inode))
369 return -ENOKEY; 369 return -ENOKEY;
370 } 370 }
371 371
372 dir = dget_parent(file_dentry(filp)); 372 dir = dget_parent(file_dentry(filp));
373 if (ext4_encrypted_inode(d_inode(dir)) && 373 if (ext4_encrypted_inode(d_inode(dir)) &&
374 !ext4_is_child_context_consistent_with_parent(d_inode(dir), inode)) { 374 !fscrypt_has_permitted_context(d_inode(dir), inode)) {
375 ext4_warning(inode->i_sb, 375 ext4_warning(inode->i_sb,
376 "Inconsistent encryption contexts: %lu/%lu", 376 "Inconsistent encryption contexts: %lu/%lu",
377 (unsigned long) d_inode(dir)->i_ino, 377 (unsigned long) d_inode(dir)->i_ino,