diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 0e4edde92..3d9f6a4f1 100755 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include @@ -8775,12 +8774,10 @@ static int io_sq_offload_create(struct io_ring_ctx *ctx, return 0; if (p->flags & IORING_SETUP_SQ_AFF) { - struct cpumask allowed_mask; int cpu = p->sq_thread_cpu; ret = -EINVAL; - cpuset_cpus_allowed(current, &allowed_mask); - if (!cpumask_test_cpu(cpu, &allowed_mask)) + if (cpu >= nr_cpu_ids || !cpu_online(cpu)) goto err_sqpoll; sqd->sq_cpu = cpu; } else {