virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/6] staging: hv: Fixed lockup problem with bounce_buffer scatter list
@ 2010-08-03 17:31 Hank Janssen
  2010-08-03 17:38 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Hank Janssen @ 2010-08-03 17:31 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org',
	'devel@driverdev.osuosl.org',
	'virtualization@lists.osdl.org'
  Cc: Haiyang Zhang, 'gregkh@suse.de'

From: Hank Janssen <hjanssen@microsoft.com>

Fixed lockup problem with bounce_buffer scatter list which caused crashes in heavy loads.

Signed-off-by:Hank Janssen <hjanssen@microsoft.com>
Signed-off-by:Haiyang Zhang <haiyangz@microsoft.com> 

---
 drivers/staging/hv/storvsc_drv.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 3b9ccb0..169d701 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -615,6 +615,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
 	unsigned int request_size = 0;
 	int i;
 	struct scatterlist *sgl;
+	unsigned int sg_count = 0;
 
 	DPRINT_DBG(STORVSC_DRV, "scmnd %p dir %d, use_sg %d buf %p len %d "
 		   "queue depth %d tagged %d", scmnd, scmnd->sc_data_direction, @@ -697,6 +698,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
 	request->DataBuffer.Length = scsi_bufflen(scmnd);
 	if (scsi_sg_count(scmnd)) {
 		sgl = (struct scatterlist *)scsi_sglist(scmnd);
+		sg_count = scsi_sg_count(scmnd);
 
 		/* check if we need to bounce the sgl */
 		if (do_bounce_buffer(sgl, scsi_sg_count(scmnd)) != -1) { @@ -731,15 +733,16 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
 					      scsi_sg_count(scmnd));
 
 			sgl = cmd_request->bounce_sgl;
+			sg_count = cmd_request->bounce_sgl_count;
 		}
 
 		request->DataBuffer.Offset = sgl[0].offset;
 
-		for (i = 0; i < scsi_sg_count(scmnd); i++) {
+		for (i = 0; i < sg_count; i++) {
 			DPRINT_DBG(STORVSC_DRV, "sgl[%d] len %d offset %d\n",
 				   i, sgl[i].length, sgl[i].offset);
-			request->DataBuffer.PfnArray[i] =
-					page_to_pfn(sg_page((&sgl[i])));
+			request->DataBuffer.PfnArray[i] = 
+				page_to_pfn(sg_page((&sgl[i])));
 		}
 	} else if (scsi_sglist(scmnd)) {
 		/* ASSERT(scsi_bufflen(scmnd) <= PAGE_SIZE); */
--
1.6.0.2

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

* Re: [PATCH 2/6] staging: hv: Fixed lockup problem with bounce_buffer scatter list
  2010-08-03 17:31 [PATCH 2/6] staging: hv: Fixed lockup problem with bounce_buffer scatter list Hank Janssen
@ 2010-08-03 17:38 ` Greg KH
  2010-08-04  4:32   ` Hank Janssen
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2010-08-03 17:38 UTC (permalink / raw)
  To: Hank Janssen
  Cc: 'linux-kernel@vger.kernel.org',
	'devel@driverdev.osuosl.org',
	'virtualization@lists.osdl.org', Haiyang Zhang

On Tue, Aug 03, 2010 at 05:31:53PM +0000, Hank Janssen wrote:
> From: Hank Janssen <hjanssen@microsoft.com>
> 
> Fixed lockup problem with bounce_buffer scatter list which caused crashes in heavy loads.

Same questions for you as patch 1/6.

Also, please wrap your changelog comments at 72 columns.

> 
> Signed-off-by:Hank Janssen <hjanssen@microsoft.com>
> Signed-off-by:Haiyang Zhang <haiyangz@microsoft.com> 

What's with the trailing space?

> 
> ---
>  drivers/staging/hv/storvsc_drv.c |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
> index 3b9ccb0..169d701 100644
> --- a/drivers/staging/hv/storvsc_drv.c
> +++ b/drivers/staging/hv/storvsc_drv.c
> @@ -615,6 +615,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
>  	unsigned int request_size = 0;
>  	int i;
>  	struct scatterlist *sgl;
> +	unsigned int sg_count = 0;
>  
>  	DPRINT_DBG(STORVSC_DRV, "scmnd %p dir %d, use_sg %d buf %p len %d "
>  		   "queue depth %d tagged %d", scmnd, scmnd->sc_data_direction, @@ -697,6 +698,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
>  	request->DataBuffer.Length = scsi_bufflen(scmnd);
>  	if (scsi_sg_count(scmnd)) {
>  		sgl = (struct scatterlist *)scsi_sglist(scmnd);
> +		sg_count = scsi_sg_count(scmnd);
>  
>  		/* check if we need to bounce the sgl */
>  		if (do_bounce_buffer(sgl, scsi_sg_count(scmnd)) != -1) { @@ -731,15 +733,16 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
>  					      scsi_sg_count(scmnd));
>  
>  			sgl = cmd_request->bounce_sgl;
> +			sg_count = cmd_request->bounce_sgl_count;
>  		}
>  
>  		request->DataBuffer.Offset = sgl[0].offset;
>  
> -		for (i = 0; i < scsi_sg_count(scmnd); i++) {
> +		for (i = 0; i < sg_count; i++) {
>  			DPRINT_DBG(STORVSC_DRV, "sgl[%d] len %d offset %d\n",
>  				   i, sgl[i].length, sgl[i].offset);
> -			request->DataBuffer.PfnArray[i] =
> -					page_to_pfn(sg_page((&sgl[i])));
> +			request->DataBuffer.PfnArray[i] = 

Trailing space here?

You didn't run 'checkpatch.pl' now did you :)

You should set your editor to show up trailing spaces in bright red to
keep this from happening.  I can tell you how to do this in vim, all
other editors, you are on your own.

thanks,

greg k-h

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

* RE: [PATCH 2/6] staging: hv: Fixed lockup problem with bounce_buffer scatter list
  2010-08-03 17:38 ` Greg KH
@ 2010-08-04  4:32   ` Hank Janssen
  2010-08-04 17:05     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Hank Janssen @ 2010-08-04  4:32 UTC (permalink / raw)
  To: Greg KH
  Cc: 'linux-kernel@vger.kernel.org',
	'devel@driverdev.osuosl.org',
	'virtualization@lists.osdl.org', Haiyang Zhang

And then Greg spoke:
>> On Tue, Aug 03, 2010 at 05:31:53PM +0000, Hank Janssen wrote:
>> From: Hank Janssen <hjanssen@microsoft.com>
> >
> >Fixed lockup problem with bounce_buffer scatter list which caused crashes in heavy loads.
>
>Same questions for you as patch 1/6.
>
>Also, please wrap your changelog comments at 72 columns.
 
Under heavy loads with many clients we this problem appears, it causes a kernel 
Panic.

Yes, this should be backported to all stable kernel releases that have the 
Hyper-V drivers In them.  

>> Signed-off-by:Hank Janssen <hjanssen@microsoft.com> 
>> Signed-off-by:Haiyang Zhang <haiyangz@microsoft.com>
>
>What's with the trailing space?

Same problem as wrapping my comments at 72  chars, I just upgraded to the latest
Evil outlook 2010, and my settings in office 2007 did not transfer so I have to 
Set up all the stuff that fixes these problems :(

Do you want me to re-submit with correct wrapping?

Thanks,

Hank.

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

* Re: [PATCH 2/6] staging: hv: Fixed lockup problem with bounce_buffer scatter list
  2010-08-04  4:32   ` Hank Janssen
@ 2010-08-04 17:05     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2010-08-04 17:05 UTC (permalink / raw)
  To: Hank Janssen
  Cc: 'linux-kernel@vger.kernel.org',
	'devel@driverdev.osuosl.org',
	'virtualization@lists.osdl.org', Haiyang Zhang

On Wed, Aug 04, 2010 at 04:32:17AM +0000, Hank Janssen wrote:
> And then Greg spoke:
> >> On Tue, Aug 03, 2010 at 05:31:53PM +0000, Hank Janssen wrote:
> >> From: Hank Janssen <hjanssen@microsoft.com>
> > >
> > >Fixed lockup problem with bounce_buffer scatter list which caused crashes in heavy loads.
> >
> >Same questions for you as patch 1/6.
> >
> >Also, please wrap your changelog comments at 72 columns.
>  
> Under heavy loads with many clients we this problem appears, it causes a kernel 
> Panic.

Great, please provide this info.

> Yes, this should be backported to all stable kernel releases that have the 
> Hyper-V drivers In them.  

Again, add a cc: stable <stable@kernel.org> to the patch please.

> >> Signed-off-by:Hank Janssen <hjanssen@microsoft.com> 
> >> Signed-off-by:Haiyang Zhang <haiyangz@microsoft.com>
> >
> >What's with the trailing space?
> 
> Same problem as wrapping my comments at 72  chars, I just upgraded to the latest
> Evil outlook 2010, and my settings in office 2007 did not transfer so I have to 
> Set up all the stuff that fixes these problems :(
> 
> Do you want me to re-submit with correct wrapping?

Yes.  But you also have trailing spaces in some of these patches as
well, which need to be addressed.

thanks,

greg k-h

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

end of thread, other threads:[~2010-08-04 17:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-03 17:31 [PATCH 2/6] staging: hv: Fixed lockup problem with bounce_buffer scatter list Hank Janssen
2010-08-03 17:38 ` Greg KH
2010-08-04  4:32   ` Hank Janssen
2010-08-04 17:05     ` Greg KH

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