]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring/register: use atomic_read/write for sq_flags migration
authorJens Axboe <axboe@kernel.dk>
Fri, 24 Jan 2025 21:32:25 +0000 (14:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Feb 2025 09:02:17 +0000 (10:02 +0100)
commit016bc7b496d8f77d287fc8912aa2a53961eeab92
treef371b9d905c02a7f0736b78d378ee9890e125a95
parenta089eada0b02d9eb7398ee49a9164eae4a1491c9
io_uring/register: use atomic_read/write for sq_flags migration

[ Upstream commit a23ad06bfee5e51cd9e51aebf11401e7b4b5d00a ]

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 <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501242000.A2sKqaCL-lkp@intel.com/
Fixes: 2c5aae129f42 ("io_uring/register: document io_register_resize_rings() shared mem usage")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/register.c