io_uring: fix io_drain_req()
PATCH 1/1 io_uring: fix io_drain_req()
io_drain_req() return whether the request has been consumed or not, not an error code. Fix a stupid mistake slipped from optimisation patches.
Reported-by [email protected]
Fixes 76cc33d79175a ("io_uring: refactor io_req_defer()")
Signed-off-by Pavel Begunkov <[email protected]>
--- fs/io_uring.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/io_uring.c +4 -2
@@ -6019,11 +6019,13 @@ static bool io_drain_req(struct io_kiocb *req) ret =io_req_prep_async (req);if (ret) -return ret; + goto fail;io_prep_async_link (req); de =kmalloc (sizeof (*de),GFP_KERNEL );if (!de) { -io_req_complete_failed (req, -ENOMEM ); + ret = -ENOMEM ; +fail: +io_req_complete_failed (req, ret);return true; }
Signature · 1 line
2.32.0
Jens Axboe
maintainerQuoted 2 lines · Pavel Begunkov
io_drain_req()return whether the request has been consumed or not, not an error code. Fix a stupid mistake slipped from optimisation patches.
Good catch, thanks for fixing this up. Applied.
Signature · 1 line
Jens Axboe