On 8/6/2014 3:12 PM, Sagi Grimberg wrote:

<SNIP>
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index f2db82beb646..fdea8c1527d4 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -391,7 +391,7 @@ static int iscsi_prep_scsi_cmd_pdu(struct
iscsi_task *task)
      if (scsi_get_prot_op(sc) != SCSI_PROT_NORMAL)
          task->protected = true;

-    transfer_length = scsi_transfer_length(sc);
+    transfer_length = scsi_transfer_length(sc, scsi_out(sc));

If we go down this road we should return to the in_len/out_len
approach that was used before since taking scsi_out(sc) doesn't make
sense for READs (although it would work).


On second thought, since the transfer length is always the
command scsi data buffer length, why not keep it as is and
if at any point in the future DIF will co-exist with bidi,
we can add scsi_bidi_transfer_length which will calculate
the bidi in length.

In this case, an iSCSI bidi transaction will do:
hdr->data_length = scsi_transfer_legnth(sg);
rlen_ahdr->read_length = scsi_bidi_transfer_length(sc);



Sagi.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to