Skip to content

Commit 7179c3c

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix poll error reporting
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: 6bf9c47 ("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>
1 parent cce64ef commit 7179c3c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/io_uring.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5861,9 +5861,8 @@ static int io_poll_check_events(struct io_kiocb *req, bool locked)
58615861
unsigned flags = locked ? 0 : IO_URING_F_UNLOCKED;
58625862

58635863
if (unlikely(!io_assign_file(req, flags)))
5864-
req->result = -EBADF;
5865-
else
5866-
req->result = vfs_poll(req->file, &pt) & req->apoll_events;
5864+
return -EBADF;
5865+
req->result = vfs_poll(req->file, &pt) & req->apoll_events;
58675866
}
58685867

58695868
/* multishot, just fill an CQE and proceed */

0 commit comments

Comments
 (0)