summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-06-17 16:36:34 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2024-06-20 01:27:24 +0300
commitdbf4d79b7fc7e9bf5d1546f6dfffd789ea061221 (patch)
tree9f543f8ee318e05700f4f2f12975d1c1ac04f5a9 /fs/bcachefs/journal.c
parent9e7cfb35e2668e542c333ed3ec4b0a951dd332ee (diff)
downloadlinux-dbf4d79b7fc7e9bf5d1546f6dfffd789ea061221.tar.xz
bcachefs: Fix early init error path in journal code
We shouln't be running the journal shutdown sequence if we never fully initialized the journal. Reported-by: syzbot+ffd2270f0bca3322ee00@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal.c')
-rw-r--r--fs/bcachefs/journal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index adec8e1ea73e..dac2f498ae8b 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -1167,6 +1167,9 @@ void bch2_dev_journal_stop(struct journal *j, struct bch_dev *ca)
void bch2_fs_journal_stop(struct journal *j)
{
+ if (!test_bit(JOURNAL_running, &j->flags))
+ return;
+
bch2_journal_reclaim_stop(j);
bch2_journal_flush_all_pins(j);