summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-12-01 19:18:30 +0100
committerDoug Ledford <dledford@redhat.com>2015-12-07 23:20:11 +0100
commitfc925518aa04ee9f03c4e0cadd9c59f1ef48bcfa (patch)
tree57f2c0d0987fb4012a9c7e6de5ebf47e230ee4c3 /drivers/infiniband/ulp/srp
parentIB/srp: Fix possible send queue overflow (diff)
downloadlinux-fc925518aa04ee9f03c4e0cadd9c59f1ef48bcfa.tar.xz
linux-fc925518aa04ee9f03c4e0cadd9c59f1ef48bcfa.zip
IB/srp: Initialize dma_length in srp_map_idb
Without this sg_dma_len will return 0 on architectures tha have the dma_length field. Fixes: commit f7f7aab1a5c0 ("IB/srp: Convert to new registration API") Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/ulp/srp')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index c7a95d2dc164..72fac204d756 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1524,6 +1524,9 @@ static int srp_map_idb(struct srp_rdma_ch *ch, struct srp_request *req,
state.sg_nents = 1;
sg_set_buf(idb_sg, req->indirect_desc, idb_len);
idb_sg->dma_address = req->indirect_dma_addr; /* hack! */
+#ifdef CONFIG_NEED_SG_DMA_LENGTH
+ idb_sg->dma_length = idb_sg->length; /* hack^2 */
+#endif
ret = srp_map_finish_fr(&state, ch);
if (ret < 0)
return ret;