On 2026/2/26 17:28, Gao Xiang wrote:
Hi Yong,

On 2026/2/26 17:09, Sheng Yong wrote:
From: Sheng Yong <[email protected]>

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 <[email protected]>
Signed-off-by: Yunlei He <[email protected]>
Signed-off-by: Sheng Yong <[email protected]>

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.

I wonder if we should simply:

diff --git a/fs/erofs/fileio.c b/fs/erofs/fileio.c
index abe873f01297..98cdaa1cd1a7 100644
--- a/fs/erofs/fileio.c
+++ b/fs/erofs/fileio.c
@@ -25,10 +25,8 @@ static void erofs_fileio_ki_complete(struct kiocb *iocb, 
long ret)
                        container_of(iocb, struct erofs_fileio_rq, iocb);
        struct folio_iter fi;

-       if (ret >= 0 && ret != rq->bio.bi_iter.bi_size) {
-               bio_advance(&rq->bio, ret);
-               zero_fill_bio(&rq->bio);
-       }
+       if (ret >= 0 && ret != rq->bio.bi_iter.bi_size)
+               ret = -EIO;

instead. IOWs, filling zeros means nothing for us.

Thanks,
Gao Xiang


Thanks,
Gao Xiang



Reply via email to