* [PATCH] io_uring/rsrc: fix build without DMA_SHARED_BUFFER
@ 2026-10-13 12:24 Sasha Levin
2026-10-13 12:45 ` Geert Uytterhoeven
2026-10-13 16:23 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Sasha Levin @ 2026-10-13 12:24 UTC (permalink / raw)
To: Jens Axboe, Pavel Begunkov; +Cc: io-uring, linux-kernel
io_register_dmabuf_desc() calls io_register_dmabuf() unconditionally, but
io_uring/dma-buf.o is only built with CONFIG_DMA_SHARED_BUFFER enabled.
This causes an undefined reference to io_register_dmabuf() when linking
kernels with CONFIG_IO_URING=y and CONFIG_DMA_SHARED_BUFFER=n, as reported
by KernelCI for i386 allnoconfig and ARC haps_hs_smp_defconfig builds.
Move the configuration check from io_register_dmabuf() to
io_register_dmabuf_desc(), before allocating the resource node and mapped
buffer. This lets the compiler eliminate the call when DMA-BUF support
is disabled and rejects DMA-BUF registration with -EOPNOTSUPP. The check
in io_register_dmabuf() cannot handle this configuration because its
object file is not built.
Fixes: 4bb797852328 ("io_uring/rsrc: add dmabuf backed registered buffers")
Reported-by: kernelci.org bot <bot@kernelci.org>
Closes: https://d.kernelci.org/i/maestro:0c0fb2ae8f67a98485b9c0cd122f4e5d5156c481
Closes: https://d.kernelci.org/i/maestro:c4ceb57bdf62b29a8c2fdc83e22c1d5594f06460
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/dma-buf.c | 2 --
io_uring/rsrc.c | 3 +++
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/io_uring/dma-buf.c b/io_uring/dma-buf.c
index f40c9d87ed8aa..04dd41bf53be0 100644
--- a/io_uring/dma-buf.c
+++ b/io_uring/dma-buf.c
@@ -18,8 +18,6 @@ int io_register_dmabuf(struct io_ring_ctx *ctx,
struct dma_buf *dmabuf = NULL;
int ret;
- if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
- return -EOPNOTSUPP;
if (ctx->flags & IORING_SETUP_IOPOLL)
return -EOPNOTSUPP;
if (desc->uaddr || desc->size)
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
index d6f7cbf731eb2..00f5ed6051e0b 100644
--- a/io_uring/rsrc.c
+++ b/io_uring/rsrc.c
@@ -907,6 +907,9 @@ static struct io_rsrc_node *io_register_dmabuf_desc(struct io_ring_ctx *ctx,
struct io_mapped_ubuf *imu = NULL;
int ret;
+ if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
+ return ERR_PTR(-EOPNOTSUPP);
+
node = io_rsrc_node_alloc(ctx, IORING_RSRC_BUFFER);
if (!node)
return ERR_PTR(-ENOMEM);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] io_uring/rsrc: fix build without DMA_SHARED_BUFFER
2026-10-13 12:24 [PATCH] io_uring/rsrc: fix build without DMA_SHARED_BUFFER Sasha Levin
@ 2026-10-13 12:45 ` Geert Uytterhoeven
2026-10-13 16:23 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2026-10-13 12:45 UTC (permalink / raw)
To: sashal; +Cc: asml.silence, axboe, io-uring, linux-kernel, Geert Uytterhoeven
Hi Sasha,
> io_register_dmabuf_desc() calls io_register_dmabuf() unconditionally, but
> io_uring/dma-buf.o is only built with CONFIG_DMA_SHARED_BUFFER enabled.
> This causes an undefined reference to io_register_dmabuf() when linking
> kernels with CONFIG_IO_URING=y and CONFIG_DMA_SHARED_BUFFER=n, as reported
> by KernelCI for i386 allnoconfig and ARC haps_hs_smp_defconfig builds.
>
> Move the configuration check from io_register_dmabuf() to
> io_register_dmabuf_desc(), before allocating the resource node and mapped
> buffer. This lets the compiler eliminate the call when DMA-BUF support
> is disabled and rejects DMA-BUF registration with -EOPNOTSUPP. The check
> in io_register_dmabuf() cannot handle this configuration because its
> object file is not built.
>
> Fixes: 4bb797852328 ("io_uring/rsrc: add dmabuf backed registered buffers")
> Reported-by: kernelci.org bot <bot@kernelci.org>
> Closes: https://d.kernelci.org/i/maestro:0c0fb2ae8f67a98485b9c0cd122f4e5d5156c481
> Closes: https://d.kernelci.org/i/maestro:c4ceb57bdf62b29a8c2fdc83e22c1d5594f06460
> Signed-off-by: Sasha Levin <sashal@kernel.org>
Thanks, this fixes the build on a variety of my test systems
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] io_uring/rsrc: fix build without DMA_SHARED_BUFFER
2026-10-13 12:24 [PATCH] io_uring/rsrc: fix build without DMA_SHARED_BUFFER Sasha Levin
2026-10-13 12:45 ` Geert Uytterhoeven
@ 2026-10-13 16:23 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2026-10-13 16:23 UTC (permalink / raw)
To: Pavel Begunkov, Sasha Levin; +Cc: io-uring, linux-kernel
On Tue, 13 Oct 2026 08:24:17 -0400, Sasha Levin wrote:
> io_register_dmabuf_desc() calls io_register_dmabuf() unconditionally, but
> io_uring/dma-buf.o is only built with CONFIG_DMA_SHARED_BUFFER enabled.
> This causes an undefined reference to io_register_dmabuf() when linking
> kernels with CONFIG_IO_URING=y and CONFIG_DMA_SHARED_BUFFER=n, as reported
> by KernelCI for i386 allnoconfig and ARC haps_hs_smp_defconfig builds.
>
> Move the configuration check from io_register_dmabuf() to
> io_register_dmabuf_desc(), before allocating the resource node and mapped
> buffer. This lets the compiler eliminate the call when DMA-BUF support
> is disabled and rejects DMA-BUF registration with -EOPNOTSUPP. The check
> in io_register_dmabuf() cannot handle this configuration because its
> object file is not built.
>
> [...]
Applied, thanks!
[1/1] io_uring/rsrc: fix build without DMA_SHARED_BUFFER
commit: 1127f017f33d9e9dbbadd1c230a0640f9a326055
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-13 16:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13 12:24 [PATCH] io_uring/rsrc: fix build without DMA_SHARED_BUFFER Sasha Levin
2026-10-13 12:45 ` Geert Uytterhoeven
2026-10-13 16:23 ` Jens Axboe
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.