io_uring/dma-buf: don't fail fixed buffers without dma-buf support

io_attach_dmabuf_map() is called for every fixed read/write, but returns
-EOPNOTSUPP when CONFIG_DMA_SHARED_BUFFER is disabled before checking
whether the request uses a dma-buf at all. So READ_FIXED and WRITE_FIXED
fail for ordinary registered buffers. Check REQ_F_DMABUF first.

Fixes: 62e4bf5b25 ("io_uring/rsrc: add dmabuf backed registered buffers")
Signed-off-by: Anuj Gupta <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
Anuj Gupta
2026-10-22 09:27:00 -06:00
committed by Jens Axboe
parent fd13f31ac6
commit 45b716456d
+2 -2
View File
@@ -34,10 +34,10 @@ static inline int io_attach_dmabuf_map(struct io_kiocb *req,
struct dma_buf_io_map *map;
struct io_buf_dma *bd;
if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
return -EOPNOTSUPP;
if (!(req->flags & REQ_F_DMABUF))
return 0;
if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
return -EOPNOTSUPP;
bd = req->buf_node->buf->priv;
map = dma_buf_io_get_map(bd->ctx, nowait);