Re: [Regression] fstrim hangs on Hyper-V: caused by "block: improve handling of the magic discard payload"

From: Christoph Hellwig
Date: Thu Jan 12 2017 - 10:53:48 EST


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);