Linux filesystem development
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Baokun Li <libaokun@linux.alibaba.com>
Cc: linux-ext4@vger.kernel.org, linux-fscrypt@vger.kernel.org,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-xfs@vger.kernel.org, jaegeuk@kernel.org, axboe@kernel.dk,
	hch@lst.de, djwong@kernel.org, brauner@kernel.org, tytso@mit.edu,
	berto@igalia.com, adilger.kernel@dilger.ca, jack@suse.cz,
	yi.zhang@huawei.com, ojaswin@linux.ibm.com,
	ritesh.list@gmail.com
Subject: Re: [PATCH 00/13] block, ext4: allow encryption with a block size larger than the page size
Date: Thu, 15 Oct 2026 18:53:25 +0000	[thread overview]
Message-ID: <20261015185325.GG2170687@google.com> (raw)
In-Reply-To: <20261011170958.1759230-1-libaokun@linux.alibaba.com>

On Mon, Oct 12, 2026 at 01:09:45AM +0800, Baokun Li wrote:
> Motivation
> ==========
> 
> ext4 supports a block size larger than the page size (LBS), e.g. a 32k
> block size on a machine with 4k pages [1].  Encryption, however, is
> still refused on such a filesystem: file contents used to be encrypted
> page by page in the fs-layer path, which cannot handle a folio that
> covers several data units, so the checks that refuse encryption with
> such a block size stayed in place.
> 
> Since commit 5acc6f649a68 ("fscrypt: Always use blk-crypto for
> contents on block-based filesystems") file contents are always
> encrypted through blk-crypto.  Inline encryption hardware can already
> en/decrypt a data unit that spans several pages, but the fallback and
> the block layer cannot carry such a data unit:
> 
>   1. blk-crypto-fallback en/decrypts a data unit with the bio_vecs of
>      a single page-clamped segment, so a larger data unit fails with
>      BLK_STS_INVAL;
>   2. the block layer requires every bio_vec of an encrypted bio to be
>      data unit aligned, and splits such a bio without rounding the
>      split size down to the data unit size;
>   3. iomap cuts the direct I/O bios of an encrypted file only at the
>      logical block size of the device, so a bio can end in the middle
>      of a data unit.
> 
> This series adds the missing pieces on all three layers, removes the
> refusals, and enables large folios for encrypted files on the way.
> 
> [1]: https://lore.kernel.org/all/20251121090654.631996-1-libaokun@huaweicloud.com

A high-level question: most of the complexity in this series is to
support crypto_data_unit_size > PAGE_SIZE, despite the actual goal being
to support fs_block_size > PAGE_SIZE.  It's left unstated that the
default of crypto_data_unit_size == fs_block_size is used.  However,
ext4 and f2fs already support crypto_data_unit_size < fs_block_size.

Would leaving the crypto_data_unit_size at e.g. 4 KiB while increasing
fs_block_size be a simpler way to achieve the goal of this series?

Or do you feel that would be incomplete, and you'd indeed like to
support crypto_data_unit_size = fs_block_size > PAGE_SIZE?

- Eric

      parent reply	other threads:[~2026-10-15 18:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 17:09 [PATCH 00/13] block, ext4: allow encryption with a block size larger than the page size Baokun Li
2026-10-11 17:09 ` [PATCH 01/13] ext4: refuse encryption when block size > " Baokun Li
2026-10-11 17:09 ` [PATCH 02/13] ext4: reject encrypted inodes " Baokun Li
2026-10-11 17:09 ` [PATCH 03/13] blk-crypto: reject fallback data unit sizes it can't handle Baokun Li
     [not found]   ` <sashiko-outbox-167341@kernel.org>
2026-10-12  7:50     ` Baokun Li
2026-10-15 18:45   ` Eric Biggers
2026-10-11 17:09 ` [PATCH 04/13] blk-crypto: decrypt one data unit per crypto request Baokun Li
2026-10-11 17:09 ` [PATCH 05/13] blk-crypto: encrypt " Baokun Li
2026-10-11 17:09 ` [PATCH 06/13] blk-crypto: support data units larger than a page Baokun Li
2026-10-11 17:09 ` [PATCH 07/13] iomap: align the direct I/O bios of encrypted files to the block size Baokun Li
2026-10-11 17:09 ` [PATCH 08/13] block: split encrypted bios at data unit boundaries Baokun Li
2026-10-11 17:09 ` [PATCH 09/13] block: warn about bios that can't be split Baokun Li
2026-10-11 17:09 ` [PATCH 10/13] block: don't require data unit aligned bio_vecs for encrypted bios Baokun Li
     [not found]   ` <sashiko-outbox-167346@kernel.org>
2026-10-12  8:09     ` Baokun Li
2026-10-11 17:09 ` [PATCH 11/13] ext4: allow encryption with a block size larger than the page size Baokun Li
2026-10-11 17:09 ` [PATCH 12/13] ext4: send folios that cover a wraparound to the buffer_head path Baokun Li
2026-10-11 17:09 ` [PATCH 13/13] ext4: allow large folios for encrypted files Baokun Li
2026-10-15 18:53 ` Eric Biggers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261015185325.GG2170687@google.com \
    --to=ebiggers@kernel.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=axboe@kernel.dk \
    --cc=berto@igalia.com \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=jaegeuk@kernel.org \
    --cc=libaokun@linux.alibaba.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    --cc=tytso@mit.edu \
    --cc=yi.zhang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox