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;
}
next prev parent reply other threads:[~2017-01-12 18:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <MWHPR03MB26693D8327D27CA1CFDA50A8BF790@MWHPR03MB2669.namprd03.prod.outlook.com>
2017-01-12 13:44 ` [Regression] fstrim hangs on Hyper-V: caused by "block: improve handling of the magic discard payload" Christoph Hellwig
[not found] ` <MWHPR03MB26695378D0512A7C840A0A30BF790@MWHPR03MB2669.namprd03.prod.outlook.com>
2017-01-12 15:52 ` Christoph Hellwig
[not found] ` <MWHPR03MB26694FAE82E6D0FAEA02BE04BF790@MWHPR03MB2669.namprd03.prod.outlook.com>
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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).