]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ceph: Do not skip the first folio of the next object in writeback testing
authorHristo Venev <hristo@venev.name>
Wed, 25 Feb 2026 17:07:56 +0000 (19:07 +0200)
committerViacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Fri, 27 Feb 2026 19:14:49 +0000 (11:14 -0800)
When `ceph_process_folio_batch` encounters a folio past the end of the
current object, it should leave it in the batch so that it is picked up
in the next iteration.

Removing the folio from the batch means that it does not get written
back and remains dirty instead. This makes `fsync()` silently skip some
of the data, delays capability release, and breaks coherence with
`O_DIRECT`.

The link below contains instructions for reproducing the bug.

Cc: stable@vger.kernel.org
Fixes: ce80b76dd327 ("ceph: introduce ceph_process_folio_batch() method")
Link: https://tracker.ceph.com/issues/75156
Signed-off-by: Hristo Venev <hristo@venev.name>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Link: https://lore.kernel.org/r/20260225170758.2014172-1-hristo@venev.name
fs/ceph/addr.c

index 8eb30cf658171414e308b1e0a5ac5a6c2820bdff..6a8820a71562164932735d34854751927429606b 100644 (file)
@@ -1328,7 +1328,6 @@ void ceph_process_folio_batch(struct address_space *mapping,
                        continue;
                } else if (rc == -E2BIG) {
                        folio_unlock(folio);
-                       ceph_wbc->fbatch.folios[i] = NULL;
                        break;
                }