public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: [PATCH 1/7] io_uring: remove double poll on poll update
Date: Wed, 15 Dec 2021 22:08:44 +0000	[thread overview]
Message-ID: <ac39e7f80152613603b8a6cc29a2b6063ac2434f.1639605189.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

Before updating a poll request we should remove it from poll queues,
including the double poll entry.

Fixes: b69de288e913 ("io_uring: allow events and user_data update of running poll requests")
Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 3182b67c1277..416998efaab8 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -5980,6 +5980,7 @@ static int io_poll_update(struct io_kiocb *req, unsigned int issue_flags)
 	 * update those. For multishot, if we're racing with completion, just
 	 * let completion re-add it.
 	 */
+	io_poll_remove_double(preq);
 	completing = !__io_poll_remove_one(preq, &preq->poll, false);
 	if (completing && (preq->poll.events & EPOLLONESHOT)) {
 		ret = -EALREADY;
-- 
2.34.0


  reply	other threads:[~2021-12-15 22:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15 22:08 [PATCH for-next 0/7] reworking io_uring's poll and internal poll Pavel Begunkov
2021-12-15 22:08 ` Pavel Begunkov [this message]
2021-12-15 22:08 ` [PATCH 2/7] io_uring: refactor poll update Pavel Begunkov
2021-12-15 22:08 ` [PATCH 3/7] io_uring: move common poll bits Pavel Begunkov
2021-12-15 22:08 ` [PATCH 4/7] io_uring: kill poll linking optimisation Pavel Begunkov
2021-12-15 22:08 ` [PATCH 5/7] io_uring: poll rework Pavel Begunkov
2021-12-15 22:08 ` [PATCH 6/7] io_uring: single shot poll removal optimisation Pavel Begunkov
2021-12-15 22:08 ` [PATCH 7/7] io_uring: use completion batching for poll rem/upd Pavel Begunkov
2021-12-17 15:02 ` [PATCH for-next 0/7] reworking io_uring's poll and internal poll Hao Xu
2021-12-17 19:40   ` Pavel Begunkov
2021-12-28 17:51 ` 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 \
    --in-reply-to=ac39e7f80152613603b8a6cc29a2b6063ac2434f.1639605189.git.asml.silence@gmail.com \
    [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