summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorPete Wyckoff <pw@osc.edu>2007-03-13 20:53:28 (GMT)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-03-20 15:53:51 (GMT)
commitb22f687dd28a7a8886b918294b4d558ef175c07d (patch)
treefe3fd16b98cb51bc5eb383d8c57b1ac4d2557032 /drivers/scsi/scsi_lib.c
parenta52decafbe3fdca5e8430d4f58ffcec1f4a6302c (diff)
downloadlinux-fsl-qoriq-b22f687dd28a7a8886b918294b4d558ef175c07d.tar.xz
[SCSI] set resid in scsi_io_completion() even for check condition
Some targets can return both valid data and sense information. Always update the request data_len from the SCSI command residual. Callers should interpret sense data to determine what parts of the data are valid in case of a CHECK CONDITION status. Signed-off-by: Pete Wyckoff <pw@osc.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 5f95570..be8e655 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -848,8 +848,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
memcpy(req->sense, cmd->sense_buffer, len);
req->sense_len = len;
}
- } else
- req->data_len = cmd->resid;
+ }
+ req->data_len = cmd->resid;
}
/*