mirror of
https://github.com/openharmony/third_party_liburing.git
synced 2026-07-20 22:58:41 -04:00
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:
committed by
Jens Axboe
parent
712e75fc23
commit
2d0e8f6933
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user