Commit 12265709ac6e197f4d40d9ec1fd3af97b4196a35

Authored by Alan Stern
Committed by James Bottomley
1 parent af55ff675a

[SCSI] scsi_eh_prep_cmnd should save scmd->underflow

This patch (as1116) fixes a bug in scsi_eh_prep_cmnd() and
scsi_eh_restore_cmnd().  These routines are supposed to save any
values they change and restore them later, but someone forgot to
save & restore scmd->underflow.

This fixes part of the problem reported in Bugzilla #9638.

[jejb: fix up rejections around DIF/DIX]
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

Showing 2 changed files with 3 additions and 0 deletions Side-by-side Diff

drivers/scsi/scsi_error.c
... ... @@ -667,6 +667,7 @@
667 667 ses->sdb = scmd->sdb;
668 668 ses->next_rq = scmd->request->next_rq;
669 669 ses->result = scmd->result;
  670 + ses->underflow = scmd->underflow;
670 671 ses->prot_op = scmd->prot_op;
671 672  
672 673 scmd->prot_op = SCSI_PROT_NORMAL;
... ... @@ -727,6 +728,7 @@
727 728 scmd->sdb = ses->sdb;
728 729 scmd->request->next_rq = ses->next_rq;
729 730 scmd->result = ses->result;
  731 + scmd->underflow = ses->underflow;
730 732 scmd->prot_op = ses->prot_op;
731 733 }
732 734 EXPORT_SYMBOL(scsi_eh_restore_cmnd);
include/scsi/scsi_eh.h
... ... @@ -74,6 +74,7 @@
74 74 /* saved state */
75 75 int result;
76 76 enum dma_data_direction data_direction;
  77 + unsigned underflow;
77 78 unsigned char cmd_len;
78 79 unsigned char prot_op;
79 80 unsigned char *cmnd;