Skip to content

Commit 490e896

Browse files
committed
io_uring: only force async punt if poll based retry can't handle it
We do blocking retry from our poll handler, if the file supports polled notifications. Only mark the request as needing an async worker if we can't poll for it. Signed-off-by: Jens Axboe <[email protected]>
1 parent af197f5 commit 490e896

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/io_uring.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2604,7 +2604,8 @@ static int io_read(struct io_kiocb *req, bool force_nonblock)
26042604
if (ret)
26052605
goto out_free;
26062606
/* any defer here is final, must blocking retry */
2607-
if (!(req->flags & REQ_F_NOWAIT))
2607+
if (!(req->flags & REQ_F_NOWAIT) &&
2608+
!file_can_poll(req->file))
26082609
req->flags |= REQ_F_MUST_PUNT;
26092610
return -EAGAIN;
26102611
}
@@ -2726,7 +2727,8 @@ static int io_write(struct io_kiocb *req, bool force_nonblock)
27262727
if (ret)
27272728
goto out_free;
27282729
/* any defer here is final, must blocking retry */
2729-
req->flags |= REQ_F_MUST_PUNT;
2730+
if (!file_can_poll(req->file))
2731+
req->flags |= REQ_F_MUST_PUNT;
27302732
return -EAGAIN;
27312733
}
27322734
}

0 commit comments

Comments
 (0)