projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cce64ef
)
io_uring: fix poll error reporting
author
Pavel Begunkov
<asml.silence@gmail.com>
Wed, 13 Apr 2022 15:10:35 +0000
(16:10 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Wed, 13 Apr 2022 16:25:37 +0000
(10:25 -0600)
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: 6bf9c47a3989 ("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>
fs/io_uring.c
patch
|
blob
|
history
diff --git
a/fs/io_uring.c
b/fs/io_uring.c
index d06f1952fdfa189d73f1bc361b403d54aa3c2b56..ab674a0d269bd08e8fb817253898d2f90c7a1d37 100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-5861,9
+5861,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) & req->apoll_events;
+ return -EBADF;
+ req->result = vfs_poll(req->file, &pt) & req->apoll_events;
}
/* multishot, just fill an CQE and proceed */