summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2010-12-18 01:16:06 +0100
committerJames Bottomley <James.Bottomley@suse.de>2010-12-23 06:26:49 +0100
commita87e3a67d57472f40da2218793ff6d25c4518498 (patch)
tree4d961347263e06ee018821aa4195d1db22e29c65 /drivers/scsi/scsi_debug.c
parent[SCSI] fix medium error problems with some arrays which can cause data corrup... (diff)
downloadlinux-a87e3a67d57472f40da2218793ff6d25c4518498.tar.xz
linux-a87e3a67d57472f40da2218793ff6d25c4518498.zip
[SCSI] scsi_debug: set resid to indicate no data-in when medium error
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>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 2f1f9b079b10..7b310934efed 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -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;
}