Skip to content

Commit

Permalink
io_uring: fix submission-failure handling for uring-cmd
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kanchan Joshi authored and Jens Axboe committed Aug 23, 2022
1 parent 47abea0 commit a9c3eda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion io_uring/uring_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a9c3eda

Please sign in to comment.