Re: [PATCH] ps3rom: fix wrong resid calculation bug

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

 



On Sun, 24 Feb 2008, FUJITA Tomonori wrote:
> sg driver rounds up the length in struct scatterlist to be a multiple
> of 512 in some conditions. So LLDs can't use the data length in a sg
> list to calculate residual. Instead, the length in struct scsi_cmnd
> should be used.

Thanks!

> --- a/drivers/scsi/ps3rom.c
> +++ b/drivers/scsi/ps3rom.c
> @@ -124,7 +124,7 @@ static int fill_from_dev_buffer(struct scsi_cmnd *cmd, const void *buf)
>  		}
>  		req_len += sgpnt->length;
>  	}
> -	scsi_set_resid(cmd, req_len - act_len);
> +	scsi_set_resid(cmd, scsi_bufflen(cmd) - act_len);
>  	return 0;
>  }

My 2 comments:
  - The variable buflen already contains scsi_bufflen(cmd),
  - We no longer need to calculate the data length of the whole scatterlist.

I'll follow up to this email with a replacement patch and an addendum patch.

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@xxxxxxxxxxx
Internet: http://www.sony-europe.com/

Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619

[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