Skip to content

Commit

Permalink
fscrypt: Use correct index in decrypt path.
Browse files Browse the repository at this point in the history
Actually use the fs-provided index instead of always using page->index
which is only set for page-cache pages.

Fixes: 9c4bb8a ("fscrypt: Let fs select encryption index/tweak")

Signed-off-by: David Gstir <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
  • Loading branch information
iokill authored and tytso committed Dec 11, 2016
1 parent 41d5319 commit e550c16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/crypto/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e550c16

Please sign in to comment.