Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: remove WRITE_ONCE() in io_uring_create()

There's no need to use WRITE_ONCE() to set ctx->submitter_task in
io_uring_create() since no other task can access the io_ring_ctx until a
file descriptor is associated with it. So use a normal assignment
instead of WRITE_ONCE().

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Link: https://lore.kernel.org/r/20250904161223.2600435-1-csander@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Caleb Sander Mateos and committed by
Jens Axboe
c2685729 9f8608fc

+7 -2
+7 -2
io_uring/io_uring.c
··· 3891 3891 } 3892 3892 3893 3893 if (ctx->flags & IORING_SETUP_SINGLE_ISSUER 3894 - && !(ctx->flags & IORING_SETUP_R_DISABLED)) 3895 - WRITE_ONCE(ctx->submitter_task, get_task_struct(current)); 3894 + && !(ctx->flags & IORING_SETUP_R_DISABLED)) { 3895 + /* 3896 + * Unlike io_register_enable_rings(), don't need WRITE_ONCE() 3897 + * since ctx isn't yet accessible from other tasks 3898 + */ 3899 + ctx->submitter_task = get_task_struct(current); 3900 + } 3896 3901 3897 3902 file = io_uring_get_file(ctx); 3898 3903 if (IS_ERR(file)) {