Skip to content

Commit 74f3931

Browse files
author
Kent Overstreet
committed
bcachefs: Fix additional misalignment in journal space calculations
Additional fix on top of f54b2a8 bcachefs: Fix misaligned bucket check in journal space calculations Make sure that when we calculate space for the next entry it's not misaligned: we need to round_down() to filesystem block size in multiple places (next entry size calculation as well as total space available). Reported-by: Ondřej Kraus <[email protected]> Signed-off-by: Kent Overstreet <[email protected]>
1 parent 7de3c8b commit 74f3931

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/bcachefs/journal_reclaim.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ static struct journal_space __journal_space_available(struct journal *j, unsigne
169169
if (nr_devs < nr_devs_want)
170170
return (struct journal_space) { 0, 0 };
171171

172+
/*
173+
* It's possible for bucket size to be misaligned w.r.t. the filesystem
174+
* block size:
175+
*/
176+
min_bucket_size = round_down(min_bucket_size, block_sectors(c));
177+
172178
/*
173179
* We sorted largest to smallest, and we want the smallest out of the
174180
* @nr_devs_want largest devices:

0 commit comments

Comments
 (0)