fscrypt: decrypt only the needed blocks in __fscrypt_decrypt_bio()
authorEric Biggers <ebiggers@google.com>
Mon, 20 May 2019 16:29:48 +0000 (09:29 -0700)
committerEric Biggers <ebiggers@google.com>
Tue, 28 May 2019 17:27:53 +0000 (10:27 -0700)
commitffceeefb337b3ba9da36633072490caa96289345
tree0849a49406848038682382fabe20684ff0cccdd2
parentaa8bc1ac6ef32a332671ca25e06cfd277a3839a5
fscrypt: decrypt only the needed blocks in __fscrypt_decrypt_bio()

In __fscrypt_decrypt_bio(), only decrypt the blocks that actually
comprise the bio, rather than assuming blocksize == PAGE_SIZE and
decrypting the entirety of every page used in the bio.

This is in preparation for allowing encryption on ext4 filesystems with
blocksize != PAGE_SIZE.

This is based on work by Chandan Rajendra.

Reviewed-by: Chandan Rajendra <chandan@linux.ibm.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/crypto/bio.c