summaryrefslogtreecommitdiff
path: root/libbcachefs/super-io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-06-17 11:31:26 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-06-17 12:38:43 -0400
commitfc06a0ea5e552663e9e47de941fbc7e621d4ca46 (patch)
tree7760020d71afe32d3317049ad6f1b493dabe245c /libbcachefs/super-io.c
parentab83e348fb77f91b3a9c09ab87c9c357bdafb1d7 (diff)
Update bcachefs sources to c56e1ec97dfd bcachefs: Fix bch2_sb_downgrade_update()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/super-io.c')
-rw-r--r--libbcachefs/super-io.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libbcachefs/super-io.c b/libbcachefs/super-io.c
index 055478d2..b156fc85 100644
--- a/libbcachefs/super-io.c
+++ b/libbcachefs/super-io.c
@@ -649,9 +649,10 @@ reread:
bytes = vstruct_bytes(sb->sb);
- if (bytes > 512ULL << min(BCH_SB_LAYOUT_SIZE_BITS_MAX, sb->sb->layout.sb_max_size_bits)) {
- prt_printf(err, "Invalid superblock: too big (got %zu bytes, layout max %lu)",
- bytes, 512UL << sb->sb->layout.sb_max_size_bits);
+ u64 sb_size = 512ULL << min(BCH_SB_LAYOUT_SIZE_BITS_MAX, sb->sb->layout.sb_max_size_bits);
+ if (bytes > sb_size) {
+ prt_printf(err, "Invalid superblock: too big (got %zu bytes, layout max %llu)",
+ bytes, sb_size);
return -BCH_ERR_invalid_sb_too_big;
}