Skip to contentSkip to conversation

return valid data with sense

PATCH New Pete Wyckoff 1 participant 1 message Mar 13, 2007 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 return valid data with sense

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.

---
 drivers/scsi/scsi_lib.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/scsi_lib.c +2 -2
index 5f95570..be8e655 100644
@@ -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;
 	}
 
 	/*
Signature · 1 line
1.5.0.2