From: Eric Biggers <ebiggers@kernel.org>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] statx09: Reduce fs-verity blocksize to 1024
Date: Thu, 13 Jul 2023 20:40:48 -0700 [thread overview]
Message-ID: <20230714034048.GA913@sol.localdomain> (raw)
In-Reply-To: <20230713132901.28660-1-mdoucha@suse.cz>
Hi Martin,
On Thu, Jul 13, 2023 at 03:28:52PM +0200, Martin Doucha wrote:
> The kernel requires that fs-verity blocksize must be at most equal
> to the filesystem blocksize. Testing on small loop device means that
> mkfs.ext4 will very likely default to blocksize of 1024. Set fs-verity
> blocksize to the minimum possible value (1024) to avoid blocksize
> mismatch.
>
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>
> Alternatively, we could add "-b 4096" to .dev_fs_opts.
>
> testcases/kernel/syscalls/statx/statx09.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/statx/statx09.c b/testcases/kernel/syscalls/statx/statx09.c
> index c03d2c91e..dc9786c76 100644
> --- a/testcases/kernel/syscalls/statx/statx09.c
> +++ b/testcases/kernel/syscalls/statx/statx09.c
> @@ -94,7 +94,7 @@ static void flag_setup(void)
> memset(&enable, 0, sizeof(enable));
> enable.version = 1;
> enable.hash_algorithm = hash_algorithms[0];
> - enable.block_size = 4096;
> + enable.block_size = 1024;
> enable.salt_size = 0;
> enable.salt_ptr = (intptr_t)NULL;
> enable.sig_size = 0;
> --
Support for Merkle tree block sizes less than the page size didn't exist until
kernel version 6.3. Please see the documentation for FS_IOC_ENABLE_VERITY
(https://www.kernel.org/doc/html/latest/filesystems/fsverity.html#fs-ioc-enable-verity):
"block_size is the Merkle tree block size, in bytes. In Linux v6.3 and
later, this can be any power of 2 between (inclusively) 1024 and the minimum
of the system page size and the filesystem block size. In earlier versions,
the page size was the only allowed value."
There are a few different approaches you could take. One would be the one you
mentioned: just add "-b 4096". Though, note that systems with non-4K pages and
kernel older than v6.3 can't mount an "-O verity -b 4096" filesystem.
Or you could query the filesystem block size (that resulted from mkfs.ext4 with
unspecified block size) and use that as the Merkle tree block size.
Or you could simply make the test depend on kernel v6.3, I suppose.
- Eric
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-07-14 3:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-13 13:28 [LTP] [PATCH] statx09: Reduce fs-verity blocksize to 1024 Martin Doucha
2023-07-14 3:40 ` Eric Biggers [this message]
2023-07-14 11:47 ` Petr Vorel
2023-07-14 11:49 ` Petr Vorel
2023-07-14 12:32 ` Martin Doucha
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=20230714034048.GA913@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=ltp@lists.linux.it \
--cc=mdoucha@suse.cz \
/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