projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d01905d
)
io_uring: check if opcode needs poll first on arming
author
Pavel Begunkov
<asml.silence@gmail.com>
Sat, 23 Oct 2021 11:13:58 +0000
(12:13 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Mon, 25 Oct 2021 13:42:31 +0000
(07:42 -0600)
->pollout or ->pollin are set only for opcodes that need a file, so if
io_arm_poll_handler() tests them first we can be sure that the request
has file set and the ->file check can be removed.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link:
https://lore.kernel.org/r/9adfe4f543d984875e516fce6da35348aab48668.1634987320.git.asml.silence@gmail.com
Reviewed-by: Hao Xu <haoxu@linux.alibaba.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 58cb3a14d58e81a6fbdc201a9ea45c758b3a8559..bff911f951ed5d638e91d68d5a0ee25a1f9fe1db 100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-5584,12
+5584,10
@@
static int io_arm_poll_handler(struct io_kiocb *req)
struct io_poll_table ipt;
__poll_t ret, mask = EPOLLONESHOT | POLLERR | POLLPRI;
- if (!req->file || !file_can_poll(req->file))
- return IO_APOLL_ABORTED;
- if (req->flags & REQ_F_POLLED)
- return IO_APOLL_ABORTED;
if (!def->pollin && !def->pollout)
return IO_APOLL_ABORTED;
+ if (!file_can_poll(req->file) || (req->flags & REQ_F_POLLED))
+ return IO_APOLL_ABORTED;
if (def->pollin) {
mask |= POLLIN | POLLRDNORM;