dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Pavel Begunkov" <asml.silence@gmail.com>
Cc: media-ci@linuxtv.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v6 11/13] io_uring/rsrc: add uncloneable regbuf flag
Date: Mon, 21 Sep 2026 13:53:11 +0000	[thread overview]
Message-ID: <20260921135312.69B591F000FF@smtp.kernel.org> (raw)
In-Reply-To: <9b71636a03f2345bcc09127d77eb6b294a1d0938.1789997898.git.asml.silence@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] io_uring: incorrect error code -ENOMEM for uncloneable buffers
--

commit 09226c4686b3c73a879519b5ef4315732d82b7f5
Author: Pavel Begunkov <asml.silence@gmail.com>

io_uring/rsrc: add uncloneable regbuf flag

It's hard to implement cloning if the internal structure needs to be
mutable and/or relies on other ring resources. In preparation to such
buffer types, add a flag indicating that the buffer can't be cloned.

> diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
> index 83a7ad9f5bc78..0b526b094dc9e 100644
> --- a/io_uring/rsrc.c
> +++ b/io_uring/rsrc.c
> @@ -1434,6 +1434,11 @@ static int io_clone_buffers(struct io_ring_ctx *ctx, struct io_ring_ctx *src_ctx
>  		if (!src_node) {
>  			dst_node = NULL;
>  		} else {
> +			if (src_node->buf->flags & IO_REGBUF_F_UNCLONEABLE) {
> +				io_rsrc_data_free(ctx, &data);
> +				return -ENOMEM;

[Severity: Medium]
Is -ENOMEM the correct error code to return from io_clone_buffers() for this
case? Returning -ENOMEM for an unsupported operation (cloning an explicitly
uncloneable buffer) might be misleading, as it usually signifies a transient
out-of-memory condition.

If a user registers an uncloneable buffer and subsequently attempts to clone
the buffer table via the IORING_REGISTER_CLONE_BUFFERS operation, robust
userspace applications encountering -ENOMEM might enter a back-off and retry
loop. This could potentially lead to infinite stalls rather than aborting the
unsupported operation. Would an error code like -EOPNOTSUPP or -EINVAL be
more appropriate to indicate that the buffer type simply doesn't support
cloning?

> +			}
> +
>  			dst_node = io_rsrc_node_alloc(ctx, IORING_RSRC_BUFFER);
>  			if (!dst_node) {
>  				io_rsrc_data_free(ctx, &data);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1789997898.git.asml.silence@gmail.com?part=11

  reply	other threads:[~2026-09-21 13:53 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 13:38 [PATCH v6 00/13] Add dmabuf read/write via io_uring Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 01/13] dma-buf: introduce initial file I/O infrastructure Pavel Begunkov
2026-09-21 13:53   ` sashiko-bot
2026-09-22  9:08     ` Pavel Begunkov
2026-09-30  6:54       ` Matthew Brost
2026-09-30 10:03         ` Pavel Begunkov
2026-09-30  3:00   ` Matthew Brost
2026-09-30 10:08     ` Pavel Begunkov
2026-09-30 12:48       ` Pavel Begunkov
2026-09-30 19:43         ` Matthew Brost
2026-10-05 11:49           ` Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 02/13] iov_iter: add iterator type for dmabuf maps Pavel Begunkov
2026-09-21 13:53   ` sashiko-bot
2026-09-22  9:15     ` Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 03/13] block: always adjust bi_offset on bio_advance_iter Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 04/13] block: introduce dma map backed bio type Pavel Begunkov
     [not found]   ` <20260922131610.GA30468@lst.de>
2026-09-22 13:54     ` Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 05/13] block: add dma-buf support for raw bdev Pavel Begunkov
2026-09-21 13:50   ` sashiko-bot
2026-09-21 13:38 ` [PATCH v6 06/13] nvme-pci: implement dma-buf backed requests Pavel Begunkov
2026-09-21 13:58   ` sashiko-bot
     [not found]   ` <20260922132016.GA30684@lst.de>
2026-09-22 13:37     ` Pavel Begunkov
     [not found]       ` <20260923045505.GB26231@lst.de>
2026-09-24 15:53         ` Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 07/13] nvme-pci: rename nvme_pci_sgl_set_data to nvme_pci_dma_iter_set_sgl Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 08/13] nvme-pci: add SGL support for the dmabuf path Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 09/13] io_uring/rsrc: introduce buf registration structure Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 10/13] io_uring/rsrc: extend buffer update Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 11/13] io_uring/rsrc: add uncloneable regbuf flag Pavel Begunkov
2026-09-21 13:53   ` sashiko-bot [this message]
2026-09-21 13:38 ` [PATCH v6 12/13] io_uring/rsrc: add regbuf import flags Pavel Begunkov
2026-09-21 13:38 ` [PATCH v6 13/13] io_uring/rsrc: add dmabuf backed registered buffers Pavel Begunkov
2026-09-21 13:54   ` sashiko-bot

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=20260921135312.69B591F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=asml.silence@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=media-ci@linuxtv.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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