From: Baokun Li <libaokun@linux.alibaba.com>
To: Zorro Lang <zlang@kernel.org>
Cc: fstests@vger.kernel.org, linux-fscrypt@vger.kernel.org,
ebiggers@kernel.org, jaegeuk@kernel.org, tytso@mit.edu,
linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca,
jack@suse.cz, yi.zhang@huawei.com, ojaswin@linux.ibm.com,
ritesh.list@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] common/encrypt: support block sizes larger than the page size
Date: Mon, 23 Nov 2026 11:39:19 +0800 [thread overview]
Message-ID: <a5ad29d3-eb4d-479d-af48-b679fe8b5d23@linux.alibaba.com> (raw)
In-Reply-To: <awHJso_ELIgRjbdg@zlang-mailbox>
Hi Zorro,
Thank you for your review!
On 2026/11/22 01:04, Zorro Lang wrote:
> On Wed, Nov 04, 2026 at 12:09:06AM +0800, Baokun Li wrote:
>> + #
>> + # If the test requires a v2 policy, don't probe with a v1 policy:
>> + # v1 policies are not supported when the block size exceeds the page
>> + # size. _require_encryption_policy_support() will check for the
>> + # requested policy version below.
>> + if [ "$policy_version" -le 1 ]; then
>> + mkdir $SCRATCH_MNT/tmpdir
>> + if _set_encpolicy $SCRATCH_MNT/tmpdir 2>&1 >>$seqres.full | \
>> + grep -Eq 'Inappropriate ioctl for device|Operation not supported'
>> + then
>> + _notrun "kernel does not support $FSTYP encryption"
>> + fi
>> + rmdir $SCRATCH_MNT/tmpdir
>> +
>> + # v1 policies use the block size as their data unit size,
>> + # which doesn't work if the block size exceeds the page size.
>> + _require_v1_encryption_support
>
> How about do _require_v1_encryption_support at first:
>
> if [ "$policy_version" -le 1 ]; then
> _require_v1_encryption_support
> mkdir $SCRATCH_MNT/tmpdir
> if _set_encpolicy $SCRATCH_MNT/tmpdir 2>&1 >>$seqres.full | \
>
> In that case, if block_size > page_size, we can directly skip the test
> with an explicit reason, avoids a redundant mkdir/rmdir and ioctl call.
>
Yes, this can avoid some unnecessary operations.
>> # FS QA Test No. ext4/309
>> #
>> # Verify that file contents encryption works on a filesystem with a block size
>> -# larger than the page size. fscrypt uses the block size as the data unit size
>> -# by default, so this tests data units that span multiple pages, both for the
>> -# writeback path and for the on-disk ciphertext.
>> +# larger than the page size. fscrypt uses min(block size, page size) as the
>> +# default data unit size, so this tests 4K data units on a 32K-block
>
> Does ext4/309 hardcode 32k ?
>
No, that's actually just an example using a block size of 32k; I'll
rephrase that.
Additionally, the final plan has not been fully confirmed yet. I am
still working on the details with Eric. It is expected that all v1 use
cases will be converted to v2 later, and in the testing process, the
data unit size will be explicitly specified. Please refer to:
https://lore.kernel.org/r/20261104195127.GA1971@quark
Cheers,
Baokun
next prev parent reply other threads:[~2026-11-23 3:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 16:09 [PATCH] common/encrypt: support block sizes larger than the page size Baokun Li
2026-11-21 17:04 ` Zorro Lang
2026-11-23 3:39 ` Baokun Li [this message]
2026-11-23 9:41 ` Zorro Lang
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=a5ad29d3-eb4d-479d-af48-b679fe8b5d23@linux.alibaba.com \
--to=libaokun@linux.alibaba.com \
--cc=adilger.kernel@dilger.ca \
--cc=ebiggers@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=jack@suse.cz \
--cc=jaegeuk@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fscrypt@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=tytso@mit.edu \
--cc=yi.zhang@huawei.com \
--cc=zlang@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).