All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@meta.com>
To: <linux-block@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>
Cc: <dm-devel@lists.linux.dev>, <hch@lst.de>, <axboe@kernel.dk>,
	<brauner@kernel.org>, <djwong@kernel.org>,
	<viro@zeniv.linux.org.uk>, Keith Busch <kbusch@kernel.org>
Subject: [PATCH v3 1/5] block: use blkdev_iov_iter_get_pages status for errors
Date: Wed, 24 Jun 2026 10:09:01 -0700	[thread overview]
Message-ID: <20260624170905.3972095-2-kbusch@meta.com> (raw)
In-Reply-To: <20260624170905.3972095-1-kbusch@meta.com>

From: Keith Busch <kbusch@kernel.org>

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 <kbusch@kernel.org>
---
 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) {
-- 
2.53.0-Meta


  reply	other threads:[~2026-06-24 17:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-24 17:09 [PATCH v3 0/5] block: validate direct I/O memory alignment Keith Busch
2026-06-24 17:09 ` Keith Busch [this message]
2026-06-25  6:20   ` [PATCH v3 1/5] block: use blkdev_iov_iter_get_pages status for errors Hannes Reinecke
2026-06-25 11:56   ` Christoph Hellwig
2026-06-24 17:09 ` [PATCH v3 2/5] block: fix dio leak on metadata mapping error Keith Busch
2026-06-25  6:21   ` Hannes Reinecke
2026-06-24 17:09 ` [PATCH v3 3/5] loop: set dma_alignment from the backing file for direct I/O Keith Busch
2026-06-25  6:25   ` Hannes Reinecke
2026-06-25 11:57   ` Christoph Hellwig
2026-06-24 17:09 ` [PATCH v3 4/5] zloop: set dma_alignment from the backing files " Keith Busch
2026-06-25  6:26   ` Hannes Reinecke
2026-06-25 11:57   ` Christoph Hellwig
2026-06-24 17:09 ` [PATCH v3 5/5] block: validate user space vectors during extraction Keith Busch
2026-06-25  6:28   ` Hannes Reinecke
2026-06-25 11:57   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260624170905.3972095-2-kbusch@meta.com \
    --to=kbusch@meta.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=dm-devel@lists.linux.dev \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.