Skip to contentSkip to conversation

bcachefs: Fix unhandled key type in fiemap_fill_extent

PATCH New Kent Overstreet 1 participant 1 message Jul 17, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bcachefs: Fix unhandled key type in fiemap_fill_extent

KEY_TYPE_error was unhandled; also add a warning for other unhandled key types.

---
 fs/bcachefs/fs.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
fs/bcachefs/fs.c +7 -1
index 2789b30add10..56b7126bc31d 100644
@@ -1295,8 +1295,14 @@ static int bch2_fill_extent(struct bch_fs *c,
 					       flags|
 					       FIEMAP_EXTENT_DELALLOC|
 					       FIEMAP_EXTENT_UNWRITTEN);
+	} else if (k.k->type == KEY_TYPE_error) {
+		return 0;
 	} else {
-		BUG();
+		WARN_ONCE(1, "unhandled key type %s",
+			  k.k->type < KEY_TYPE_MAX
+			  ? bch2_bkey_types[k.k->type]
+			  : "(unknown)");
+		return 0;
 	}
 }
 
Signature · 1 line
2.50.0