storvsc: ring buffer failures may result in I/O freeze
authorLong Li <longli@microsoft.com>
Sat, 6 Dec 2014 03:38:18 +0000 (19:38 -0800)
committerJiri Slaby <jslaby@suse.cz>
Wed, 28 Jan 2015 08:27:33 +0000 (09:27 +0100)
commit e86fb5e8ab95f10ec5f2e9430119d5d35020c951 upstream.

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: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/scsi/storvsc_drv.c

index ed0f899..86b0515 100644 (file)
@@ -1690,13 +1690,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;