From: Johannes Thumshirn <jthumshirn@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [bug report] scsi: sg: fix SG_DXFER_FROM_DEV transfers
Date: Fri, 14 Jul 2017 11:01:11 +0200 [thread overview]
Message-ID: <20170714090111.GA8497@linux-x5ow.site> (raw)
In-Reply-To: <20170714074603.7mi6jshrz6zfru4b@mwanda>
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@suse.de +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
next prev parent reply other threads:[~2017-07-14 9:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-14 7:46 [bug report] scsi: sg: fix SG_DXFER_FROM_DEV transfers Dan Carpenter
2017-07-14 9:01 ` Johannes Thumshirn [this message]
2017-07-14 9:16 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170714090111.GA8497@linux-x5ow.site \
--to=jthumshirn@suse.de \
--cc=dan.carpenter@oracle.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox