fixup poll-mshot-update

this test did not notice when poll was cancelled.

update it to notice, and rearm poll

Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220721160406.1700508-2-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Dylan Yudaken
2022-07-21 09:04:05 -07:00
committed by Jens Axboe
parent 712e75fc23
commit 2d0e8f6933
+26
View File
@@ -75,6 +75,20 @@ static int arm_poll(struct io_uring *ring, int off)
return 0;
}
static int submit_arm_poll(struct io_uring *ring, int off)
{
int ret;
ret = arm_poll(ring, off);
if (ret)
return ret;
ret = io_uring_submit(ring);
if (ret < 0)
return ret;
return ret == 1 ? 0 : -1;
}
static int reap_polls(struct io_uring *ring)
{
struct io_uring_cqe *cqe;
@@ -106,6 +120,18 @@ static int reap_polls(struct io_uring *ring)
off = cqe->user_data;
if (off == 0x12345678)
goto seen;
if (!(cqe->flags & IORING_CQE_F_MORE)) {
/* need to re-arm poll */
ret = submit_arm_poll(ring, off);
if (ret)
break;
if (cqe->res <= 0) {
/* retry this one */
i--;
goto seen;
}
}
ret = read(p[off].fd[0], &c, 1);
if (ret != 1) {
if (ret == -1 && errno == EAGAIN)