diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index 25d0631c43dd9b44a295dbf2445f9d9fa78fdbbb..0261c6bbfa929d67cfc86a61cd9072bc2652b2f3 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -959,6 +959,8 @@ void bch2_fs_journal_stop(struct journal *j)
 {
 	struct bch_fs *c = container_of(j, struct bch_fs, journal);
 
+	bch2_journal_flush_all_pins(j);
+
 	wait_event(j->wait, journal_entry_close(j));
 
 	/* do we need to write another journal entry? */