Skip to content

Commit

Permalink
[SCSI] scsi_debug: set resid to indicate no data-in when medium error
Browse files Browse the repository at this point in the history
set resid to the requested data-in length when a MEDIUM ERROR is
simulated. This implies no valid data is returned in the data-in
buffer

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Douglas Gilbert authored and James Bottomley committed Dec 23, 2010
1 parent a8733c7 commit a87e3a6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/scsi/scsi_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1805,6 +1805,7 @@ static int resp_read(struct scsi_cmnd *SCpnt, unsigned long long lba,
devip->sense_buff[5] = (ret >> 8) & 0xff;
devip->sense_buff[6] = ret & 0xff;
}
scsi_set_resid(SCpnt, scsi_bufflen(SCpnt));
return check_condition_result;
}

Expand Down

0 comments on commit a87e3a6

Please sign in to comment.