Linux EXT4 FS development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Baokun Li" <libaokun@linux.alibaba.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH 1/4] fscrypt: Cap data units at the page size
Date: Tue, 03 Nov 2026 15:44:31 +0000	[thread overview]
Message-ID: <sashiko-outbox-195645@kernel.org> (raw)
In-Reply-To: <20261103153132.4154855-2-libaokun@linux.alibaba.com>

> blk-crypto-fallback cannot handle a data unit larger than a page:
> it walks the bio one page-sized segment at a time, so a data unit
> that spans multiple pages never ends on a segment boundary and
> the bio fails with BLK_STS_INVAL after the I/O was already
> reported to userspace as successful, losing data.
> 
> Fix this in fscrypt_supported_v2_policy() by rejecting any v2 policy
> that explicitly specifies a data unit size larger than the page size.
> 
> A v1 policy always uses the block size as its data unit size,
> so fscrypt_supported_v1_policy() has to reject any v1 policy on
> a filesystem with a block size larger than the page size (e.g. ext4).
> 
> A v2 policy with no data unit size specified uses the block size too,
> but rejection is not necessary there: sub-block data units are
> supported, so it is enough to cap the data unit bits at PAGE_SHIFT in
> fscrypt_policy_v2_du_bits().
> 
> Note that a filesystem whose block size exceeds 4K then cannot be
> made compatible across page sizes (e.g. 4K and 64K); this can be
> avoided by explicitly specifying a data unit size of 4K or smaller.
> 
> Suggested-by: Eric Biggers <ebiggers@kernel.org>
> Link: https://lore.kernel.org/r/20261015185325.GG2170687@google.com
> Signed-off-by: Baokun Li <libaokun@linux.alibaba.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261103153132.4154855-1-libaokun@linux.alibaba.com?part=1


  reply	other threads:[~2026-11-03 15:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 15:31 [PATCH 0/4] ext4: support encryption with block size larger than page size Baokun Li
2026-11-03 15:31 ` [PATCH 1/4] fscrypt: Cap data units at the " Baokun Li
2026-11-03 15:44   ` sashiko-bot [this message]
2026-11-03 15:31 ` [PATCH 2/4] fscrypt: Validate the test_dummy_encryption policy for new inodes Baokun Li
2026-11-03 15:45   ` sashiko-bot
2026-11-03 15:31 ` [PATCH 3/4] ext4: don't put a DUN wraparound in the middle of a read bio Baokun Li
2026-11-03 15:40   ` sashiko-bot
2026-11-03 15:31 ` [PATCH 4/4] ext4: allow large folios and bs > ps encryption Baokun Li
2026-11-03 15:42   ` sashiko-bot

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=sashiko-outbox-195645@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=libaokun@linux.alibaba.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tytso@mit.edu \
    /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