Subject: [PATCH 1578/2944] io_uring: don't fail links for EAGAIN error in IOPOLL mode

From: Xiaoguang Wang <[email-masked]>
Date: Sun, 28 Jun 2020 20:47:07 +0800

to #28736503

commit 2d7d67920e5c8e0854df23ca77da2dd5880ce5dd upstream

In IOPOLL mode, for EAGAIN error, we'll try to submit io request
again using io-wq, so don't fail rest of links if this io request
has links.

Cc: [email-masked]
Signed-off-by: Xiaoguang Wang <[email-masked]>
Signed-off-by: Jens Axboe <[email-masked]>
Acked-by: Joseph Qi <[email-masked]>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 45461d3..1463d4f 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1980,7 +1980,7 @@ static void io_complete_rw_iopoll(struct kiocb *kiocb, long res, long res2)
 	if (kiocb->ki_flags & IOCB_WRITE)
 		kiocb_end_write(req);
 
-	if (res != req->result)
+	if (res != -EAGAIN && res != req->result)
 		req_set_fail_links(req);
 	req->result = res;
 	if (res != -EAGAIN)
-- 
1.8.3.1