diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-06-23 18:07:07 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-06-23 18:07:07 +0200 |
commit | d6b52f6828e6d9bb1fe35f889e1a9d0dcff0e21d (patch) | |
tree | bc613089e7e278ef517718237faf07f86fd1b66c /fs/bcachefs/journal.c | |
parent | bcachefs: Add missing recalc_capacity() call (diff) | |
download | linux-d6b52f6828e6d9bb1fe35f889e1a9d0dcff0e21d.tar.xz linux-d6b52f6828e6d9bb1fe35f889e1a9d0dcff0e21d.zip |
bcachefs: Fix null ptr deref in journal_pins_to_text()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal.c')
-rw-r--r-- | fs/bcachefs/journal.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c index dac2f498ae8b..13669dd0e375 100644 --- a/fs/bcachefs/journal.c +++ b/fs/bcachefs/journal.c @@ -1521,6 +1521,11 @@ bool bch2_journal_seq_pins_to_text(struct printbuf *out, struct journal *j, u64 struct journal_entry_pin *pin; spin_lock(&j->lock); + if (!test_bit(JOURNAL_running, &j->flags)) { + spin_unlock(&j->lock); + return true; + } + *seq = max(*seq, j->pin.front); if (*seq >= j->pin.back) { |