ext4: add inline encryption support
authorEric Biggers <ebiggers@google.com>
Thu, 2 Jul 2020 01:56:07 +0000 (01:56 +0000)
committerEric Biggers <ebiggers@google.com>
Wed, 8 Jul 2020 17:29:43 +0000 (10:29 -0700)
commit4f74d15fe40833d4fb4f5ead7437aa73840596a5
tree355c94ea38587a4033682a744af0ea235eced858
parent27aacd28ea3b891d1cdc7a9c726e2237f7d3701f
ext4: add inline encryption support

Wire up ext4 to support inline encryption via the helper functions which
fs/crypto/ now provides.  This includes:

- Adding a mount option 'inlinecrypt' which enables inline encryption
  on encrypted files where it can be used.

- Setting the bio_crypt_ctx on bios that will be submitted to an
  inline-encrypted file.

  Note: submit_bh_wbc() in fs/buffer.c also needed to be patched for
  this part, since ext4 sometimes uses ll_rw_block() on file data.

- Not adding logically discontiguous data to bios that will be submitted
  to an inline-encrypted file.

- Not doing filesystem-layer crypto on inline-encrypted files.

Co-developed-by: Satya Tangirala <satyat@google.com>
Signed-off-by: Satya Tangirala <satyat@google.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20200702015607.1215430-5-satyat@google.com
Signed-off-by: Eric Biggers <ebiggers@google.com>
Documentation/admin-guide/ext4.rst
fs/buffer.c
fs/ext4/inode.c
fs/ext4/page-io.c
fs/ext4/readpage.c
fs/ext4/super.c