summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorKanchan Joshi <joshi.k@samsung.com>2022-08-23 18:10:22 +0300
committerJens Axboe <axboe@kernel.dk>2022-08-23 18:46:17 +0300
commita9c3eda7eada94e8cf29cb102aa80e1370d8fa2e (patch)
treed515190000581228e2a9b311f3ab379b2f732966 /io_uring
parent47abea041f897d64dbd5777f0cf7745148f85d75 (diff)
downloadlinux-a9c3eda7eada94e8cf29cb102aa80e1370d8fa2e.tar.xz
io_uring: fix submission-failure handling for uring-cmd
If ->uring_cmd returned an error value different from -EAGAIN or -EIOCBQUEUED, it gets overridden with IOU_OK. This invites trouble as caller (io_uring core code) handles IOU_OK differently than other error codes. Fix this by returning the actual error code. Signed-off-by: Kanchan Joshi <joshi.k@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/uring_cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c
index 8e0cc2d9205e..b9989ae7b957 100644
--- a/io_uring/uring_cmd.c
+++ b/io_uring/uring_cmd.c
@@ -112,7 +112,7 @@ int io_uring_cmd(struct io_kiocb *req, unsigned int issue_flags)
if (ret < 0)
req_set_fail(req);
io_req_set_res(req, ret, 0);
- return IOU_OK;
+ return ret;
}
return IOU_ISSUE_SKIP_COMPLETE;