[PATCH] scsi_debug: set resid to indicate no data-in when medium error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As discussed in a thread on this list titled:
   "RFC: short reads on block devices"
this patch provides additional information associated
with a medium error. And that is that the data-in buffer
contains no valid data.

This patch is against lk 2.6.36

Changelog:
   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@xxxxxxxxxxxx>
--- linux/drivers/scsi/scsi_debug.c	2010-12-03 17:17:54.000000000 -0500
+++ linux/drivers/scsi/scsi_debug.c2636resid1	2010-12-16 00:48:25.000000000 -0500
@@ -1790,6 +1790,7 @@ static int resp_read(struct scsi_cmnd *S
 			devip->sense_buff[5] = (ret >> 8) & 0xff;
 			devip->sense_buff[6] = ret & 0xff;
 		}
+	        scsi_set_resid(SCpnt, scsi_bufflen(SCpnt));
 		return check_condition_result;
 	}
 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux