From: Jens Axboe <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>
Subject: [PATCH 1/8] io_uring: mask in error/nval/hangup consistently for poll
Date: Fri, 19 Mar 2021 14:35:09 -0600 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Instead of masking these in as part of regular POLL_ADD prep, do it in
io_init_poll_iocb(), and include NVAL as that's generally unmaskable,
and RDHUP alongside the HUP that is already set.
Signed-off-by: Jens Axboe <[email protected]>
---
fs/io_uring.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 2c0e630a40d7..28bccb5ad4e6 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4975,7 +4975,9 @@ static void io_init_poll_iocb(struct io_poll_iocb *poll, __poll_t events,
poll->head = NULL;
poll->done = false;
poll->canceled = false;
- poll->events = events;
+#define IO_POLL_UNMASK (EPOLLERR|EPOLLHUP|EPOLLNVAL|EPOLLRDHUP)
+ /* mask in events that we always want/need */
+ poll->events = events | IO_POLL_UNMASK;
INIT_LIST_HEAD(&poll->wait.entry);
init_waitqueue_func_entry(&poll->wait, wake_func);
}
@@ -5337,8 +5339,7 @@ static int io_poll_add_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe
#ifdef __BIG_ENDIAN
events = swahw32(events);
#endif
- poll->events = demangle_poll(events) | EPOLLERR | EPOLLHUP |
- (events & EPOLLEXCLUSIVE);
+ poll->events = demangle_poll(events) | (events & EPOLLEXCLUSIVE);
return 0;
}
--
2.31.0
next prev parent reply other threads:[~2021-03-19 20:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-19 20:35 [PATCHSET v2 0/8] Poll improvements Jens Axboe
2021-03-19 20:35 ` Jens Axboe [this message]
2021-03-19 20:35 ` [PATCH 2/8] io_uring: allocate memory for overflowed CQEs Jens Axboe
2021-03-19 20:35 ` [PATCH 3/8] io_uring: include cflags in completion trace event Jens Axboe
2021-03-19 20:35 ` [PATCH 4/8] io_uring: add multishot mode for IORING_OP_POLL_ADD Jens Axboe
2021-03-19 20:35 ` [PATCH 5/8] io_uring: abstract out helper for removing poll waitqs/hashes Jens Axboe
2021-03-19 20:35 ` [PATCH 6/8] io_uring: terminate multishot poll for CQ ring overflow Jens Axboe
2021-03-19 20:35 ` [PATCH 7/8] io_uring: abstract out a io_poll_find_helper() Jens Axboe
2021-03-19 20:35 ` [PATCH 8/8] io_uring: allow events and user_data update of running poll requests Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox