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: 9c4bb8a3a9 ("fscrypt: Let fs select encryption index/tweak")

Signed-off-by: David Gstir <david@sigma-star.at>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
David Gstir 2016-12-06 23:53:53 +01:00 committed by Theodore Ts'o
parent 41d5319af3
commit e550c16c8a
1 changed files with 1 additions and 1 deletions

View File

@ -296,7 +296,7 @@ EXPORT_SYMBOL(fscrypt_encrypt_page);
int fscrypt_decrypt_page(const struct inode *inode, struct page *page,
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);
}
EXPORT_SYMBOL(fscrypt_decrypt_page);