Commit 081a0b78 authored by Hristo Venev's avatar Hristo Venev Committed by Ilya Dryomov
Browse files

ceph: do not skip the first folio of the next object in writeback

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: ce80b76d ("ceph: introduce ceph_process_folio_batch() method")
Link: https://tracker.ceph.com/issues/75156


Signed-off-by: default avatarHristo Venev <hristo@venev.name>
Reviewed-by: default avatarViacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 040d159a
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1326,7 +1326,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;
		}