From: Jens Axboe axboe@kernel.dk
mainline inclusion from mainline-v5.10-rc5 commit c993df5a688975bf9ce899706ca13d2bc8d6be25 category: bugfix bugzilla: 186136, https://gitee.com/openeuler/kernel/issues/I4RM1D CVE: NA
-------------------------------------------------
Zorro reports that an xfstest test case is failing, and it turns out that for the reissue path we can potentially issue a double completion on the request for the failure path. There's an issue around the retry as well, but for now, at least just make sure that we handle the error path correctly.
Cc: stable@vger.kernel.org Fixes: b63534c41e20 ("io_uring: re-issue block requests that failed because of resources") Reported-by: Zorro Lang zlang@redhat.com Signed-off-by: Jens Axboe axboe@kernel.dk conflict: fs/io_uring.c Change based on e1e16097e265 ("io_uring: provide generic io_req_complete() helper") Signed-off-by: Laibin Qiu qiulaibin@huawei.com Reviewed-by: Zhang Yi yi.zhang@huawei.com --- fs/io_uring.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c index 4e552dfe1c64..bdcac452b174 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2408,9 +2408,7 @@ static bool io_resubmit_prep(struct io_kiocb *req, int error) return true; kfree(iovec); end_req: - io_cqring_add_event(req, ret, 0); req_set_fail_links(req); - io_put_req(req); return false; }