public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Anuj Gupta <anuj1072538@gmail.com>, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>
Cc: io-uring@vger.kernel.org, Anuj Gupta <anuj20.g@samsung.com>
Subject: Re: [PATCH] io_uring/dma-buf: don't fail fixed buffers without dma-buf support
Date: Fri, 23 Oct 2026 18:48:04 +0100	[thread overview]
Message-ID: <8a039861-0c0b-471d-9129-e9e4e549d213@gmail.com> (raw)
In-Reply-To: <20261022132027.2293931-1-anuj1072538@gmail.com>

On 10/22/26 14:20, Anuj Gupta wrote:
> From: Anuj Gupta <anuj20.g@samsung.com>
> 
> 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: 62e4bf5b25d4 ("io_uring/rsrc: add dmabuf backed registered buffers")
> Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
> ---
>   io_uring/dma-buf.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/io_uring/dma-buf.h b/io_uring/dma-buf.h
> index a876a9e5e272..534c06b6879f 100644
> --- a/io_uring/dma-buf.h
> +++ b/io_uring/dma-buf.h
> @@ -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;

Good catch. It was supposed to be

if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
	return 0;

as there shouldn't be any dma-buf registered buffers
when it's disabled. Looks good in either case

-- 
Pavel Begunkov


      parent reply	other threads:[~2026-10-23 17:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 13:20 [PATCH] io_uring/dma-buf: don't fail fixed buffers without dma-buf support Anuj Gupta
2026-10-22 15:27 ` Jens Axboe
2026-10-23 17:48 ` Pavel Begunkov [this message]

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=8a039861-0c0b-471d-9129-e9e4e549d213@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=anuj1072538@gmail.com \
    --cc=anuj20.g@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=io-uring@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox