Skip to content

Commit d789e9a

Browse files
author
Kent Overstreet
committed
bcachefs: Interior known are required to have known key types
For forwards compatibilyt, we allow bkeys of unknown type in leaf nodes; we can simply ignore metadata we don't understand. Pointers to btree nodes must always be of known types, howwever. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent bceb86b commit d789e9a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/bcachefs/bkey_methods.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ int __bch2_bkey_invalid(struct bch_fs *c, struct bkey_s_c k,
171171
if (type >= BKEY_TYPE_NR)
172172
return 0;
173173

174-
bkey_fsck_err_on((flags & BKEY_INVALID_COMMIT) &&
174+
bkey_fsck_err_on((type == BKEY_TYPE_btree ||
175+
(flags & BKEY_INVALID_COMMIT)) &&
175176
!(bch2_key_types_allowed[type] & BIT_ULL(k.k->type)), c, err,
176177
bkey_invalid_type_for_btree,
177178
"invalid key type for btree %s (%s)",

0 commit comments

Comments
 (0)