[PATCH] erofs: mark fileio folios uptodate based on the number of bytes read
Gao Xiang
hsiangkao at linux.alibaba.com
Thu Feb 26 20:28:40 AEDT 2026
Hi Yong,
On 2026/2/26 17:09, 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. Although unused folios are zero filled, they
> are unexpectedly marked as uptodate.
> This patch addresses this by setting folios uptodate based on the actual
> number of bytes read for the plain backing file. And for the compressed
> backing file, there may not have sufficient data for decompression,
> in such case, the bio is marked with an error directly.
>
> Fixes: ce63cb62d794 ("erofs: support unencoded inodes for fileio")
> 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>
Yes, it sounds possible. But can we just fail the
whole I/O for both cases?
In principle, we should retry the remaining I/O once more
for short read, but failing the whole I/O could be one
short-term solution.
Thanks,
Gao Xiang
More information about the Linux-erofs
mailing list