From 77ff2ba4630b9e9e9f73bbaaeb675638b2c20dd0 Mon Sep 17 00:00:00 2001 From: Tal Zussman Date: Mon, 7 Sep 2026 15:38:19 +0000 Subject: [PATCH] ceph: don't clear write_congested when collecting folios ceph_process_folio_batch() assigns the result of is_write_congestion_happened() to fsc->write_congested for every folio it collects. The code it replaced only ever set write_congested to true here, leaving the decrement paths to clear it once writeback_count drops below CONGESTION_OFF_THRESH. The unconditional assignment means that a sync writeback that runs while the count sits between the off and on thresholds clears the flag on its first folio, and background writeback resumes early. Only set the flag here, as before. Fixes: ce80b76dd327 ("ceph: introduce ceph_process_folio_batch() method") Assisted-by: Claude:fable-5.1 Signed-off-by: Tal Zussman Reviewed-by: Alex Markuze Signed-off-by: Ilya Dryomov --- fs/ceph/addr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index b1b947d005ce..ae6aa9db5eb2 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -1426,7 +1426,8 @@ void ceph_process_folio_batch(struct address_space *mapping, break; } - fsc->write_congested = is_write_congestion_happened(fsc); + if (is_write_congestion_happened(fsc)) + fsc->write_congested = true; ceph_wbc->fbatch.folios[i] = NULL; ceph_wbc->len += folio_size(folio);