Re: [bug report] scsi: sg: fix SG_DXFER_FROM_DEV transfers

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

 



On Fri, Jul 14, 2017 at 10:46:03AM +0300, Dan Carpenter wrote:
>    761          case SG_DXFER_FROM_DEV:
>    762                  if (hp->dxfer_len < 0)
>                             ^^^^^^^^^^^^^^^^^
> Not possible.

Yup and thanks to:
647         else
648                 hp->dxfer_direction = (mxsize > 0) ? SG_DXFER_FROM_DEV : SG_DXFER_NONE;
649         hp->dxfer_len = mxsize;

I should've noticed that earlier.
Care to send a patch or want me to do?

> 
> Btw, I was looking up the type of hp->dxfer_len and I noticed that the
> documentation for hp->resid is wrong.  It says:
> 
> 	int resid;                  /* [o] dxfer_len - actual_transferred */
> 
> My guess is that resid stands for Response ID but I'm not positive.

Nope, it's the residual length. It's set by scsi_req::resid_len

-- 
Johannes Thumshirn                                          Storage
jthumshirn@xxxxxxx                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850



[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