Skip to contentSkip to conversation

io_uring: open/close and SQPOLL

PATCH Pavel Begunkov 2 participants 2 messages May 30, 2020 – Jun 2, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Do I miss something, or open/close/etc need an explicit check for IORING_SETUP_SQPOLL? E.g., now an open() request somehow returns -EFAULT, and that doesn't seem good.

fs/io_uring.c +4 -0
index 732ec73ec3c0..e841fd03d976 100644
@@ -3023,6 +3023,8 @@ static int io_openat2_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 	size_t len;
 	int ret;
 
+	if (unlikely(req->ctx->flags & (IORING_SETUP_IOPOLL|IORING_SETUP_SQPOLL)))
+		return -EINVAL;
 	if (sqe->ioprio || sqe->buf_index)
 		return -EINVAL;
 	if (req->flags & REQ_F_FIXED_FILE)
@@ -3417,6 +3419,8 @@ static int io_close_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 	 */
 	req->work.flags |= IO_WQ_WORK_NO_CANCEL;
 
+	if (unlikely(req->ctx->flags & (IORING_SETUP_IOPOLL|IORING_SETUP_SQPOLL)))
+		return -EINVAL;
 	if (sqe->ioprio || sqe->off || sqe->addr || sqe->len ||
 	    sqe->rw_flags || sqe->buf_index)
 		return -EINVAL;
Signature · 1 line
Pavel Begunkov
maintainer
#1 lore raw
Quoted 3 lines · Pavel Begunkov

Do I miss something, or open/close/etc need an explicit check for IORING_SETUP_SQPOLL? E.g., now an open() request somehow returns -EFAULT, and that doesn't seem good.

Probably best just to disable them - can you send a real patch?

Signature · 1 line
Jens Axboe