mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
bcachefs: Fix additional misalignment in journal space calculations
Additional fix on top of
f54b2a80d0 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 <neverberlerfellerer@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -169,6 +169,12 @@ static struct journal_space __journal_space_available(struct journal *j, unsigne
|
||||
if (nr_devs < nr_devs_want)
|
||||
return (struct journal_space) { 0, 0 };
|
||||
|
||||
/*
|
||||
* It's possible for bucket size to be misaligned w.r.t. the filesystem
|
||||
* block size:
|
||||
*/
|
||||
min_bucket_size = round_down(min_bucket_size, block_sectors(c));
|
||||
|
||||
/*
|
||||
* We sorted largest to smallest, and we want the smallest out of the
|
||||
* @nr_devs_want largest devices:
|
||||
|
||||
Reference in New Issue
Block a user