From: Keith Busch <[email protected]>

Rather than assume EIO, set the actual reported status for user space
informational purposes.

Signed-off-by: Keith Busch <[email protected]>
---
 block/fops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/fops.c b/block/fops.c
index 15783a6180dec..f237d6cab8975 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -218,7 +218,7 @@ static ssize_t __blkdev_direct_IO(struct kiocb *iocb, 
struct iov_iter *iter,
 
                ret = blkdev_iov_iter_get_pages(bio, iter, bdev);
                if (unlikely(ret)) {
-                       bio_endio_status(bio, BLK_STS_IOERR);
+                       bio_endio_errno(bio, ret);
                        break;
                }
                if (iocb->ki_flags & IOCB_NOWAIT) {
-- 
2.52.0


Reply via email to