mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-22 00:00:03 +03:00
init_layout(): fix rounding
block_size is in bytes, not sectors, so when calling round_up(), we could start rounding up by a way too large size and then overflow outside the area that migrate allocated for us. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
2b7fda5aee
commit
b6afe1bed4
@ -48,7 +48,7 @@ static void init_layout(struct bch_sb_layout *l,
|
||||
/* Create two superblocks in the allowed range: */
|
||||
for (i = 0; i < l->nr_superblocks; i++) {
|
||||
if (sb_pos != BCH_SB_SECTOR)
|
||||
sb_pos = round_up(sb_pos, block_size);
|
||||
sb_pos = round_up(sb_pos, block_size >> 9);
|
||||
|
||||
l->sb_offset[i] = cpu_to_le64(sb_pos);
|
||||
sb_pos += sb_size;
|
||||
|
Loading…
Reference in New Issue
Block a user