* [PATCH] bcachefs: Fix unhandled key type in fiemap_fill_extent
@ 2025-07-17 22:07 Kent Overstreet
0 siblings, 0 replies; only message in thread
From: Kent Overstreet @ 2025-07-17 22:07 UTC (permalink / raw)
To: linux-bcachefs; +Cc: Kent Overstreet, syzbot+397f6fe952a0defb9424
KEY_TYPE_error was unhandled; also add a warning for other unhandled key
types.
Reported-by: syzbot+397f6fe952a0defb9424@syzkaller.appspotmail.com
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
---
fs/bcachefs/fs.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index 2789b30add10..56b7126bc31d 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -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;
}
}
--
2.50.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-07-17 22:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-17 22:07 [PATCH] bcachefs: Fix unhandled key type in fiemap_fill_extent Kent Overstreet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox