Re: [PATCH v3 1/5] block: use blkdev_iov_iter_get_pages status for errors

Hannes Reinecke <[email protected]>
Newsgroups dev.linux.lists.dm-devel,org.kernel.vger.linux-block,org.kernel.vger.linux-fsdevel
Message-ID <[email protected]>
On 6/24/26 7:09 PM, Keith Busch wrote:
> From: Keith Busch <[email protected]>
> 
> blkdev_iov_iter_get_pages() can return various error values, including
> EIO, EFAULT, and ENOMEM. Set the actual reported status so user space
> can know a little more on why an operation failed.
> 
> 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..0827bb884d473 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_status(bio, errno_to_blk_status(ret));
>   			break;
>   		}
>   		if (iocb->ki_flags & IOCB_NOWAIT) {

Reviewed-by: Hannes Reinecke <[email protected]>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.