Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: return -EOPNOTSUPP for unsupported dma-buf I/O
@ 2026-10-30 12:03 Anuj Gupta
  2026-11-03  5:37 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Anuj Gupta @ 2026-10-30 12:03 UTC (permalink / raw)
  To: axboe, hch, asml.silence, kbusch; +Cc: linux-nvme, anuj20.g

From: Anuj Gupta <anuj20.g@samsung.com>

dma_buf_io_ctx_create() uses -EOPNOTSUPP when a file cannot create a
dma-buf I/O context. NVMe currently returns -EINVAL when the namespace's
transport does not implement ->init_dma_buf_io_ctx, making fabrics
namespaces report an invalid argument for an unsupported operation.

Return -EOPNOTSUPP instead.

Fixes: ce5e386c1108 ("nvme-pci: implement dma-buf backed requests")
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index a7a4d09644c1..54d4888cdcd1 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2720,7 +2720,7 @@ static int nvme_init_dma_buf_io_ctx(struct block_device *bdev,
 	struct nvme_ctrl *ctrl = ns->ctrl;
 
 	if (!ctrl->ops->init_dma_buf_io_ctx)
-		return -EINVAL;
+		return -EOPNOTSUPP;
 	return ctrl->ops->init_dma_buf_io_ctx(ctrl, ctx);
 }
 

base-commit: 70866cfa169d5ee149364267289e71d50f9a7ae9
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nvme: return -EOPNOTSUPP for unsupported dma-buf I/O
  2026-10-30 12:03 [PATCH] nvme: return -EOPNOTSUPP for unsupported dma-buf I/O Anuj Gupta
@ 2026-11-03  5:37 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2026-11-03  5:37 UTC (permalink / raw)
  To: Anuj Gupta; +Cc: axboe, hch, asml.silence, kbusch, linux-nvme, anuj20.g

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-03  5:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30 12:03 [PATCH] nvme: return -EOPNOTSUPP for unsupported dma-buf I/O Anuj Gupta
2026-11-03  5:37 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox