On Tue, Nov 16, 2021 at 09:33:30PM -0800, Darrick J. Wong wrote:
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.
I guess this means that we also only support having inline data that ends at EOF? IIRC this is true for the three(?) filesystems that have expressed any interest in inline data: yours, ext4, and erofs?
For erofs, confirmed. (also yes in the long run...)
Thanks, Gao Xiang