All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Dexuan Cui <decui@microsoft.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	KY Srinivasan <kys@microsoft.com>,
	"Chris Valean (Cloudbase Solutions SRL)" <v-chvale@microsoft.com>
Subject: Re: [Regression] fstrim hangs on Hyper-V: caused by "block: improve handling of the magic discard payload"
Date: Thu, 12 Jan 2017 19:18:34 +0100	[thread overview]
Message-ID: <20170112181834.GA8808@lst.de> (raw)
In-Reply-To: <MWHPR03MB26694FAE82E6D0FAEA02BE04BF790@MWHPR03MB2669.namprd03.prod.outlook.com>

Next try:  (I've also dropped most of the Cc list)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index c35b6de..2f358f7 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1018,7 +1018,10 @@ 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);
+	if (req->rq_flags & RQF_SPECIAL_PAYLOAD)
+		sdb->length = req->special_vec.bv_len;
+	else
+		sdb->length = blk_rq_bytes(req);
 	return BLKPREP_OK;
 }


  reply	other threads:[~2017-01-12 18:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12 10:55 [Regression] fstrim hangs on Hyper-V: caused by "block: improve handling of the magic discard payload" Dexuan Cui
2017-01-12 13:44 ` Christoph Hellwig
2017-01-12 15:39   ` Dexuan Cui
2017-01-12 15:52     ` Christoph Hellwig
2017-01-12 16:39       ` Dexuan Cui
2017-01-12 18:18         ` Christoph Hellwig [this message]
     [not found]           ` <MWHPR03MB2669B1BD87F79243F17ADB23BF780@MWHPR03MB2669.namprd03.prod.outlook.com>
2017-01-13  7:39             ` Christoph Hellwig

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=20170112181834.GA8808@lst.de \
    --to=hch@lst.de \
    --cc=decui@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-block@vger.kernel.org \
    --cc=v-chvale@microsoft.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.