bcachefs: Ensure journal space is block size aligned
We don't require that bucket size is block size aligned (although it should be!) - so we need to handle this in the journal code. This fixes an assertion pop in jorunal_entry_close(), where the journal entry overruns available space - after rounding it up to block size. Fixes: https://github.com/koverstreet/bcachefs/issues/854 Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -252,7 +252,10 @@ void bch2_journal_space_available(struct journal *j)
|
||||
|
||||
bch2_journal_set_watermark(j);
|
||||
out:
|
||||
j->cur_entry_sectors = !ret ? j->space[journal_space_discarded].next_entry : 0;
|
||||
j->cur_entry_sectors = !ret
|
||||
? round_down(j->space[journal_space_discarded].next_entry,
|
||||
block_sectors(c))
|
||||
: 0;
|
||||
j->cur_entry_error = ret;
|
||||
|
||||
if (!ret)
|
||||
|
||||
Reference in New Issue
Block a user