Skip to content

Commit d6b52f6

Browse files
author
Kent Overstreet
committed
bcachefs: Fix null ptr deref in journal_pins_to_text()
Signed-off-by: Kent Overstreet <[email protected]>
1 parent 36da8e3 commit d6b52f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/bcachefs/journal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,11 @@ bool bch2_journal_seq_pins_to_text(struct printbuf *out, struct journal *j, u64
15211521
struct journal_entry_pin *pin;
15221522

15231523
spin_lock(&j->lock);
1524+
if (!test_bit(JOURNAL_running, &j->flags)) {
1525+
spin_unlock(&j->lock);
1526+
return true;
1527+
}
1528+
15241529
*seq = max(*seq, j->pin.front);
15251530

15261531
if (*seq >= j->pin.back) {

0 commit comments

Comments
 (0)