Skip to content

Commit

Permalink
io_uring: Fix the flip to negative of CQE status
Browse files Browse the repository at this point in the history
Since cqe->res is expected to be a negative value of errno, it's been
flipped to a positive value before passing it to io_u.c.  However, in
case of io_uring_cmd with cmd_type=nvme, cqe->res might represent a NVMe
completion status type and code along with control fields such as DNR
since nvme_uring_cmd_end_io() in the NVMe driver sets the completion
status value and passes it up to io_uring.

For example, If a DULBE(Deallocated or Unwritten Logical Block Error)
is coming up from the device, cqe->res here would be 0x4287 which is a
DULBE error code of media error type.

This patch unified the error code to a positive value regardless of the
error type.

Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
  • Loading branch information
minwooim committed May 15, 2024
1 parent 3ed8eea commit 78831c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engines/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ static struct io_u *fio_ioring_cmd_event(struct thread_data *td, int event)
io_u = (struct io_u *) (uintptr_t) cqe->user_data;

if (cqe->res != 0) {
io_u->error = -cqe->res;
io_u->error = abs(cqe->res);
return io_u;
} else {
io_u->error = 0;
Expand Down

0 comments on commit 78831c6

Please sign in to comment.