[PATCH v2] erofs: set fileio bio failed in short read case

Gao Xiang hsiangkao at linux.alibaba.com
Fri Feb 27 14:41:28 AEDT 2026


Hi Yong,

On 2026/2/27 10:30, Sheng Yong wrote:
> From: Sheng Yong <shengyong1 at xiaomi.com>
> 
> For file-backed mount, IO requests are handled by vfs_iocb_iter_read().
> However, it can be interrupted by SIGKILL, returning the number of
> bytes actually copied. Unused folios in bio are unexpectedly marked
> as uptodate.
> 
>    vfs_read
>      filemap_read
>        filemap_get_pages
>          filemap_readahead
>            erofs_fileio_readahead
>              erofs_fileio_rq_submit
>                vfs_iocb_iter_read
>                  filemap_read
>                    filemap_get_pages  <= detect signal
>                erofs_fileio_ki_complete  <= set all folios uptodate
> 
> This patch addresses this by setting short read bio with an error
> directly.
> 
> Fixes: bc804a8d7e86 ("erofs: handle end of filesystem properly for file-backed mounts")
> Reported-by: chenguanyou <chenguanyou at xiaomi.com>
> Signed-off-by: Yunlei He <heyunlei at xiaomi.com>
> Signed-off-by: Sheng Yong <shengyong1 at xiaomi.com>

LGTM, yet I still need more time to run some tests
before upstreaming this in order to miss any corner
cases.

You could run more tests in the same time, thanks!

Reviewed-by: Gao Xiang <hsiangkao at linux.alibaba.com>

Thanks,
Gao Xiang


More information about the Linux-erofs mailing list