From patchwork Tue Sep 6 21:25:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 9317873 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2017C607D3 for ; Tue, 6 Sep 2016 19:37:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F08F528E98 for ; Tue, 6 Sep 2016 19:37:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E55B128D58; Tue, 6 Sep 2016 19:37:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=2.0 tests=BAYES_00, RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90DD128D58 for ; Tue, 6 Sep 2016 19:37:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756644AbcIFThJ (ORCPT ); Tue, 6 Sep 2016 15:37:09 -0400 Received: from p3plsmtps2ded01.prod.phx3.secureserver.net ([208.109.80.58]:57506 "EHLO p3plsmtps2ded01.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755902AbcIFThF (ORCPT ); Tue, 6 Sep 2016 15:37:05 -0400 Received: from linuxonhyperv.com ([72.167.245.219]) by : HOSTING RELAY : with SMTP id hMA8bxzXsKZkOhMA8bF0A2; Tue, 06 Sep 2016 12:36:04 -0700 x-originating-ip: 72.167.245.219 Received: by linuxonhyperv.com (Postfix, from userid 511) id 3595019028A; Tue, 6 Sep 2016 14:26:34 -0700 (PDT) From: Long Li To: "K. Y. Srinivasan" , Haiyang Zhang , "James E.J. Bottomley" , "Martin K. Petersen" Cc: devel@linuxdriverproject.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Long Li Subject: [PATCH 2/3] storvsc: properly handle SRB_ERROR when sense message is present Date: Tue, 6 Sep 2016 14:25:42 -0700 Message-Id: <1473197143-16760-3-git-send-email-longli@exchange.microsoft.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1473197143-16760-1-git-send-email-longli@exchange.microsoft.com> References: <1473197143-16760-1-git-send-email-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfFPJqrJdwb7NZcbBFCWzs2RsqbY+NiEkbsrCuvh3ffqXBWcZOjudeAjKkjj9cvgqS5aNcM8BiZoG5M5GZo6aBEVy1Nsr9D+lBtK0cxzxI/4BHMXeJMKC efjsjxc+RMli8JZtRRPKFYHiEOukKpQCd9BpH8vMGdGa2h1kadFre/FhUFwvzFk4ZCG1WTHQNFpqQyj549hthkqjFht1eo4XM4G5z5IQJXz67cxl+mIjVr6C vP3RkiCSOvc4xloc4xiyJW1lOp5pW7Gw+8J1KNUESeHBVKJLNnqsIEk7Na2xmWmxa59pfxUFRxu0qmESwGoinJf1bWHKW8b+VWefh55pnLHwQK7/vCpDkOy8 AqTXgB8sx3jpJeGeZ/jLiwLg4P71wYqy+A/z/hsHl9emsw6Gml6pISrGANAt3MTRaG8IkenjPEi3GYjZFjwe6TUwqVCfWg== Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Long Li When sense message is present on error, we should pass along to the upper layer to decide how to deal with the error. This patch fixes connectivity issues with Fiber Channel devices. --- drivers/scsi/storvsc_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index a8f3e4c..8328c87 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -890,6 +890,9 @@ static void storvsc_handle_error(struct vmscsi_request *vm_srb, switch (SRB_STATUS(vm_srb->srb_status)) { case SRB_STATUS_ERROR: + /* Let upper layer deal with error when sense message is present */ + if (vm_srb->srb_status & SRB_STATUS_AUTOSENSE_VALID) + break; /* * If there is an error; offline the device since all * error recovery strategies would have already been