[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1360a439-8c95-41e4-840c-163685751110@huawei.com>
Date: Mon, 10 Nov 2025 20:08:59 +0800
From: Baokun Li <libaokun1@...wei.com>
To: Jan Kara <jack@...e.cz>, <libaokun@...weicloud.com>
CC: <linux-ext4@...r.kernel.org>, <tytso@....edu>, <adilger.kernel@...ger.ca>,
<linux-kernel@...r.kernel.org>, <kernel@...kajraghav.com>,
<mcgrof@...nel.org>, <ebiggers@...nel.org>, <willy@...radead.org>,
<yi.zhang@...wei.com>, <yangerkun@...wei.com>, <chengzhihao1@...wei.com>
Subject: Re: [PATCH v2 22/24] ext4: support verifying data from large folios
with fs-verity
On 2025-11-10 17:54, Jan Kara wrote:
> On Fri 07-11-25 22:42:47, libaokun@...weicloud.com wrote:
>> From: Baokun Li <libaokun1@...wei.com>
>>
>> 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@...nel.org>
>> Signed-off-by: Baokun Li <libaokun1@...wei.com>
> 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
>
There is no real limitation that prevents verity from using
EXT4_MAX_PAGECACHE_ORDER(). The reason I did not enable it by default
is that none of the filesystems supporting fs-verity had large folios
support at the time, and thus fs-verity with large folios has not yet
been tested in practice. For this reason, I only enabled it when LBS
is turned on.
As you pointed out, turning it on gives some performance gains. And
it also lets fs-verity get more testing. I’ll switch to
EXT4_MAX_PAGECACHE_ORDER(inode) in the next version.
Thank you for your review!
Cheers,
Baokun
Powered by blists - more mailing lists