Skip to content

Commit 96b1f96

Browse files
Mike ChristieJames Bottomley
authored andcommitted
[SCSI] libiscsi: regression: fix header digest errors
This fixes a regression introduced with this commit: commit d3305f3 Author: Mike Christie <michaelc@cs.wisc.edu> Date: Thu Aug 20 15:10:58 2009 -0500 [SCSI] libiscsi: don't increment cmdsn if cmd is not sent in 2.6.32. When I moved the hdr->cmdsn after init_task, I added a bug when header digests are used. The problem is that the LLD may calculate the header digest in init_task, so if we then set the cmdsn after the init_task call we change what the digest will be calculated by the target. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Cc: Stable Tree <stable@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
1 parent 70b25f8 commit 96b1f96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/libiscsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,12 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task)
471471

472472
WARN_ON(hdrlength >= 256);
473473
hdr->hlength = hdrlength & 0xFF;
474+
hdr->cmdsn = task->cmdsn = cpu_to_be32(session->cmdsn);
474475

475476
if (session->tt->init_task && session->tt->init_task(task))
476477
return -EIO;
477478

478479
task->state = ISCSI_TASK_RUNNING;
479-
hdr->cmdsn = task->cmdsn = cpu_to_be32(session->cmdsn);
480480
session->cmdsn++;
481481

482482
conn->scsicmd_pdus_cnt++;

0 commit comments

Comments
 (0)