summaryrefslogtreecommitdiff
path: root/fs/bcachefs/sb-members_format.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-11-08 07:24:22 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2024-11-08 07:31:11 +0300
commit27a036a0c3e7046f508143af96a54f657c3584b8 (patch)
treed9f19a6409ac45a95b692f4c69dfba2940af1422 /fs/bcachefs/sb-members_format.h
parentca43f73cd1720e3b0b9c49deec1a13c89c0ca1e8 (diff)
downloadlinux-27a036a0c3e7046f508143af96a54f657c3584b8.tar.xz
bcachefs: Fix bch_member.btree_bitmap_shift validation
Needs to match the assert later when we resize... Reported-by: syzbot+e8eff054face85d7ea41@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/sb-members_format.h')
-rw-r--r--fs/bcachefs/sb-members_format.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/bcachefs/sb-members_format.h b/fs/bcachefs/sb-members_format.h
index d727d2dfda08..2adf1221a440 100644
--- a/fs/bcachefs/sb-members_format.h
+++ b/fs/bcachefs/sb-members_format.h
@@ -66,6 +66,12 @@ struct bch_member {
};
/*
+ * btree_allocated_bitmap can represent sector addresses of a u64: it itself has
+ * 64 elements, so 64 - ilog2(64)
+ */
+#define BCH_MI_BTREE_BITMAP_SHIFT_MAX 58
+
+/*
* This limit comes from the bucket_gens array - it's a single allocation, and
* kernel allocation are limited to INT_MAX
*/