lkml.org 
[lkml]   [2013]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/4] Hyper-V TRIM support
On Fri, Sep 13, 2013 at 07:57:58AM -0700, James Bottomley wrote:

> This is an awful lot of contortions (which don't seem to have any other
> users on the horizon) to support a device that's not standards
> compliant. What about this, it's simple, it does the right thing and
> it's contained in the driver of the problem device.
>
> James
>
> ---
>
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 83ec1aa..bd86a4b 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -1438,6 +1438,12 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
>
> sdevice->no_write_same = 1;
>
> + /*
> + * hyper-v is stupid and lies about its capabilities
> + * If we pretend to be SPC-3, we send RC16 which activates trim
> + */
> + sdevice->scsi_level = SCSI_SPC_3;
> +
> return 0;
> }

I will get that tested and see if there are any other negative side effects.

-apw


\
 
 \ /
  Last update: 2013-09-13 18:01    [W:0.036 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site