From: David Gstir Date: Tue, 6 Dec 2016 22:53:53 +0000 (+0100) Subject: fscrypt: Use correct index in decrypt path. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e550c16c8aab95c7996b0c864d5fcedc2c430a43;p=linux-beck.git 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: 9c4bb8a3a9b4 ("fscrypt: Let fs select encryption index/tweak") Signed-off-by: David Gstir Signed-off-by: Theodore Ts'o --- diff --git a/fs/crypto/crypto.c b/fs/crypto/crypto.c index 4d9d221b1d60..d19a42f3a983 100644 --- a/fs/crypto/crypto.c +++ b/fs/crypto/crypto.c @@ -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);