iscsi: Fix the potential core dump issue for hotplug test case.

when test hotplug case with large write command which need r2t, after the
device hot removed, the outstanding r2t commands are waitting for data out PDU,
and the primary commands probably already return with error, then the lun
could be deleted, later the related data out PDU will received and try to send
other r2t, this patch make sure the r2t command sent smoothly even the device
hot removed.

Change-Id: I49061d1258e65cb0964526f755d870ebe7095920
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/394321
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Cunyin Chang 2018-01-11 15:34:34 +08:00 committed by Jim Harris
parent 9a723c1a48
commit 96e930fc13

View File

@ -4249,7 +4249,7 @@ spdk_iscsi_send_r2t(struct spdk_iscsi_conn *conn,
rsp_pdu->data = NULL;
rsph->opcode = ISCSI_OP_R2T;
rsph->flags |= 0x80; /* bit 0 is default to 1 */
to_be64(&rsph->lun, spdk_scsi_lun_get_id(task->scsi.lun));
to_be64(&rsph->lun, task->lun_id);
to_be32(&rsph->itt, task->tag);
to_be32(&rsph->ttt, transfer_tag);