* [PATCH] btrfs-progs: check: recognize verity item keys in original mode
@ 2026-03-24 18:52 Leo Martins
2026-03-24 21:05 ` Qu Wenruo
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Leo Martins @ 2026-03-24 18:52 UTC (permalink / raw)
To: linux-btrfs, kernel-team
Commit 4e88bb6e ("btrfs-progs: enhance detection on unknown inode keys")
added stricter validation for inode keys in the original mode checker,
flagging unknown key types as errors. However, it did not add cases for
BTRFS_VERITY_DESC_ITEM_KEY (36) and BTRFS_VERITY_MERKLE_ITEM_KEY (37),
causing any filesystem with fs-verity enabled files to fail the check
with:
ERROR: unknown key (257 36 0) found in leaf 30621696
Add the missing switch cases so that verity metadata items are
recognized and silently skipped during the check, matching the behavior
of lowmem mode which already handles them.
Signed-off-by: Leo Martins <loemra.dev@gmail.com>
---
check/main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/check/main.c b/check/main.c
index c96969fd..4fdd8867 100644
--- a/check/main.c
+++ b/check/main.c
@@ -1895,6 +1895,9 @@ static int process_one_leaf(struct btrfs_root *root, struct extent_buffer *eb,
case BTRFS_XATTR_ITEM_KEY:
ret = process_xattr_item(eb, i, &key, active_node);
break;
+ case BTRFS_VERITY_DESC_ITEM_KEY:
+ case BTRFS_VERITY_MERKLE_ITEM_KEY:
+ break;
default:
error("unknown key (%llu %u %llu) found in leaf %llu",
key.objectid, key.type, key.offset, eb->start);
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] btrfs-progs: check: recognize verity item keys in original mode
2026-03-24 18:52 [PATCH] btrfs-progs: check: recognize verity item keys in original mode Leo Martins
@ 2026-03-24 21:05 ` Qu Wenruo
2026-03-24 22:49 ` Qu Wenruo
2026-03-24 22:49 ` Qu Wenruo
2 siblings, 0 replies; 5+ messages in thread
From: Qu Wenruo @ 2026-03-24 21:05 UTC (permalink / raw)
To: Leo Martins, linux-btrfs, kernel-team
在 2026/3/25 05:22, Leo Martins 写道:
> Commit 4e88bb6e ("btrfs-progs: enhance detection on unknown inode keys")
> added stricter validation for inode keys in the original mode checker,
> flagging unknown key types as errors. However, it did not add cases for
> BTRFS_VERITY_DESC_ITEM_KEY (36) and BTRFS_VERITY_MERKLE_ITEM_KEY (37),
> causing any filesystem with fs-verity enabled files to fail the check
> with:
>
> ERROR: unknown key (257 36 0) found in leaf 30621696
>
> Add the missing switch cases so that verity metadata items are
> recognized and silently skipped during the check, matching the behavior
> of lowmem mode which already handles them.
>
> Signed-off-by: Leo Martins <loemra.dev@gmail.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
And I'll merge the PR in github.
Thanks for spotting this,
Qu
> ---
> check/main.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/check/main.c b/check/main.c
> index c96969fd..4fdd8867 100644
> --- a/check/main.c
> +++ b/check/main.c
> @@ -1895,6 +1895,9 @@ static int process_one_leaf(struct btrfs_root *root, struct extent_buffer *eb,
> case BTRFS_XATTR_ITEM_KEY:
> ret = process_xattr_item(eb, i, &key, active_node);
> break;
> + case BTRFS_VERITY_DESC_ITEM_KEY:
> + case BTRFS_VERITY_MERKLE_ITEM_KEY:
> + break;
> default:
> error("unknown key (%llu %u %llu) found in leaf %llu",
> key.objectid, key.type, key.offset, eb->start);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] btrfs-progs: check: recognize verity item keys in original mode
2026-03-24 18:52 [PATCH] btrfs-progs: check: recognize verity item keys in original mode Leo Martins
2026-03-24 21:05 ` Qu Wenruo
@ 2026-03-24 22:49 ` Qu Wenruo
2026-03-24 23:05 ` Leo Martins
2026-03-24 22:49 ` Qu Wenruo
2 siblings, 1 reply; 5+ messages in thread
From: Qu Wenruo @ 2026-03-24 22:49 UTC (permalink / raw)
To: Leo Martins, linux-btrfs, kernel-team
在 2026/3/25 05:22, Leo Martins 写道:
> Commit 4e88bb6e ("btrfs-progs: enhance detection on unknown inode keys")
> added stricter validation for inode keys in the original mode checker,
> flagging unknown key types as errors. However, it did not add cases for
> BTRFS_VERITY_DESC_ITEM_KEY (36) and BTRFS_VERITY_MERKLE_ITEM_KEY (37),
> causing any filesystem with fs-verity enabled files to fail the check
> with:
>
> ERROR: unknown key (257 36 0) found in leaf 30621696
>
> Add the missing switch cases so that verity metadata items are
> recognized and silently skipped during the check, matching the behavior
> of lowmem mode which already handles them.
Unfortunately I noticed that, lowmem mode doesn't have such handling either.
As I created a test case with verity items, and CI failed due to false
alerts from CI.
I'll send out a small fix for the lowmem mode, along with the test case.
Thanks,
Qu
>
> Signed-off-by: Leo Martins <loemra.dev@gmail.com>
> ---
> check/main.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/check/main.c b/check/main.c
> index c96969fd..4fdd8867 100644
> --- a/check/main.c
> +++ b/check/main.c
> @@ -1895,6 +1895,9 @@ static int process_one_leaf(struct btrfs_root *root, struct extent_buffer *eb,
> case BTRFS_XATTR_ITEM_KEY:
> ret = process_xattr_item(eb, i, &key, active_node);
> break;
> + case BTRFS_VERITY_DESC_ITEM_KEY:
> + case BTRFS_VERITY_MERKLE_ITEM_KEY:
> + break;
> default:
> error("unknown key (%llu %u %llu) found in leaf %llu",
> key.objectid, key.type, key.offset, eb->start);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] btrfs-progs: check: recognize verity item keys in original mode
2026-03-24 18:52 [PATCH] btrfs-progs: check: recognize verity item keys in original mode Leo Martins
2026-03-24 21:05 ` Qu Wenruo
2026-03-24 22:49 ` Qu Wenruo
@ 2026-03-24 22:49 ` Qu Wenruo
2 siblings, 0 replies; 5+ messages in thread
From: Qu Wenruo @ 2026-03-24 22:49 UTC (permalink / raw)
To: Leo Martins, linux-btrfs, kernel-team
在 2026/3/25 05:22, Leo Martins 写道:
> Commit 4e88bb6e ("btrfs-progs: enhance detection on unknown inode keys")
> added stricter validation for inode keys in the original mode checker,
> flagging unknown key types as errors. However, it did not add cases for
> BTRFS_VERITY_DESC_ITEM_KEY (36) and BTRFS_VERITY_MERKLE_ITEM_KEY (37),
> causing any filesystem with fs-verity enabled files to fail the check
> with:
>
> ERROR: unknown key (257 36 0) found in leaf 30621696
>
> Add the missing switch cases so that verity metadata items are
> recognized and silently skipped during the check, matching the behavior
> of lowmem mode which already handles them.
Unfortunately I noticed that, lowmem mode doesn't have such handling either.
As I created a test case with verity items, and CI failed due to false
alerts from CI.
I'll send out a small fix for the lowmem mode, along with the test case.
Thanks,
Qu
>
> Signed-off-by: Leo Martins <loemra.dev@gmail.com>
> ---
> check/main.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/check/main.c b/check/main.c
> index c96969fd..4fdd8867 100644
> --- a/check/main.c
> +++ b/check/main.c
> @@ -1895,6 +1895,9 @@ static int process_one_leaf(struct btrfs_root *root, struct extent_buffer *eb,
> case BTRFS_XATTR_ITEM_KEY:
> ret = process_xattr_item(eb, i, &key, active_node);
> break;
> + case BTRFS_VERITY_DESC_ITEM_KEY:
> + case BTRFS_VERITY_MERKLE_ITEM_KEY:
> + break;
> default:
> error("unknown key (%llu %u %llu) found in leaf %llu",
> key.objectid, key.type, key.offset, eb->start);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] btrfs-progs: check: recognize verity item keys in original mode
2026-03-24 22:49 ` Qu Wenruo
@ 2026-03-24 23:05 ` Leo Martins
0 siblings, 0 replies; 5+ messages in thread
From: Leo Martins @ 2026-03-24 23:05 UTC (permalink / raw)
To: Qu Wenruo; +Cc: linux-btrfs, kernel-team
On Wed, 25 Mar 2026 09:19:00 +1030 Qu Wenruo <quwenruo.btrfs@gmx.com> wrote:
>
>
> 在 2026/3/25 05:22, Leo Martins 写道:
> > Commit 4e88bb6e ("btrfs-progs: enhance detection on unknown inode keys")
> > added stricter validation for inode keys in the original mode checker,
> > flagging unknown key types as errors. However, it did not add cases for
> > BTRFS_VERITY_DESC_ITEM_KEY (36) and BTRFS_VERITY_MERKLE_ITEM_KEY (37),
> > causing any filesystem with fs-verity enabled files to fail the check
> > with:
> >
> > ERROR: unknown key (257 36 0) found in leaf 30621696
> >
> > Add the missing switch cases so that verity metadata items are
> > recognized and silently skipped during the check, matching the behavior
> > of lowmem mode which already handles them.
>
> Unfortunately I noticed that, lowmem mode doesn't have such handling either.
>
> As I created a test case with verity items, and CI failed due to false
> alerts from CI.
>
> I'll send out a small fix for the lowmem mode, along with the test case.
>
> Thanks,
> Qu
Good catch, not sure how I missed that, thanks!
>
> >
> > Signed-off-by: Leo Martins <loemra.dev@gmail.com>
> > ---
> > check/main.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/check/main.c b/check/main.c
> > index c96969fd..4fdd8867 100644
> > --- a/check/main.c
> > +++ b/check/main.c
> > @@ -1895,6 +1895,9 @@ static int process_one_leaf(struct btrfs_root *root, struct extent_buffer *eb,
> > case BTRFS_XATTR_ITEM_KEY:
> > ret = process_xattr_item(eb, i, &key, active_node);
> > break;
> > + case BTRFS_VERITY_DESC_ITEM_KEY:
> > + case BTRFS_VERITY_MERKLE_ITEM_KEY:
> > + break;
> > default:
> > error("unknown key (%llu %u %llu) found in leaf %llu",
> > key.objectid, key.type, key.offset, eb->start);
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-03-24 23:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24 18:52 [PATCH] btrfs-progs: check: recognize verity item keys in original mode Leo Martins
2026-03-24 21:05 ` Qu Wenruo
2026-03-24 22:49 ` Qu Wenruo
2026-03-24 23:05 ` Leo Martins
2026-03-24 22:49 ` Qu Wenruo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox