From 8bb603da821bcdcf7810fa007dfc1b327a6a39d2 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Thu, 4 Jan 2018 10:13:33 +0900 Subject: [PATCH] iscsi: Remove duplication of the variable for write completion to bdev This patch will follow the change 393212 by Daniel. For read command: - primary's scsi.bytes_completed is for read completion from bdev. - primary's scsi.data_transferred si for send completion to initiator. Two variables have its own meaning, respectively. However for write command: - both primary's scsi.bytes_completed and scsi.data_transferred are for write completion to bdev. Hence for write we should use only either one and it looks that bytes_completed will be appropriate. Change-Id: I991c00170ad3651fe926173657e8a49a9a38d02a Signed-off-by: Shuhei Matsumoto Reviewed-on: https://review.gerrithub.io/393582 Reviewed-by: Daniel Verkamp Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris --- lib/iscsi/iscsi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index bc51c4bcd1..4585229c94 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -2834,9 +2834,6 @@ spdk_iscsi_transfer_in(struct spdk_iscsi_conn *conn, } } - if (task != primary) { - primary->scsi.data_transferred += task->scsi.data_transferred; - } primary->datain_datasn = DataSN; if (sent_status) { @@ -3197,7 +3194,7 @@ void spdk_iscsi_task_response(struct spdk_iscsi_conn *conn, o_bit = u_bit = O_bit = U_bit = 0; bidi_residual_len = residual_len = 0; - data_len = primary->scsi.data_transferred; + data_len = primary->bytes_completed; if ((transfer_len != 0) && (task->scsi.status == SPDK_SCSI_STATUS_GOOD)) {