io_uring: allow disabling rings during the creation
authorStefano Garzarella <sgarzare@redhat.com>
Thu, 27 Aug 2020 14:58:31 +0000 (16:58 +0200)
committerJens Axboe <axboe@kernel.dk>
Sat, 5 Sep 2020 22:07:35 +0000 (16:07 -0600)
commit7ec3d1dd937841513081c74dd97eb8e8d7764c87
tree625e661a239360a08f9e5abb6c825c541ff0704b
parentd730b1a294323d03f7f6fa4fa69abdc0b1878756
io_uring: allow disabling rings during the creation

This patch adds a new IORING_SETUP_R_DISABLED flag to start the
rings disabled, allowing the user to register restrictions,
buffers, files, before to start processing SQEs.

When IORING_SETUP_R_DISABLED is set, SQE are not processed and
SQPOLL kthread is not started.

The restrictions registration are allowed only when the rings
are disable to prevent concurrency issue while processing SQEs.

The rings can be enabled using IORING_REGISTER_ENABLE_RINGS
opcode with io_uring_register(2).

Suggested-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
include/uapi/linux/io_uring.h