From: Jens Axboe <axboe@kernel.dk>
To: junxi qian <qjx1298677004@gmail.com>, io-uring@vger.kernel.org
Cc: lkp@intel.com
Subject: Re: [PATCH v2] io_uring: protect remaining lockless ctx->rings accesses with RCU
Date: Wed, 1 Apr 2026 08:33:51 -0600 [thread overview]
Message-ID: <41b94c57-41e9-4273-8a58-3bf6498dde18@kernel.dk> (raw)
In-Reply-To: <CAAkLyHTws=36DYYf3df=qrbM8a_WY2zAX0amKZutadpaWQuAbQ@mail.gmail.com>
On 3/31/26 11:24 PM, junxi qian wrote:
> Hi Jens,
>
> The kernel test robot reported sparse warnings on your commit (9d0a7bda72c5):
>
> io_uring/wait.c:309:49: sparse: cast removes address space '__rcu' of expression
> io_uring/wait.c:319:16: sparse: cast removes address space '__rcu' of expression
> io_uring/wait.c:319:54: sparse: cast removes address space '__rcu' of expression
>
> The issue is that wait.c lines 309 and 319 access ctx->rings_rcu directly
> without going through rcu_dereference(), which sparse flags as an __rcu
> address space violation.
>
> The fix would be to replace the raw ctx->rings_rcu dereferences with
> io_get_rings(ctx), e.g.:
>
> READ_ONCE(ctx->rings_rcu->cq.tail)
>
> READ_ONCE(io_get_rings(ctx)->cq.tail)
>
> Apologies for not catching this during my review of v2.
Indeed, might just fold that in. It's just a sparse complaint, but might
as well get it sorted before it goes upstream.
--
Jens Axboe
prev parent reply other threads:[~2026-04-01 14:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 13:12 [PATCH v2] io_uring: protect remaining lockless ctx->rings accesses with RCU Jens Axboe
2026-04-01 5:24 ` junxi qian
2026-04-01 14:33 ` Jens Axboe [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=41b94c57-41e9-4273-8a58-3bf6498dde18@kernel.dk \
--to=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=lkp@intel.com \
--cc=qjx1298677004@gmail.com \
/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