* [PATCH] fix leftover bytes calculation
@ 2004-03-11 23:54 Mike Christie
2004-03-12 0:01 ` Mike Christie
0 siblings, 1 reply; 2+ messages in thread
From: Mike Christie @ 2004-03-11 23:54 UTC (permalink / raw)
To: SCSI Mailing List
[-- Attachment #1: Type: text/plain, Size: 792 bytes --]
If there are leftovers __end_that_request_first will call
blk_recalc_rq_sector to set req->hard_nr_sectors correctly.
For failfast, by subtracting bytes from the updated
req->hard_nr_sectors and then calling end_that_request_chunk
and end_that_request_last, you can end up with a bio that
never gets completed.
The attached patch built against 2.6.4 does not subtract
bytes for non-blk_pc_requests.
On a related note I was wondering if the following is a
bug or feature. At the bottom of scsi_io_completion, it calls
scsi_end_request on the bytes for the current buffer.
The comments indicate this is to handle improperly reported
medium errors, but commands scsi_decide_disposition
determined should not be retried end up getting
requeued minus the current buffer.
Thanks
Mike Christie
[-- Attachment #2: calc-leftover.patch --]
[-- Type: text/plain, Size: 488 bytes --]
--- linux-2.6.4-work/drivers/scsi/scsi_lib.c 2004-03-10 18:55:27.000000000 -0800
+++ linux-2.6.4-scsi/drivers/scsi/scsi_lib.c 2004-03-11 15:25:11.722261524 -0800
@@ -504,7 +504,7 @@ static struct scsi_cmnd *scsi_end_reques
* to queue the remainder of them.
*/
if (end_that_request_chunk(req, uptodate, bytes)) {
- int leftover = (req->hard_nr_sectors << 9) - bytes;
+ int leftover = req->hard_nr_sectors << 9;
if (blk_pc_request(req))
leftover = req->data_len - bytes;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fix leftover bytes calculation
2004-03-11 23:54 [PATCH] fix leftover bytes calculation Mike Christie
@ 2004-03-12 0:01 ` Mike Christie
0 siblings, 0 replies; 2+ messages in thread
From: Mike Christie @ 2004-03-12 0:01 UTC (permalink / raw)
To: SCSI Mailing List
> On a related note I was wondering if the following is a
> bug or feature. At the bottom of scsi_io_completion, it calls
> scsi_end_request on the bytes for the current buffer.
> The comments indicate this is to handle improperly reported
> medium errors, but commands scsi_decide_disposition
> determined should not be retried end up getting
> requeued minus the current buffer.
Oh wait, forget that. I wasn't sure if those medium errors
described in the comments were incorrectly reported as any old
error or if there was some way to narrow it down.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-03-12 0:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-11 23:54 [PATCH] fix leftover bytes calculation Mike Christie
2004-03-12 0:01 ` Mike Christie
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.