We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9667214 commit f108dddCopy full SHA for f108ddd
fs/bcachefs/bcachefs_format.h
@@ -1555,6 +1555,12 @@ enum btree_id {
1555
BTREE_ID_NR
1556
};
1557
1558
+/*
1559
+ * Maximum number of btrees that we will _ever_ have under the current scheme,
1560
+ * where we refer to them with bitfields
1561
+ */
1562
+#define BTREE_ID_NR_MAX 64
1563
+
1564
static inline bool btree_id_is_alloc(enum btree_id id)
1565
{
1566
switch (id) {
fs/bcachefs/recovery.c
@@ -35,6 +35,9 @@
35
36
void bch2_btree_lost_data(struct bch_fs *c, enum btree_id btree)
37
38
+ if (btree >= BTREE_ID_NR_MAX)
39
+ return;
40
41
u64 b = BIT_ULL(btree);
42
43
if (!(c->sb.btrees_lost_data & b)) {
0 commit comments