Commit 777a71dd authored by Erez Zilber's avatar Erez Zilber Committed by Roland Dreier

IB/iser: fix a check of SG alignment for RDMA

dma mapping may include a "compaction" of the sg associated with scsi command.
Hence, the size of the maximal prefix of the SG which is aligned for rdma must be
compared against the length of the dma mapped sg (mem->dma_nents) and not against
the size of it before it was mapped (mem->size).
Signed-off-by: default avatarErez Zilber <erezz@voltaire.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 61a73c70
...@@ -378,7 +378,7 @@ int iser_reg_rdma_mem(struct iscsi_iser_cmd_task *iser_ctask, ...@@ -378,7 +378,7 @@ int iser_reg_rdma_mem(struct iscsi_iser_cmd_task *iser_ctask,
regd_buf = &iser_ctask->rdma_regd[cmd_dir]; regd_buf = &iser_ctask->rdma_regd[cmd_dir];
aligned_len = iser_data_buf_aligned_len(mem); aligned_len = iser_data_buf_aligned_len(mem);
if (aligned_len != mem->size) { if (aligned_len != mem->dma_nents) {
iser_err("rdma alignment violation %d/%d aligned\n", iser_err("rdma alignment violation %d/%d aligned\n",
aligned_len, mem->size); aligned_len, mem->size);
iser_data_buf_dump(mem); iser_data_buf_dump(mem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment