diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-03-01 17:34:33 -0500 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-03-14 21:02:16 -0400 |
| commit | cf164a91066d9af7db3cfa9ee2ac2e36f692dc5e (patch) | |
| tree | 5a3a80ee880288bfe2a23af38969cd19ad05af40 /fs/bcachefs/journal_io.c | |
| parent | bcachefs: Fix btree_node_scan io_ref handling (diff) | |
| download | linux-cf164a91066d9af7db3cfa9ee2ac2e36f692dc5e.tar.gz linux-cf164a91066d9af7db3cfa9ee2ac2e36f692dc5e.zip | |
bcachefs: bch2_dev_get_ioref() may now sleep
The next patch implementing freezing will change bch2_dev_get_ioref() to
sleep if a device is currently frozen.
Add an annotation and fix the journal code accordingly.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal_io.c')
| -rw-r--r-- | fs/bcachefs/journal_io.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c index c12d9f9bd536..a510755a8364 100644 --- a/fs/bcachefs/journal_io.c +++ b/fs/bcachefs/journal_io.c @@ -1664,6 +1664,7 @@ static CLOSURE_CALLBACK(journal_write_done) } bool completed = false; + bool do_discards = false; for (seq = journal_last_unwritten_seq(j); seq <= journal_cur_seq(j); @@ -1676,7 +1677,6 @@ static CLOSURE_CALLBACK(journal_write_done) j->flushed_seq_ondisk = seq; j->last_seq_ondisk = w->last_seq; - bch2_do_discards(c); closure_wake_up(&c->freelist_wait); bch2_reset_alloc_cursors(c); } @@ -1727,6 +1727,9 @@ static CLOSURE_CALLBACK(journal_write_done) */ bch2_journal_do_writes(j); spin_unlock(&j->lock); + + if (do_discards) + bch2_do_discards(c); } static void journal_write_endio(struct bio *bio) |
