[PATCH v1 0/1] nvme-tcp: fix wrong status on deferred digest error

Xixin Liu liuxixin at kylinos.cn
Wed Aug 26 19:40:00 PDT 2026


Hi Hannes,

Thanks for the review. This is not a wire to host conversion. req->status
already mixes wire and host values. Digest error stores a host SC. u16
makes the host SC explicit. __le16 is endian packaging for wire layout.
The SUCCESS rsp branch overwrites with cqe->status, which is wire. A host
SC must be shifted left before nvme_try_complete_req.

Without DATA_SUCCESS, digest error is deferred to the rsp path:

	req->status = cpu_to_le16(NVME_SC_DATA_XFER_ERROR);   /* host SC */

	if (req->status == cpu_to_le16(NVME_SC_SUCCESS))
		req->status = cqe->status;   /* wire */
	if (!nvme_try_complete_req(rq, req->status, cqe->result))

Both branches pass req->status into nvme_try_complete_req, which expects
wire:

	nvme_req(req)->status = le16_to_cpu(status) >> 1;

SUCCESS is fine. Non-SUCCESS still holds host SC 04h Data Transfer Error,
so 0x4 becomes INVALID_FIELD, 0x2.

v1 changed req->status to u16. v2 keeps __le16 as you suggested. Please
take a look at both and say which you prefer for merge. I will send v2
shortly.

Thanks,
Xixin Liu




More information about the Linux-nvme mailing list