]> git.baikalelectronics.ru Git - kernel.git/commit
iomap: Set all uptodate bits for an Uptodate page
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 25 Sep 2020 18:16:53 +0000 (11:16 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 28 Sep 2020 15:47:01 +0000 (08:47 -0700)
commitffdd3877d80758932f0b78345b74abd3c207843d
treeb2abc85f95dfbe458f4bd22572e62da773957238
parent1cb014e865768d051dae28aa234a5e83809a1cd3
iomap: Set all uptodate bits for an Uptodate page

For filesystems with block size < page size, we need to set all the
per-block uptodate bits if the page was already uptodate at the time
we create the per-block metadata.  This can happen if the page is
invalidated (eg by a write to drop_caches) but ultimately not removed
from the page cache.

This is a data corruption issue as page writeback skips blocks which
are marked !uptodate.

Fixes: b53f27525678 ("iomap: add support for sub-pagesize buffered I/O without buffer heads")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reported-by: Qian Cai <cai@redhat.com>
Cc: Brian Foster <bfoster@redhat.com>
Reviewed-by: Gao Xiang <hsiangkao@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/iomap/buffered-io.c