VERIFY10/12/16 If BYTCHK is false we dont need to transfer any blocks to the target

If BYTCHK is false the target will perform a medium check of the indicated
LBAs only and not compare with anything out of the DATA-OUT buffers.
As such we dont need to/should not transfer any DAT-OUT to the target.
This commit is contained in:
Ronnie Sahlberg
2012-11-18 09:44:38 -08:00
parent e661c22875
commit f9767e729a
2 changed files with 18 additions and 12 deletions

View File

@@ -1082,8 +1082,9 @@ iscsi_verify10_task(struct iscsi_context *iscsi, int lun, unsigned char *data,
return NULL;
}
outdata.data = data;
outdata.size = datalen;
/* We only transfer data if BYTCHK is true */
outdata.data = bytchk ? data : NULL;
outdata.size = bytchk ? datalen : 0;
if (iscsi_scsi_command_async(iscsi, lun, task, cb, &outdata,
private_data) != 0) {
@@ -1115,8 +1116,9 @@ iscsi_verify12_task(struct iscsi_context *iscsi, int lun, unsigned char *data,
return NULL;
}
outdata.data = data;
outdata.size = datalen;
/* We only transfer data if BYTCHK is true */
outdata.data = bytchk ? data : NULL;
outdata.size = bytchk ? datalen : 0;
if (iscsi_scsi_command_async(iscsi, lun, task, cb, &outdata,
private_data) != 0) {
@@ -1148,8 +1150,9 @@ iscsi_verify16_task(struct iscsi_context *iscsi, int lun, unsigned char *data,
return NULL;
}
outdata.data = data;
outdata.size = datalen;
/* We only transfer data if BYTCHK is true */
outdata.data = bytchk ? data : NULL;
outdata.size = bytchk ? datalen : 0;
if (iscsi_scsi_command_async(iscsi, lun, task, cb, &outdata,
private_data) != 0) {