public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@fb.com>
Cc: Dexuan Cui <decui@microsoft.com>,
	linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH 2/4] scsi: use blk_rq_payload_bytes
Date: Fri, 13 Jan 2017 12:43:24 +0100	[thread overview]
Message-ID: <2043a73a-c616-948a-6484-faefe13ef024@suse.de> (raw)
In-Reply-To: <1484306953-3194-3-git-send-email-hch@lst.de>

On 01/13/2017 12:29 PM, Christoph Hellwig wrote:
> Without that we'll pass a wrong payload size in cmd->sdb, which
> can lead to hangs with drivers that need the total transfer size.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reported-by: Chris Valean <v-chvale@microsoft.com>
> Reported-by: Dexuan Cui <decui@microsoft.com>
> Fixes: f9d03f96 ("block: improve handling of the magic discard payload")
> ---
>  drivers/scsi/scsi_lib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index c35b6de..ad4ff8f 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -1018,7 +1018,7 @@ static int scsi_init_sgtable(struct request *req, struct scsi_data_buffer *sdb)
>  	count = blk_rq_map_sg(req->q, req, sdb->table.sgl);
>  	BUG_ON(count > sdb->table.nents);
>  	sdb->table.nents = count;
> -	sdb->length = blk_rq_bytes(req);
> +	sdb->length = blk_rq_payload_bytes(req);
>  	return BLKPREP_OK;
>  }
>  
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

  reply	other threads:[~2017-01-13 11:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 11:29 fix data transfer size caculation for special payload requests Christoph Hellwig
2017-01-13 11:29 ` [PATCH 1/4] block: add blk_rq_payload_bytes Christoph Hellwig
2017-01-13 11:43   ` Hannes Reinecke
2017-01-13 21:52   ` Sagi Grimberg
2017-01-13 11:29 ` [PATCH 2/4] scsi: use blk_rq_payload_bytes Christoph Hellwig
2017-01-13 11:43   ` Hannes Reinecke [this message]
2017-01-13 21:52   ` Sagi Grimberg
2017-01-13 11:29 ` [PATCH 3/4] nvme: " Christoph Hellwig
2017-01-13 11:43   ` Hannes Reinecke
2017-01-13 21:54   ` Sagi Grimberg
2017-01-17 20:06   ` Sagi Grimberg
2017-01-18  9:09     ` Christoph Hellwig
2017-01-19  7:54       ` Sagi Grimberg
2017-01-13 11:29 ` [PATCH 4/4] sd: remove __data_len hack for WRITE SAME Christoph Hellwig
2017-01-13 11:44   ` Hannes Reinecke
2017-01-13 21:56   ` Sagi Grimberg
2017-01-13 22:17 ` fix data transfer size caculation for special payload requests Jens Axboe

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=2043a73a-c616-948a-6484-faefe13ef024@suse.de \
    --to=hare@suse.de \
    --cc=axboe@fb.com \
    --cc=decui@microsoft.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --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