mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
io_uring: fix poll error reporting
commit7179c3ce3d
upstream. We should not return an error code in req->result in io_poll_check_events(), because it may get mangled and returned as success. Just return the error code directly, the callers will fail the request or proceed accordingly. Fixes:6bf9c47a39
("io_uring: defer file assignment") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/5f03514ee33324dc811fb93df84aee0f695fb044.1649862516.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
540e5ce8b3
commit
b74c1d1782
1 changed files with 2 additions and 3 deletions
|
@ -5513,9 +5513,8 @@ static int io_poll_check_events(struct io_kiocb *req, bool locked)
|
|||
unsigned flags = locked ? 0 : IO_URING_F_UNLOCKED;
|
||||
|
||||
if (unlikely(!io_assign_file(req, flags)))
|
||||
req->result = -EBADF;
|
||||
else
|
||||
req->result = vfs_poll(req->file, &pt) & poll->events;
|
||||
return -EBADF;
|
||||
req->result = vfs_poll(req->file, &pt) & poll->events;
|
||||
}
|
||||
|
||||
/* multishot, just fill an CQE and proceed */
|
||||
|
|
Loading…
Reference in a new issue