Re: [PATCH 1/2] fs/buffer.c: support fscrypt in block_read_full_page()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 16, 2019 at 03:11:41PM -0700, Eric Biggers wrote:
> +static void end_buffer_async_read_io(struct buffer_head *bh, int uptodate)
> +{
> +	/* Decrypt if needed */
> +	if (uptodate && IS_ENABLED(CONFIG_FS_ENCRYPTION) &&
> +	    IS_ENCRYPTED(bh->b_page->mapping->host)) {
> +		struct decrypt_bh_ctx *ctx = kmalloc(sizeof(*ctx), GFP_ATOMIC);

Technically this should check S_ISREG() too (though it happens not to make a
difference currently).   I'll fix it in the next version of this patchset.

We probably should add a helper function fscrypt_needs_contents_encryption()
that returns IS_ENABLED(CONFIG_FS_ENCRYPTION) && IS_ENCRYPTED() && S_ISREG().

- Eric



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux