mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-13 23:34:05 +08:00
io_uring: mark statx/files_update/epoll_ctl as non-SQPOLL
These will naturally fail when attempted through SQPOLL, but either with -EFAULT or -EBADF. Make it explicit that these are not workable through SQPOLL and return -EINVAL, just like other ops that need to use ->files. Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
72f04da48a
commit
6ca56f8459
@ -3786,7 +3786,7 @@ static int io_epoll_ctl_prep(struct io_kiocb *req,
|
||||
#if defined(CONFIG_EPOLL)
|
||||
if (sqe->ioprio || sqe->buf_index)
|
||||
return -EINVAL;
|
||||
if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
|
||||
if (unlikely(req->ctx->flags & (IORING_SETUP_IOPOLL | IORING_SETUP_SQPOLL)))
|
||||
return -EINVAL;
|
||||
|
||||
req->epoll.epfd = READ_ONCE(sqe->fd);
|
||||
@ -3901,7 +3901,7 @@ static int io_fadvise(struct io_kiocb *req, bool force_nonblock)
|
||||
|
||||
static int io_statx_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
|
||||
{
|
||||
if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
|
||||
if (unlikely(req->ctx->flags & (IORING_SETUP_IOPOLL | IORING_SETUP_SQPOLL)))
|
||||
return -EINVAL;
|
||||
if (sqe->ioprio || sqe->buf_index)
|
||||
return -EINVAL;
|
||||
@ -5418,6 +5418,8 @@ static int io_async_cancel(struct io_kiocb *req)
|
||||
static int io_files_update_prep(struct io_kiocb *req,
|
||||
const struct io_uring_sqe *sqe)
|
||||
{
|
||||
if (unlikely(req->ctx->flags & IORING_SETUP_SQPOLL))
|
||||
return -EINVAL;
|
||||
if (unlikely(req->flags & (REQ_F_FIXED_FILE | REQ_F_BUFFER_SELECT)))
|
||||
return -EINVAL;
|
||||
if (sqe->ioprio || sqe->rw_flags)
|
||||
|
Loading…
Reference in New Issue
Block a user