]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: Fix triggering of discard by the journal path
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 12 Jul 2025 23:31:49 +0000 (19:31 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 16 Jul 2025 21:32:33 +0000 (17:32 -0400)
It becomes possible to do discards after a journal flush, which
naturally the journal code is reponsible for.

A prior refactoring seems to have broken this - which went unnoticed
because the foreground allocator path can also trigger discards.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/journal_io.c

index dd3f3434c1b03dd158c504ad68bc8a5a16e7a78e..9e028dbcc3d02d3a4838e8601b66b9038bd47c22 100644 (file)
@@ -1767,6 +1767,7 @@ static CLOSURE_CALLBACK(journal_write_done)
 
                        closure_wake_up(&c->freelist_wait);
                        bch2_reset_alloc_cursors(c);
+                       do_discards = true;
                }
 
                j->seq_ondisk = seq;