diff mbox

[precise/trusty/utopic,SRU,1/1] drivers:scsi:storvsc: Fix a bug in handling ring buffer failures that may result in I/O freeze

Message ID 1418209758-25146-2-git-send-email-apw@canonical.com
State New
Headers show

Commit Message

Andy Whitcroft Dec. 10, 2014, 11:09 a.m. UTC
From: Long Li <longli@microsoft.com>

When ring buffer returns an error indicating retry, storvsc may not return a proper error code to SCSI when bounce buffer is not used. This has introduced I/O freeze on RAID running atop storvsc devices. This patch fixes it by always returning a proper error code.

Signed-off-by: Long Li <longli@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: stable@vger.kernel.org
BugLink: http://bugs.launchpad.net/bugs/1400289
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 drivers/scsi/storvsc_drv.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Stefan Bader Dec. 10, 2014, 11:16 a.m. UTC | #1
It looks reasonable, just seems to have no indication where it comes from.
Andy Whitcroft Dec. 10, 2014, 11:47 a.m. UTC | #2
On Wed, Dec 10, 2014 at 12:16:36PM +0100, Stefan Bader wrote:
> It looks reasonable, just seems to have no indication where it comes from.

Doh.

This is on its way upstream via the SCSI tree.  The patch there as
presented is an unmodified version of that patche, and applies identically
all the way back to P.  Due to the severity of the bug we have been asked
to take it prior to it making it upstream, so that it will make the next
SRU cycle.  This request comes direct from the upstream maintainer of
the hyper-v storage sub-system.

Obviously it will need good testing during the SRU cycle, which Ben's
team can handle.

-apw
Stefan Bader Dec. 10, 2014, 1:36 p.m. UTC | #3

Seth Forshee Dec. 10, 2014, 1:40 p.m. UTC | #4

Brad Figg Dec. 10, 2014, 4:59 p.m. UTC | #5
On Wed, Dec 10, 2014 at 11:09:18AM +0000, Andy Whitcroft wrote:
> From: Long Li <longli@microsoft.com>
> 
> When ring buffer returns an error indicating retry, storvsc may not return a proper error code to SCSI when bounce buffer is not used. This has introduced I/O freeze on RAID running atop storvsc devices. This patch fixes it by always returning a proper error code.
> 
> Signed-off-by: Long Li <longli@microsoft.com>
> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> Cc: stable@vger.kernel.org
> BugLink: http://bugs.launchpad.net/bugs/1400289
> Signed-off-by: Andy Whitcroft <apw@canonical.com>
> ---
>  drivers/scsi/storvsc_drv.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index a3b4ce9..d73b740 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -1379,13 +1379,12 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
>  	if (ret == -EAGAIN) {
>  		/* no more space */
>  
> -		if (cmd_request->bounce_sgl_count) {
> +		if (cmd_request->bounce_sgl_count)
>  			destroy_bounce_buffer(cmd_request->bounce_sgl,
>  					cmd_request->bounce_sgl_count);
>  
> -			ret = SCSI_MLQUEUE_DEVICE_BUSY;
> -			goto queue_error;
> -		}
> +		ret = SCSI_MLQUEUE_DEVICE_BUSY;
> +		goto queue_error;
>  	}
>  
>  	return 0;
> -- 
> 1.9.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Applied to precise, trusty, utopic
diff mbox

Patch

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index a3b4ce9..d73b740 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1379,13 +1379,12 @@  static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
 	if (ret == -EAGAIN) {
 		/* no more space */
 
-		if (cmd_request->bounce_sgl_count) {
+		if (cmd_request->bounce_sgl_count)
 			destroy_bounce_buffer(cmd_request->bounce_sgl,
 					cmd_request->bounce_sgl_count);
 
-			ret = SCSI_MLQUEUE_DEVICE_BUSY;
-			goto queue_error;
-		}
+		ret = SCSI_MLQUEUE_DEVICE_BUSY;
+		goto queue_error;
 	}
 
 	return 0;