Merge pull request #342 from heroin-moose/fix-iscsi-cmdsn-tests

test-tool: Fix CmdSN tests
This commit is contained in:
Bart Van Assche
2020-09-03 17:14:06 -07:00
committed by GitHub
2 changed files with 10 additions and 6 deletions

View File

@@ -35,10 +35,12 @@ static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu
* iscsi_pdu_set_cmdsn(), which also changes pdu->cmdsn? * iscsi_pdu_set_cmdsn(), which also changes pdu->cmdsn?
*/ */
scsi_set_uint32(&pdu->outdata.data[24], iscsi->maxcmdsn + 1); scsi_set_uint32(&pdu->outdata.data[24], iscsi->maxcmdsn + 1);
/* fudge the cmdsn value back to where it should be if this /*
* pdu is ignored. * Fudge the cmdsn value back to where it should be if this pdu
* is ignored. The cmdsn value will be incremented by the
* orig_queue_pdu(), so it's off by one.
*/ */
iscsi->cmdsn = iscsi->expcmdsn; iscsi->cmdsn = iscsi->expcmdsn - 1;
break; break;
} }

View File

@@ -35,10 +35,12 @@ static int my_iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu
* iscsi_pdu_set_cmdsn(), which also changes pdu->cmdsn? * iscsi_pdu_set_cmdsn(), which also changes pdu->cmdsn?
*/ */
scsi_set_uint32(&pdu->outdata.data[24], iscsi->expcmdsn - 1); scsi_set_uint32(&pdu->outdata.data[24], iscsi->expcmdsn - 1);
/* fudge the cmdsn value back to where it should be if this /*
* pdu is ignored. * Fudge the cmdsn value back to where it should be if this pdu
* is ignored. The cmdsn value will be incremented by the
* orig_queue_pdu(), so it's off by one.
*/ */
iscsi->cmdsn = iscsi->expcmdsn; iscsi->cmdsn = iscsi->expcmdsn - 1;
break; break;
} }