Re: [PATCH] improvement of fastfail operation

Mike Christie
2004-04-01T07:53:48Z

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

Mike Christie wrote:
> On Wed, Mar 31 2004, Mike Christie wrote:
>
>> Jens Axboe wrote:
>> >On Wed, Mar 31 2004, James Bottomley wrote:
>> >
>> >>On Wed, 2004-03-31 at 17:04, Jens Axboe wrote:
>> >>
>> >>>So the new patch you sent with this mail is no good. Your previous one
>> >>>should be adopted ;-)
>> >>
>> >>And the:
>> >>
>> >>
>> >> if (blk_pc_request(req))
>> >> leftover = req->data_len - bytes;
>> >>
>> >>Since end_that_request chunk won't muck with that, is that OK?
>> >
>> >
>> >It's a bit messy right now really, but it's up to the drivers to modify
>> >that one. So for partial completions, it should be updated to be
>> >
>> > leftover = req->data_len;
>> >
>> >as well.
>> >
>>
>> Is that a typo? If drivers are to account for it, scsi should do
>> leftover = req->data_len - bytes;
>> ?
>
>
> No, scsi_io_completion() should already have done it.
>

Oops. Thanks.

James,

The attached patch fixes the leftover calculation for both
blk pc and blk fs requests per Jens's comments. It was
built against 2.6.5-rc3.

Thanks,

Mike

[-- Attachment #2: calc_leftovers.patch --]
[-- Type: text/plain, Size: 608 bytes --]

--- linux-2.6.5-rc3/drivers/scsi/scsi_lib.c 2004-03-29 19:26:15.000000000 -0800
+++ linux-2.6.5-rc3-work/drivers/scsi/scsi_lib.c 2004-03-31 23:23:20.051292415 -0800
@@ -524,10 +524,10 @@ 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;
+ leftover = req->data_len;

/* kill remainder if no retrys */
if (!uptodate && blk_noretry_request(req))