Skip to content

Commit 016bc7b

Browse files
axboegregkh
authored andcommitted
io_uring/register: use atomic_read/write for sq_flags migration
[ Upstream commit a23ad06 ] A previous commit changed all of the migration from the old to the new ring for resizing to use READ/WRITE_ONCE. However, ->sq_flags is an atomic_t, and while most archs won't complain on this, some will indeed flag this: io_uring/register.c:554:9: sparse: sparse: cast to non-scalar io_uring/register.c:554:9: sparse: sparse: cast from non-scalar Just use atomic_set/atomic_read for handling this case. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: 2c5aae1 ("io_uring/register: document io_register_resize_rings() shared mem usage") Signed-off-by: Jens Axboe <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent a089ead commit 016bc7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/register.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ static int io_register_resize_rings(struct io_ring_ctx *ctx, void __user *arg)
553553
ctx->cqe_cached = ctx->cqe_sentinel = NULL;
554554

555555
WRITE_ONCE(n.rings->sq_dropped, READ_ONCE(o.rings->sq_dropped));
556-
WRITE_ONCE(n.rings->sq_flags, READ_ONCE(o.rings->sq_flags));
556+
atomic_set(&n.rings->sq_flags, atomic_read(&o.rings->sq_flags));
557557
WRITE_ONCE(n.rings->cq_flags, READ_ONCE(o.rings->cq_flags));
558558
WRITE_ONCE(n.rings->cq_overflow, READ_ONCE(o.rings->cq_overflow));
559559

0 commit comments

Comments
 (0)