public inbox for [email protected]
 help / color / mirror / Atom feed
* io_uring: open/close and SQPOLL
@ 2020-05-30 19:45 Pavel Begunkov
  2020-06-02  1:49 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2020-05-30 19:45 UTC (permalink / raw)
  To: Jens Axboe, io-uring

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.


diff --git a/fs/io_uring.c b/fs/io_uring.c
index 732ec73ec3c0..e841fd03d976 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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;

-- 
Pavel Begunkov

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: io_uring: open/close and SQPOLL
  2020-05-30 19:45 io_uring: open/close and SQPOLL Pavel Begunkov
@ 2020-06-02  1:49 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2020-06-02  1:49 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring

On 5/30/20 1:45 PM, Pavel Begunkov wrote:
> 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?

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-02  1:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-30 19:45 io_uring: open/close and SQPOLL Pavel Begunkov
2020-06-02  1:49 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox