diff mbox

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

Message ID 20170112155241.GA18147@lst.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christoph Hellwig Jan. 12, 2017, 3:52 p.m. UTC
Can you check if this debug printk triggers for the discard commands?

---
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Dexuan Cui Jan. 12, 2017, 4:39 p.m. UTC | #1
> From: Christoph Hellwig [mailto:hch@lst.de]
> Sent: Thursday, January 12, 2017 23:53
> To: Dexuan Cui <decui@microsoft.com>
> Cc: Christoph Hellwig <hch@lst.de>; linux-block@vger.kernel.org; Jens Axboe
> <axboe@fb.com>; Vitaly Kuznetsov <vkuznets@redhat.com>; linux-
> kernel@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"
> 
> 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);
> 

// I fixed the small building issue (data_transfer_length  ==>  vm_srb->data_transfer_length).

No, the printk doesn't trigger for fstrim.

It does trigger at the early boot phase, though.

# dmesg |grep len:
[    0.000000] log_buf_len: 134217728 bytes
[    7.073423] request len: 255, transfer len: 12
[    7.084937] request len: 255, transfer len: 52
[    7.121728] request len: 64, transfer len: 12
[    7.121915] request len: 64, transfer len: 12
[    7.123180] request len: 64, transfer len: 12
[    7.123367] request len: 64, transfer len: 12
[    7.127193] request len: 64, transfer len: 12
[    7.127350] request len: 64, transfer len: 12
[    7.178930] request len: 255, transfer len: 12
[    7.179045] request len: 255, transfer len: 52

-- Dexuan
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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