Skip to content

Commit 2e92d26

Browse files
author
Kent Overstreet
committed
bcachefs: Fix lost wakeup on journal shutdown
We need to check for journal shutdown first in __journal_res_get() - after the journal is shutdown, j->watermark won't be changing anymore. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent c502b5b commit 2e92d26

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fs/bcachefs/journal.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -511,18 +511,18 @@ static int __journal_res_get(struct journal *j, struct journal_res *res,
511511
if (journal_res_get_fast(j, res, flags))
512512
return 0;
513513

514+
if (bch2_journal_error(j))
515+
return -BCH_ERR_erofs_journal_err;
516+
517+
if (j->blocked)
518+
return -BCH_ERR_journal_res_get_blocked;
519+
514520
if ((flags & BCH_WATERMARK_MASK) < j->watermark) {
515521
ret = JOURNAL_ERR_journal_full;
516522
can_discard = j->can_discard;
517523
goto out;
518524
}
519525

520-
if (j->blocked)
521-
return -BCH_ERR_journal_res_get_blocked;
522-
523-
if (bch2_journal_error(j))
524-
return -BCH_ERR_erofs_journal_err;
525-
526526
if (nr_unwritten_journal_entries(j) == ARRAY_SIZE(j->buf) && !journal_entry_is_open(j)) {
527527
ret = JOURNAL_ERR_max_in_flight;
528528
goto out;

0 commit comments

Comments
 (0)