Skip to content

Commit

Permalink
[SCSI] set resid in scsi_io_completion() even for check condition
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pete Wyckoff authored and James Bottomley committed Mar 20, 2007
1 parent a52deca commit b22f687
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down

0 comments on commit b22f687

Please sign in to comment.