Skip to content

Commit 1595f15

Browse files
Sheng Yonghsiangkao
authored andcommitted
erofs: set error to bio if file-backed IO fails
If a file-backed IO fails before submitting the bio to the lower filesystem, an error is returned, but the bio->bi_status is not marked as an error. However, the error information should be passed to the end_io handler. Otherwise, the IO request will be treated as successful. Fixes: 2832137 ("erofs: support compressed inodes for fileio") Signed-off-by: Sheng Yong <[email protected]> Reviewed-by: Gao Xiang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Gao Xiang <[email protected]>
1 parent 0af2f6b commit 1595f15

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/erofs/fileio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ static void erofs_fileio_ki_complete(struct kiocb *iocb, long ret)
3232
ret = 0;
3333
}
3434
if (rq->bio.bi_end_io) {
35+
if (ret < 0 && !rq->bio.bi_status)
36+
rq->bio.bi_status = errno_to_blk_status(ret);
3537
rq->bio.bi_end_io(&rq->bio);
3638
} else {
3739
bio_for_each_folio_all(fi, &rq->bio) {

0 commit comments

Comments
 (0)