Re: [PATCH] iomap: Ensure iop->uptodate matches PageUptodate

From: Christoph Hellwig
Date: Sun Jul 26 2020 - 11:15:09 EST


On Sun, Jul 26, 2020 at 10:10:52AM +0100, Matthew Wilcox (Oracle) wrote:
> If the filesystem has block size < page size and we end up calling
> iomap_page_create() in iomap_page_mkwrite_actor(), the uptodate bits
> would be zero, which causes us to skip writeback of blocks which are
> !uptodate in iomap_writepage_map(). This can lead to user data loss.
>
> Found using generic/127 with the THP patches. I don't think this can be
> reproduced on mainline using that test (the THP code causes iomap_pages
> to be discarded more frequently), but inspection shows it can happen
> with an appropriate series of operations.

Looks good,

Reviewed-by: Christoph Hellwig <hch@xxxxxx>