Commit e550c16c authored by David Gstir's avatar David Gstir Committed by Theodore Ts'o

fscrypt: Use correct index in decrypt path.

Actually use the fs-provided index instead of always using page->index
which is only set for page-cache pages.

Fixes: 9c4bb8a3 ("fscrypt: Let fs select encryption index/tweak")
Signed-off-by: default avatarDavid Gstir <david@sigma-star.at>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 41d5319a
...@@ -296,7 +296,7 @@ EXPORT_SYMBOL(fscrypt_encrypt_page); ...@@ -296,7 +296,7 @@ EXPORT_SYMBOL(fscrypt_encrypt_page);
int fscrypt_decrypt_page(const struct inode *inode, struct page *page, int fscrypt_decrypt_page(const struct inode *inode, struct page *page,
unsigned int len, unsigned int offs, pgoff_t index) unsigned int len, unsigned int offs, pgoff_t index)
{ {
return do_page_crypto(inode, FS_DECRYPT, page->index, page, page, len, offs, return do_page_crypto(inode, FS_DECRYPT, index, page, page, len, offs,
GFP_NOFS); GFP_NOFS);
} }
EXPORT_SYMBOL(fscrypt_decrypt_page); EXPORT_SYMBOL(fscrypt_decrypt_page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment