aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-02-22 10:24:09 -0500
committerKeith Busch <keith.busch@intel.com>2018-02-22 03:45:32 -0500
commit0d30992395b1ed0e006960de1651b44cd51be791 (patch)
tree1b91a15093945138669b37c473f14cf4dde0d533
parent5a1e59533380a3fd04593e4ab2d4633ebf7745c1 (diff)
nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes
blk_rq_bytes does the wrong thing for special payloads like discards and might cause the driver to not set up a SGL. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Keith Busch <keith.busch@intel.com>
-rw-r--r--drivers/nvme/host/rdma.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 2bc059f7d73c..acc9eb21c242 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1051,7 +1051,7 @@ static void nvme_rdma_unmap_data(struct nvme_rdma_queue *queue,
1051 struct nvme_rdma_device *dev = queue->device; 1051 struct nvme_rdma_device *dev = queue->device;
1052 struct ib_device *ibdev = dev->dev; 1052 struct ib_device *ibdev = dev->dev;
1053 1053
1054 if (!blk_rq_bytes(rq)) 1054 if (!blk_rq_payload_bytes(rq))
1055 return; 1055 return;
1056 1056
1057 if (req->mr) { 1057 if (req->mr) {
@@ -1166,7 +1166,7 @@ static int nvme_rdma_map_data(struct nvme_rdma_queue *queue,
1166 1166
1167 c->common.flags |= NVME_CMD_SGL_METABUF; 1167 c->common.flags |= NVME_CMD_SGL_METABUF;
1168 1168
1169 if (!blk_rq_bytes(rq)) 1169 if (!blk_rq_payload_bytes(rq))
1170 return nvme_rdma_set_sg_null(c); 1170 return nvme_rdma_set_sg_null(c);
1171 1171
1172 req->sg_table.sgl = req->first_sgl; 1172 req->sg_table.sgl = req->first_sgl;