We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c8e11b commit dad1b12Copy full SHA for dad1b12
fs/io_uring.c
@@ -6341,8 +6341,19 @@ static struct io_wq_work *io_wq_submit_work(struct io_wq_work *work)
6341
}
6342
6343
if (ret) {
6344
- req_set_fail_links(req);
6345
- io_req_complete(req, ret);
+ /*
+ * io_iopoll_complete() does not hold completion_lock to complete
6346
+ * polled io, so here for polled io, just mark it done and still let
6347
+ * io_iopoll_complete() complete it.
6348
+ */
6349
+ if (req->ctx->flags & IORING_SETUP_IOPOLL) {
6350
+ struct kiocb *kiocb = &req->rw.kiocb;
6351
+
6352
+ kiocb_done(kiocb, ret, NULL);
6353
+ } else {
6354
+ req_set_fail_links(req);
6355
+ io_req_complete(req, ret);
6356
+ }
6357
6358
6359
return io_steal_work(req);
0 commit comments