From: James Smart <[email protected]>
For some nvme command, when issued by the nvme core layer, there
is an internal buffer which can cause blk_rq_payload_bytes() to
return a non-zero value yet there is no actual/real command payload
and sg list. An example is the WRITE ZEROES command.
To address this, when making choices on whether to dma map an sgl,
use blk_rq_nr_phys_segments() instead of blk_rq_payload_bytes().
When there is a sgl, blk_rq_payload_bytes() will return the amount
of data to be transferred by the sgl.
Signed-off-by: Chaitanya Kulkarni <[email protected]>
Signed-off-by: James Smart <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
I guess we'll need it for all transport.
I saw that pci is covered, RDMA isn't.
RDMA patch is already in AFAIR...
Also IMO tcp should be fixed (didn't dive into it yet, just high level
check for blk_rq_payload_bytes).
tcp already looks into RQF_SPECIAL_PAYLOAD so the issue does not apply
to it.