[PATCH v2] iomap: fix inline data on buffered read

Gao Xiang hsiangkao at linux.alibaba.com
Wed Mar 19 23:01:15 AEDT 2025


Hi Brian,

On 2025/3/19 19:28, Brian Foster wrote:
> On Wed, Mar 19, 2025 at 04:51:25PM +0800, Gao Xiang wrote:
>> Previously, iomap_readpage_iter() returning 0 would break out of the
>> loops of iomap_readahead_iter(), which is what iomap_read_inline_data()
>> relies on.
>>
>> However, commit d9dc477ff6a2 ("iomap: advance the iter directly on
>> buffered read") changes this behavior without calling
>> iomap_iter_advance(), which causes EROFS to get stuck in
>> iomap_readpage_iter().
>>
>> It seems iomap_iter_advance() cannot be called in
>> iomap_read_inline_data() because of the iomap_write_begin() path, so
>> handle this in iomap_readpage_iter() instead.
>>
>> Reported-and-tested-by: Bo Liu <liubo03 at inspur.com>
>> Fixes: d9dc477ff6a2 ("iomap: advance the iter directly on buffered read")
>> Cc: Brian Foster <bfoster at redhat.com>
>> Cc: Christoph Hellwig <hch at lst.de>
>> Cc: "Darrick J. Wong" <djwong at kernel.org>
>> Cc: Christian Brauner <brauner at kernel.org>
>> Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
>> ---
> 
> Ugh. I'd hoped ext4 testing would have uncovered such an issue, but now
> that I think of it, IIRC ext4 isn't fully on iomap yet so wouldn't have
> provided this coverage. So apologies for the testing oversight on my
> part and thanks for the fix.
> 
> For future reference, do you guys have any documentation or whatever to
> run quick/smoke fstests against EROFS? (I assume this could be
> reproduced via fstests..?).

I don't think any existing testcase of fstests is
useful for readonly filesystems like EROFS since
EROFS only has read interface so all test cases
including regression tests will be integrated
into erofs-utils directly.

EROFS can be easily tested with its own testcases
in erofs-utils:

git clone git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git
cd erofs-utils
git checkout origin/experimental-tests	  # for now, I will integrate to main later.
./autogen.sh
./configure
make check

Without this patch, test cases will just hang.

> 

...

> 
> Reviewed-by: Brian Foster <bfoster at redhat.com>

Thanks.

Thanks,
Gao Xiang

> 
>>   
>>   	/* zero post-eof blocks as the page may be mapped */
>>   	ifs = ifs_alloc(iter->inode, folio, iter->flags);
>> -- 
>> 2.43.5
>>



More information about the Linux-erofs mailing list