• Eric Biggers's avatar
    fs/buffer.c: support fscrypt in block_read_full_page() · 31fb992c
    Eric Biggers authored
    After each filesystem block (as represented by a buffer_head) has been
    read from disk by block_read_full_page(), decrypt it if needed.  The
    decryption is done on the fscrypt_read_workqueue.
    
    This is the final change needed to support ext4 encryption with
    blocksize != PAGE_SIZE, and it's a fairly small change now that
    CONFIG_FS_ENCRYPTION is a bool and fs/crypto/ exposes functions to
    decrypt individual blocks and to enqueue work on the fscrypt workqueue.
    
    Don't try to add fs-verity support yet, as the fs/verity/ support layer
    isn't ready for sub-page blocks yet.  Just add fscrypt support for now.
    
    Almost all the new code is compiled away when CONFIG_FS_ENCRYPTION=n.
    
    Cc: Chandan Rajendra <chandan@linux.ibm.com>
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    Link: https://lore.kernel.org/r/20191023033312.361355-2-ebiggers@kernel.orgSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    31fb992c
buffer.c 91.1 KB