* Re: [Regression] fstrim hangs on Hyper-V: caused by "block: improve handling of the magic discard payload"
[not found] <MWHPR03MB26693D8327D27CA1CFDA50A8BF790@MWHPR03MB2669.namprd03.prod.outlook.com>
@ 2017-01-12 13:44 ` Christoph Hellwig
[not found] ` <MWHPR03MB26695378D0512A7C840A0A30BF790@MWHPR03MB2669.namprd03.prod.outlook.com>
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2017-01-12 13:44 UTC (permalink / raw)
To: Dexuan Cui
Cc: Christoph Hellwig, linux-block@vger.kernel.org, Jens Axboe,
Vitaly Kuznetsov, linux-kernel@vger.kernel.org, KY Srinivasan,
Chris Valean (Cloudbase Solutions SRL)
Hi Dexuan,
sorry for dropping the ball on the previous private report, I hoped
I could get my hands on a Hyper-V VM and reproduce it myself, but
that has obviously not happened.
Can you send me the output of the provisioning_mode file for the
scsi disk in question to get started?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Regression] fstrim hangs on Hyper-V: caused by "block: improve handling of the magic discard payload"
[not found] ` <MWHPR03MB26695378D0512A7C840A0A30BF790@MWHPR03MB2669.namprd03.prod.outlook.com>
@ 2017-01-12 15:52 ` Christoph Hellwig
[not found] ` <MWHPR03MB26694FAE82E6D0FAEA02BE04BF790@MWHPR03MB2669.namprd03.prod.outlook.com>
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2017-01-12 15:52 UTC (permalink / raw)
To: Dexuan Cui
Cc: Christoph Hellwig, linux-block@vger.kernel.org, Jens Axboe,
Vitaly Kuznetsov, linux-kernel@vger.kernel.org, KY Srinivasan,
Chris Valean (Cloudbase Solutions SRL)
Can you check if this debug printk triggers for the discard commands?
---
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 888e16e..7ab7d08 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1031,6 +1031,10 @@ static void storvsc_command_completion(struct storvsc_cmd_request *cmd_request,
data_transfer_length = 0;
}
+ if (cmd_request->payload->range.len != data_transfer_length)
+ printk_ratelimited("request len: %u, transfer len: %u\n",
+ cmd_request->payload->range.len,
+ data_transfer_length);
scsi_set_resid(scmnd,
cmd_request->payload->range.len - data_transfer_length);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Regression] fstrim hangs on Hyper-V: caused by "block: improve handling of the magic discard payload"
[not found] ` <MWHPR03MB26694FAE82E6D0FAEA02BE04BF790@MWHPR03MB2669.namprd03.prod.outlook.com>
@ 2017-01-12 18:18 ` Christoph Hellwig
[not found] ` <MWHPR03MB2669B1BD87F79243F17ADB23BF780@MWHPR03MB2669.namprd03.prod.outlook.com>
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2017-01-12 18:18 UTC (permalink / raw)
To: Dexuan Cui
Cc: linux-block@vger.kernel.org, KY Srinivasan,
Chris Valean (Cloudbase Solutions SRL)
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;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Regression] fstrim hangs on Hyper-V: caused by "block: improve handling of the magic discard payload"
[not found] ` <MWHPR03MB2669B1BD87F79243F17ADB23BF780@MWHPR03MB2669.namprd03.prod.outlook.com>
@ 2017-01-13 7:39 ` Christoph Hellwig
0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2017-01-13 7:39 UTC (permalink / raw)
To: Dexuan Cui
Cc: Christoph Hellwig, linux-block@vger.kernel.org, KY Srinivasan,
Chris Valean (Cloudbase Solutions SRL)
On Fri, Jan 13, 2017 at 06:16:02AM +0000, Dexuan Cui wrote:
> IMO this means not only SCSI Unmap command is affected, but
> some other SCSI commands can be affected too?
> And it looks the bare metal can be affected too?
This affects all drivers looking at the sdb.length field for the
total I/O length - many drivers don't need it but just the SGL, including
both that I tested d this change on - one being virtualized and one
bare metal.
It also only affects commands where the data transfer length is different
from the length of the written blocks, so only affects WRITE SAME and
UNMAP commands, used for discard or zeroing.
I'll submit a cleaned up version with a proper block layer helper today.
Thanks for reporting and debugging this issue!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-13 7:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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
[not found] ` <MWHPR03MB2669B1BD87F79243F17ADB23BF780@MWHPR03MB2669.namprd03.prod.outlook.com>
2017-01-13 7:39 ` Christoph Hellwig
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).