Skip to content

fscrypt, ext4: prepare for blocksize != PAGE_SIZE

Eric Biggers linux-ext4 linux-f2fs-devel linux-fscrypt linux-mtd 2 versions – Applied

Status from this message: I've applied this series to fscrypt.git for 5.3.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest14 patches 1 replyApplied
  2. v113 patches 10 repliesSuperseded

Changes in v2 from the cover letter

- In "fscrypt: simplify bounce page handling", also remove the definition of FS_CTX_HAS_BOUNCE_BUFFER_FL.

- In "ext4: decrypt only the needed blocks in ext4_block_write_begin()", simplify the code slightly by moving the IS_ENCRYPTED() check.

- Change __fscrypt_decrypt_bio() in a separate patch rather than as part of "fscrypt: support decrypting multiple filesystem blocks per page". The resulting code is the same, so I kept Chandan's Reviewed-by.

- Improve the commit message of
"fscrypt: introduce fscrypt_decrypt_block_inplace()".

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/14fscrypt: simplify bounce page handlingfs/crypto/bio.c fs/crypto/crypto.c fs/crypto/fscrypt_private.h +3 more+84 -1480 replies
2/14fscrypt: remove the "write" part of struct fscrypt_ctxfs/crypto/bio.c fs/crypto/crypto.c include/linux/fscrypt.h+14 -180 replies
3/14fscrypt: rename fscrypt_do_page_crypto() to fscrypt_crypt_block()fs/crypto/bio.c fs/crypto/crypto.c fs/crypto/fscrypt_private.h+20 -210 replies
4/14fscrypt: clean up some BUG_ON()s in block encryption/decryptionfs/crypto/crypto.c+9 -60 replies
5/14fscrypt: introduce fscrypt_encrypt_block_inplace()fs/crypto/crypto.c fs/ubifs/crypto.c include/linux/fscrypt.h+50 -250 replies
6/14fscrypt: support encrypting multiple filesystem blocks per pagefs/crypto/crypto.c fs/ext4/page-io.c fs/f2fs/data.c +1 more+53 -400 replies
7/14fscrypt: handle blocksize < PAGE_SIZE in fscrypt_zeroout_range()fs/crypto/bio.c+6 -90 replies
8/14fscrypt: introduce fscrypt_decrypt_block_inplace()fs/crypto/crypto.c fs/ubifs/crypto.c include/linux/fscrypt.h+42 -70 replies
9/14fscrypt: support decrypting multiple filesystem blocks per pagefs/crypto/bio.c fs/crypto/crypto.c fs/ext4/inode.c +1 more+42 -260 replies
10/14fscrypt: decrypt only the needed blocks in __fscrypt_decrypt_bio()fs/crypto/bio.c+2 -20 replies
11/14ext4: clear BH_Uptodate flag on decryption errorfs/ext4/inode.c+6 -20 replies
12/14ext4: decrypt only the needed blocks in ext4_block_write_begin()fs/ext4/inode.c+18 -110 replies
13/14ext4: decrypt only the needed block in __ext4_block_zero_page_range()fs/ext4/inode.c+1 -20 replies
14/14ext4: encrypt only up to last block in ext4_bio_write_page()fs/ext4/page-io.c+9 -10 replies

Reviews trailers per patch

11 of 14 patches have a Reviewed-by or Acked-by.

PatchChandan Rajendra
1/14R-b
2/14R-b
3/14R-b
4/14R-b
5/14R-b
6/14R-b
7/14R-b
8/14R-b
9/14R-b
10/14R-b
11/14
12/14
13/14
14/14R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/14] fscrypt, ext4: prepare for blocksize != PAGE_SIZE

Hello,

This patchset prepares fs/crypto/, and partially ext4, for the 'blocksize != PAGE_SIZE' case.

This basically contains the encryption changes from Chandan Rajendra's patchset "[V2,00/13] Consolidate FS read I/O callbacks code"
(https://patchwork.kernel.org/project/linux-fscrypt/list/?series=111039)
that don't require introducing the read_callbacks and don't depend on fsverity stuff. But they've been reworked to clean things up a lot.

I'd like to apply this patchset for 5.3 in order to make things forward for ext4 encryption with 'blocksize != PAGE_SIZE'.

AFAICT, after this patchset the only thing stopping ext4 encryption from working with blocksize != PAGE_SIZE is the lack of encryption support in block_read_full_page(), which the read_callbacks will address.

This patchset applies to v5.2-rc1, and it can also be retrieved from git at https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git
branch "fscrypt-subpage-blocks-prep".

Changed since v1 (minor cleanups only):

- In "fscrypt: simplify bounce page handling", also remove the definition of FS_CTX_HAS_BOUNCE_BUFFER_FL.

- In "ext4: decrypt only the needed blocks in ext4_block_write_begin()", simplify the code slightly by moving the IS_ENCRYPTED() check.

- Change __fscrypt_decrypt_bio() in a separate patch rather than as part of "fscrypt: support decrypting multiple filesystem blocks per page". The resulting code is the same, so I kept Chandan's Reviewed-by.

- Improve the commit message of
"fscrypt: introduce fscrypt_decrypt_block_inplace()".

Chandan Rajendra (3):
ext4: clear BH_Uptodate flag on decryption error
ext4: decrypt only the needed blocks in ext4_block_write_begin()
ext4: decrypt only the needed block in __ext4_block_zero_page_range()

Eric Biggers (11):
fscrypt: simplify bounce page handling
fscrypt: remove the "write" part of struct fscrypt_ctx
fscrypt: rename fscrypt_do_page_crypto() to fscrypt_crypt_block()
fscrypt: clean up some BUG_ON()s in block encryption/decryption
fscrypt: introduce fscrypt_encrypt_block_inplace()
fscrypt: support encrypting multiple filesystem blocks per page
fscrypt: handle blocksize < PAGE_SIZE in fscrypt_zeroout_range()
fscrypt: introduce fscrypt_decrypt_block_inplace()
fscrypt: support decrypting multiple filesystem blocks per page
fscrypt: decrypt only the needed blocks in __fscrypt_decrypt_bio()
ext4: encrypt only up to last block in ext4_bio_write_page()

 fs/crypto/bio.c             |  73 +++------
 fs/crypto/crypto.c          | 299 ++++++++++++++++++++----------------
 fs/crypto/fscrypt_private.h |  15 +-
 fs/ext4/inode.c             |  37 +++--
 fs/ext4/page-io.c           |  44 +++---
 fs/f2fs/data.c              |  17 +-
 fs/ubifs/crypto.c           |  19 +--
 include/linux/fscrypt.h     |  96 ++++++++----
 8 files changed, 319 insertions(+), 281 deletions(-)
Signature · 8 lines
2.21.0.1020.gf2820cf01a-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel