io_uring/poll: don't reissue in case of poll race on multishot request
[linux-block.git] / io_uring / poll.c
index 32e5fc8365e6a3d1862f24f70788b6e27be5cf7a..2ac1366adbd77e822db141c9aed0b31198a5851d 100644 (file)
@@ -283,8 +283,12 @@ static int io_poll_check_events(struct io_kiocb *req, bool *locked)
                         * to the waitqueue, so if we get nothing back, we
                         * should be safe and attempt a reissue.
                         */
-                       if (unlikely(!req->cqe.res))
+                       if (unlikely(!req->cqe.res)) {
+                               /* Multishot armed need not reissue */
+                               if (!(req->apoll_events & EPOLLONESHOT))
+                                       continue;
                                return IOU_POLL_REISSUE;
+                       }
                }
                if (req->apoll_events & EPOLLONESHOT)
                        return IOU_POLL_DONE;