linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] storvsc: remove bogus code to transfer struct scatterlist
@ 2017-01-29  9:12 Christoph Hellwig
  2017-01-30 17:19 ` Bart Van Assche
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Christoph Hellwig @ 2017-01-29  9:12 UTC (permalink / raw)
  To: kys, haiyangz, sthemmin; +Cc: linux-scsi

Remove a piece of code in storvsc_queuecommand that tries to pass the
physical address of the kernel struct scatterlist pointer to the host.

Fortunately the code can't ever be reached anyway.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/scsi/storvsc_drv.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 05526b7..62f4545 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1511,13 +1511,6 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
 				page_to_pfn(sg_page((cur_sgl)));
 			cur_sgl = sg_next(cur_sgl);
 		}
-
-	} else if (scsi_sglist(scmnd)) {
-		payload->range.len = length;
-		payload->range.offset =
-			virt_to_phys(scsi_sglist(scmnd)) & (PAGE_SIZE-1);
-		payload->range.pfn_array[0] =
-			virt_to_phys(scsi_sglist(scmnd)) >> PAGE_SHIFT;
 	}
 
 	cmd_request->payload = payload;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] storvsc: remove bogus code to transfer struct scatterlist
  2017-01-29  9:12 [PATCH] storvsc: remove bogus code to transfer struct scatterlist Christoph Hellwig
@ 2017-01-30 17:19 ` Bart Van Assche
  2017-01-30 23:48 ` KY Srinivasan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2017-01-30 17:19 UTC (permalink / raw)
  To: hch@lst.de, sthemmin@microsoft.com, haiyangz@microsoft.com,
	kys@microsoft.com
  Cc: linux-scsi@vger.kernel.org

On Sun, 2017-01-29 at 10:12 +0100, Christoph Hellwig wrote:
> Remove a piece of code in storvsc_queuecommand that tries to pass the
> physical address of the kernel struct scatterlist pointer to the host.
> 
> Fortunately the code can't ever be reached anyway.

Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] storvsc: remove bogus code to transfer struct scatterlist
  2017-01-29  9:12 [PATCH] storvsc: remove bogus code to transfer struct scatterlist Christoph Hellwig
  2017-01-30 17:19 ` Bart Van Assche
@ 2017-01-30 23:48 ` KY Srinivasan
  2017-01-31  0:00 ` Stephen Hemminger
  2017-02-01  2:49 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: KY Srinivasan @ 2017-01-30 23:48 UTC (permalink / raw)
  To: Christoph Hellwig, Haiyang Zhang, Stephen Hemminger
  Cc: linux-scsi@vger.kernel.org



> -----Original Message-----
> From: Christoph Hellwig [mailto:hch@lst.de]
> Sent: Sunday, January 29, 2017 1:12 AM
> To: KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; Stephen Hemminger
> <sthemmin@microsoft.com>
> Cc: linux-scsi@vger.kernel.org
> Subject: [PATCH] storvsc: remove bogus code to transfer struct scatterlist
> 
> Remove a piece of code in storvsc_queuecommand that tries to pass the
> physical address of the kernel struct scatterlist pointer to the host.
> 
> Fortunately the code can't ever be reached anyway.

Thanks Christoph.

Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>

K. Y

> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  drivers/scsi/storvsc_drv.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 05526b7..62f4545 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -1511,13 +1511,6 @@ static int storvsc_queuecommand(struct Scsi_Host
> *host, struct scsi_cmnd *scmnd)
>  				page_to_pfn(sg_page((cur_sgl)));
>  			cur_sgl = sg_next(cur_sgl);
>  		}
> -
> -	} else if (scsi_sglist(scmnd)) {
> -		payload->range.len = length;
> -		payload->range.offset =
> -			virt_to_phys(scsi_sglist(scmnd)) & (PAGE_SIZE-1);
> -		payload->range.pfn_array[0] =
> -			virt_to_phys(scsi_sglist(scmnd)) >> PAGE_SHIFT;
>  	}
> 
>  	cmd_request->payload = payload;
> --
> 2.1.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] storvsc: remove bogus code to transfer struct scatterlist
  2017-01-29  9:12 [PATCH] storvsc: remove bogus code to transfer struct scatterlist Christoph Hellwig
  2017-01-30 17:19 ` Bart Van Assche
  2017-01-30 23:48 ` KY Srinivasan
@ 2017-01-31  0:00 ` Stephen Hemminger
  2017-02-01  2:49 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2017-01-31  0:00 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: KY Srinivasan, Haiyang Zhang, Stephen Hemminger, linux-scsi

On Sun, 29 Jan 2017 01:12:18 -0800
"Christoph Hellwig" <hch@lst.de> wrote:

> Remove a piece of code in storvsc_queuecommand that tries to pass the
> physical address of the kernel struct scatterlist pointer to the host.
> 
> Fortunately the code can't ever be reached anyway.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  drivers/scsi/storvsc_drv.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 05526b7..62f4545 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -1511,13 +1511,6 @@ static int storvsc_queuecommand(struct Scsi_Host
> *host, struct scsi_cmnd *scmnd)
>  				page_to_pfn(sg_page((cur_sgl)));
>  			cur_sgl = sg_next(cur_sgl);
>  		}
> -
> -	} else if (scsi_sglist(scmnd)) {
> -		payload->range.len = length;
> -		payload->range.offset =
> -			virt_to_phys(scsi_sglist(scmnd)) & (PAGE_SIZE-1);
> -		payload->range.pfn_array[0] =
> -			virt_to_phys(scsi_sglist(scmnd)) >> PAGE_SHIFT;
>  	}
>  
>  	cmd_request->payload = payload;

Looks like something that has been around from first versions of hyper-v support.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] storvsc: remove bogus code to transfer struct scatterlist
  2017-01-29  9:12 [PATCH] storvsc: remove bogus code to transfer struct scatterlist Christoph Hellwig
                   ` (2 preceding siblings ...)
  2017-01-31  0:00 ` Stephen Hemminger
@ 2017-02-01  2:49 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2017-02-01  2:49 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: kys, haiyangz, sthemmin, linux-scsi

>>>>> "Christoph" == Christoph Hellwig <hch@lst.de> writes:

Christoph> Remove a piece of code in storvsc_queuecommand that tries to
Christoph> pass the physical address of the kernel struct scatterlist
Christoph> pointer to the host.

Christoph> Fortunately the code can't ever be reached anyway.

Applied to 4.11/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-01  2:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-29  9:12 [PATCH] storvsc: remove bogus code to transfer struct scatterlist Christoph Hellwig
2017-01-30 17:19 ` Bart Van Assche
2017-01-30 23:48 ` KY Srinivasan
2017-01-31  0:00 ` Stephen Hemminger
2017-02-01  2:49 ` Martin K. Petersen

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