Colin reports that there's unreachable code, since we only ever break
if ret == 0. This is correct, and is due to a reversed logic condition
in when to break or not.
Break out of the loop if we don't process any task work, in that case
we do want to return -EINTR.
Fixes: d2205c3715d3 ("io_uring: process task work in io_uring_register()")
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
ret = wait_for_completion_interruptible(&ctx->ref_comp);
if (!ret)
break;
- if (io_run_task_work_sig() > 0)
- continue;
+ ret = io_run_task_work_sig();
+ if (ret < 0)
+ break;
} while (1);
mutex_lock(&ctx->uring_lock);
if (ret) {
percpu_ref_resurrect(&ctx->refs);
- ret = -EINTR;
goto out_quiesce;
}
}