io_uring: Fix the flip to negative of CQE status
authorMinwoo Im <minwoo.im@samsung.com>
Wed, 15 May 2024 05:36:40 +0000 (14:36 +0900)
committerMinwoo Im <minwoo.im@samsung.com>
Wed, 15 May 2024 05:36:40 +0000 (14:36 +0900)
commit78831c6b35c53f844748e79711b99218fb58f928
tree68c6f1969f4f7ce832613ebf76d9ea30d41ed14f
parent3ed8eea0ee9b5d7de603e9b128e6c05941b99938
io_uring: Fix the flip to negative of CQE status

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>
engines/io_uring.c