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/register: set ctx->restricted when restrictions are parsed

Rather than defer this until the rings are enabled, just set it
upfront when the restrictions are parsed and enabled anyway. There's
no reason to defer this setting until the rings are enabled.

Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

+3 -4
+3 -4
io_uring/register.c
··· 175 175 memset(&ctx->restrictions, 0, sizeof(ctx->restrictions)); 176 176 return ret; 177 177 } 178 + if (ctx->restrictions.registered) 179 + ctx->restricted = 1; 178 180 return 0; 179 181 } 180 182 ··· 194 192 if (wq_has_sleeper(&ctx->poll_wq)) 195 193 io_activate_pollwq(ctx); 196 194 } 197 - 198 - if (ctx->restrictions.registered) 199 - ctx->restricted = 1; 200 195 201 196 /* Keep submitter_task store before clearing IORING_SETUP_R_DISABLED */ 202 197 smp_store_release(&ctx->flags, ctx->flags & ~IORING_SETUP_R_DISABLED); ··· 626 627 if (ctx->submitter_task && ctx->submitter_task != current) 627 628 return -EEXIST; 628 629 629 - if (ctx->restricted) { 630 + if (ctx->restricted && !(ctx->flags & IORING_SETUP_R_DISABLED)) { 630 631 opcode = array_index_nospec(opcode, IORING_REGISTER_LAST); 631 632 if (!test_bit(opcode, ctx->restrictions.register_op)) 632 633 return -EACCES;