Thread (5 messages) 5 messages, 4 authors, 2021-11-17

Re: [5.15 REGRESSION v2] iomap: Fix inline extent handling in iomap_readpage

From: Gao Xiang <hidden>
Date: 2021-11-17 05:52:44
Also in: linux-fsdevel, linux-xfs

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:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help