Re: [PATCH] io_uring/rsrc: fix build without DMA_SHARED_BUFFER

From: Geert Uytterhoeven

Date: Tue Oct 13 2026 - 10:03:30 EST


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@xxxxxxxxxxxx>
> Closes: https://d.kernelci.org/i/maestro:0c0fb2ae8f67a98485b9c0cd122f4e5d5156c481
> Closes: https://d.kernelci.org/i/maestro:c4ceb57bdf62b29a8c2fdc83e22c1d5594f06460
> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

Thanks, this fixes the build on a variety of my test systems
Tested-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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