diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-07-07 20:24:24 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-07-07 20:49:32 +0200 |
commit | c32aace0cf93383fde48c60ce0ae0c9073b6d360 (patch) | |
tree | 6b4390df735c05c08c72a0b2b07f36d15385a472 /fs/io_uring.c | |
parent | io_uring: fix exiting io_req_task_work_add leaks (diff) | |
download | linux-c32aace0cf93383fde48c60ce0ae0c9073b6d360.tar.xz linux-c32aace0cf93383fde48c60ce0ae0c9073b6d360.zip |
io_uring: fix drain alloc fail return code
After a recent change io_drain_req() started to fail requests with
result=0 in case of allocation failure, where it should be and have
been -ENOMEM.
Fixes: 76cc33d79175a ("io_uring: refactor io_req_defer()")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/e068110ac4293e0c56cfc4d280d0f22b9303ec08.1625682153.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 881856088990..8f2a66903f5a 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -6019,7 +6019,7 @@ static bool io_drain_req(struct io_kiocb *req) io_prep_async_link(req); de = kmalloc(sizeof(*de), GFP_KERNEL); if (!de) { - io_req_complete_failed(req, ret); + io_req_complete_failed(req, -ENOMEM); return true; } |