Re: [5.15 REGRESSION v2] iomap: Fix inline extent handling in iomap_readpage
From: Christoph Hellwig <hch@lst.de>
Date: 2021-11-12 05:44:09
Also in:
linux-fsdevel, linux-xfs
From: Christoph Hellwig <hch@lst.de>
Date: 2021-11-12 05:44:09
Also in:
linux-fsdevel, linux-xfs
On Thu, Nov 11, 2021 at 05:17:14PM +0100, Andreas Gruenbacher wrote:
Before commit 740499c78408 ("iomap: fix the iomap_readpage_actor return
value for inline data"), when hitting an IOMAP_INLINE extent,
iomap_readpage_actor would report having read the entire page. Since
then, it only reports having read the inline data (iomap->length).
This will force iomap_readpage into another iteration, and the
filesystem will report an unaligned hole after the IOMAP_INLINE extent.
But iomap_readpage_actor (now iomap_readpage_iter) isn't prepared to
deal with unaligned extents, it will get things wrong on filesystems
with a block size smaller than the page size, and we'll eventually run
into the following warning in iomap_iter_advance:
WARN_ON_ONCE(iter->processed > iomap_length(iter));
Fix that by changing iomap_readpage_iter to return 0 when hitting an
inline extent; this will cause iomap_iter to stop immediately.
To fix readahead as well, change iomap_readahead_iter to pass on
iomap_readpage_iter return values less than or equal to zero.Looks good, Reviewed-by: Christoph Hellwig <hch@lst.de>