Re: [PATCH v2 22/24] ext4: support verifying data from large folios with fs-verity
From: Jan Kara
Date: Mon Nov 10 2025 - 05:00:02 EST
On Fri 07-11-25 22:42:47, libaokun@xxxxxxxxxxxxxxx wrote:
> From: Baokun Li <libaokun1@xxxxxxxxxx>
>
> Eric Biggers already added support for verifying data from large folios
> several years ago in commit 5d0f0e57ed90 ("fsverity: support verifying
> data from large folios").
>
> With ext4 now supporting large block sizes, the fs-verity tests
> `kvm-xfstests -c ext4/64k -g verity -x encrypt` pass without issues.
>
> Therefore, remove the restriction and allow LBS to be enabled together
> with fs-verity.
>
> Cc: Eric Biggers <ebiggers@xxxxxxxxxx>
> Signed-off-by: Baokun Li <libaokun1@xxxxxxxxxx>
Nice!
> @@ -5175,7 +5173,8 @@ void ext4_set_inode_mapping_order(struct inode *inode)
> return;
>
> if (test_opt(inode->i_sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA ||
> - ext4_test_inode_flag(inode, EXT4_INODE_JOURNAL_DATA))
> + ext4_test_inode_flag(inode, EXT4_INODE_JOURNAL_DATA) ||
> + ext4_has_feature_verity(inode->i_sb))
> max_order = EXT4_SB(inode->i_sb)->s_min_folio_order;
> else
> max_order = EXT4_MAX_PAGECACHE_ORDER(inode);
Is there a reason why fsverity needs the folio order to match the block
size? I didn't find any by a quick glance. If yes, please state it in
the changelog. If no, then I'd just use EXT4_MAX_PAGECACHE_ORDER() because
it will give us some performance e.g. for mmapped executables protected by
fsverify...
Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR