Skip to content

Commit 1831840

Browse files
author
Kent Overstreet
committed
bcachefs: Fix write buffer flushing from open journal entry
When flushing the btree write buffer, we pull write buffer keys directly from the journal instead of letting the journal write path copy them to the write buffer. When flushing from the currently open journal buffer, we have to block new reservations and wait for outstanding reservations to complete. Recheck the reservation state after blocking new reservations: previously, we were checking the reservation count from before calling __journal_block(). Signed-off-by: Kent Overstreet <[email protected]>
1 parent eef9170 commit 1831840

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/bcachefs/journal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,7 @@ static struct journal_buf *__bch2_next_write_buffer_flush_journal_buf(struct jou
10821082

10831083
if (open && !*blocked) {
10841084
__bch2_journal_block(j);
1085+
s.v = atomic64_read_acquire(&j->reservations.counter);
10851086
*blocked = true;
10861087
}
10871088

0 commit comments

Comments
 (0)