public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [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

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