All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] return valid data with sense
@ 2007-03-13 20:53 Pete Wyckoff
  0 siblings, 0 replies; only message in thread
From: Pete Wyckoff @ 2007-03-13 20:53 UTC (permalink / raw)
  To: James E.J. Bottomley; +Cc: linux-scsi

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>
---
 drivers/scsi/scsi_lib.c |    4 ++--
 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;
 	}
 
 	/*
-- 
1.5.0.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-13 20:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-13 20:53 [PATCH] return valid data with sense Pete Wyckoff

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.