diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-10 21:23:27 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-10 22:53:46 +0100 |
commit | a66ff26b0f31189e413a87065c25949c359e4bef (patch) | |
tree | b5dfed7d38deb95921c76b4b9cca11e0eff0d25d /fs/bcachefs/journal_reclaim.c | |
parent | bcachefs: Fix uninitialized var in bch2_journal_replay() (diff) | |
download | linux-a66ff26b0f31189e413a87065c25949c359e4bef.tar.xz linux-a66ff26b0f31189e413a87065c25949c359e4bef.zip |
bcachefs: Close journal entry if necessary when flushing all pins
Since outstanding journal buffers hold a journal pin, when flushing all
pins we need to close the current journal entry if necessary so its pin
can be released.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal_reclaim.c')
-rw-r--r-- | fs/bcachefs/journal_reclaim.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/journal_reclaim.c b/fs/bcachefs/journal_reclaim.c index e63c6eda86af..ec712104addb 100644 --- a/fs/bcachefs/journal_reclaim.c +++ b/fs/bcachefs/journal_reclaim.c @@ -776,6 +776,9 @@ static int journal_flush_done(struct journal *j, u64 seq_to_flush, (1U << JOURNAL_PIN_btree), 0, 0, 0)) *did_work = true; + if (seq_to_flush > journal_cur_seq(j)) + bch2_journal_entry_close(j); + spin_lock(&j->lock); /* * If journal replay hasn't completed, the unreplayed journal entries |