public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH 1/1] io_uring: fix drain alloc fail return code
@ 2021-07-07 18:24 Pavel Begunkov
  2021-07-07 18:54 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2021-07-07 18:24 UTC (permalink / raw)
  To: Jens Axboe, io-uring

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 <[email protected]>
---
 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 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;
 	}
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] io_uring: fix drain alloc fail return code
  2021-07-07 18:24 [PATCH 1/1] io_uring: fix drain alloc fail return code Pavel Begunkov
@ 2021-07-07 18:54 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-07-07 18:54 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring

On 7/7/21 12:24 PM, Pavel Begunkov wrote:
> 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.

Oops - good catch, applied.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-07 18:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-07 18:24 [PATCH 1/1] io_uring: fix drain alloc fail return code Pavel Begunkov
2021-07-07 18:54 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox