All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi_debug: set resid to indicate no data-in when medium error
@ 2010-12-18  0:16 Douglas Gilbert
  0 siblings, 0 replies; only message in thread
From: Douglas Gilbert @ 2010-12-18  0:16 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Bottomley, Martin K. Petersen

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

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@interlog.com>

[-- Attachment #2: sdebug2636resid1.diff --]
[-- Type: text/x-patch, Size: 401 bytes --]

--- 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;
 	}
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-18  0:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-18  0:16 [PATCH] scsi_debug: set resid to indicate no data-in when medium error Douglas Gilbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.