mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
io_uring: disable io-wq execution of multishot NOWAIT requests
Commitbee1d5becd
upstream. Do the same check for direct io-wq execution for multishot requests that commit2a975d426c
did for the inline execution, and disable multishot mode (and revert to single shot) if the file type doesn't support NOWAIT, and isn't opened in O_NONBLOCK mode. For multishot to work properly, it's a requirement that nonblocking read attempts can be done. Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f0194e4a9e
commit
47de1a773e
@ -1964,10 +1964,15 @@ void io_wq_submit_work(struct io_wq_work *work)
|
||||
err = -EBADFD;
|
||||
if (!file_can_poll(req->file))
|
||||
goto fail;
|
||||
err = -ECANCELED;
|
||||
if (io_arm_poll_handler(req, issue_flags) != IO_APOLL_OK)
|
||||
goto fail;
|
||||
return;
|
||||
if (req->file->f_flags & O_NONBLOCK ||
|
||||
req->file->f_mode & FMODE_NOWAIT) {
|
||||
err = -ECANCELED;
|
||||
if (io_arm_poll_handler(req, issue_flags) != IO_APOLL_OK)
|
||||
goto fail;
|
||||
return;
|
||||
} else {
|
||||
req->flags &= ~REQ_F_APOLL_MULTISHOT;
|
||||
}
|
||||
}
|
||||
|
||||
if (req->flags & REQ_F_FORCE_ASYNC) {
|
||||
|
Loading…
Reference in New Issue
Block a user