[ANDROID] dm-crypt: Skip encryption of file system-encrypted blocks
authorMichael Halcrow <mhalcrow@google.com>
Wed, 11 Oct 2017 23:19:57 +0000 (16:19 -0700)
committerhskang <hs1218.kang@samsung.com>
Fri, 14 Sep 2018 03:02:29 +0000 (12:02 +0900)
commitf423b7e6758039bf6bc9e0d610134116ed6dad5e
tree658648b19ef2e1cdafcfec9f595829743d38812b
parent2bf58b7bc2e56dd4cd7112c29c1f9ca01ba67154
[ANDROID] dm-crypt: Skip encryption of file system-encrypted blocks

File systems can encrypt some of their data blocks with their own
encryption keys, and for those blocks another round of encryption at
the dm-crypt layer may be redundant, depending on the keys being used.

This patch enables dm-crypt to observe the REQ_NOENCRYPT flag as an
indicator that a bio request should bypass the dm-crypt encryption
queue.

By default dm-crypt will ignore this request flag from the file
system.  The user must set the allow_encrypt_override option to enable
this functionality.  Once the dm-crypt has been used with the
allow_encrypt_override option for any given block device, it must
continue to be used with the option to avoid the possibility of data
corruption.

Change-Id: Ie1b4d40f4e4d96f3349ec8970c56230b2de2de1a
Signed-off-by: Michael Halcrow <mhalcrow@google.com>
drivers/md/dm-crypt.c