@@ -309,7 +309,7 @@ static inline void set_driver_byte(struct scsi_cmnd
*cmd, char status)
static inline unsigned scsi_transfer_length(struct scsi_cmnd *scmd)
{
- unsigned int xfer_len = blk_rq_bytes(scmd->request);
+ unsigned int xfer_len = scsi_bufflen(scmd);
unsigned int prot_op = scsi_get_prot_op(scmd);
unsigned int sector_size = scmd->device->sector_size;
Moreover, since bidi and dif are adjacent, this will also needed:
@@ -386,12 +386,14 @@ static int iscsi_prep_scsi_cmd_pdu(struct
iscsi_task *task)
rc = iscsi_prep_bidi_ahs(task);
if (rc)
return rc;
+ transfer_length = scsi_in(sc)->length;
+ } else {
+ transfer_length = scsi_transfer_length(sc);
}
if (scsi_get_prot_op(sc) != SCSI_PROT_NORMAL)
task->protected = true;
- transfer_length = scsi_transfer_length(sc);
hdr->data_length = cpu_to_be32(transfer_length);
if (sc->sc_data_direction == DMA_TO_DEVICE) {