Re: [PATCH 1/2] iomap: use page dirty state to seek data over unwritten extents

Brian Foster
2020-10-19T16:55:09Z

On Thu, Oct 15, 2020 at 10:47:00AM +0100, Christoph Hellwig wrote:
> I don't think we can solve this properly. Due to the racyness we can
> always err one side. The beauty of treating all the uptodate pages
> as present data is that we err on the safe side, as applications
> expect holes to never have data, while "data" could always be zeroed.
>

I don't think that's quite accurate. Nothing prevents a dirty page from
being written back and reclaimed between acquiring the (unwritten)
mapping and doing the pagecache scan, so it's possible to present valid
data (written to the kernel prior to a seek) as a hole with the current
code.

Brian