From 96e930fc13cb02feca3ac5da96c7415bcc1bfe29 Mon Sep 17 00:00:00 2001 From: Cunyin Chang Date: Thu, 11 Jan 2018 15:34:34 +0800 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/394321 Tested-by: SPDK Automated Test System Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/iscsi/iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index c58693260..07e4400ca 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -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);