From patchwork Tue Jun 13 00:23:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 9782883 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 B859160212 for ; Tue, 13 Jun 2017 00:24:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABD302841E for ; Tue, 13 Jun 2017 00:24:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F665284A8; Tue, 13 Jun 2017 00:24:53 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 641EC2841E for ; Tue, 13 Jun 2017 00:24:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752749AbdFMAYl (ORCPT ); Mon, 12 Jun 2017 20:24:41 -0400 Received: from a2nlsmtp01-02.prod.iad2.secureserver.net ([198.71.225.36]:56402 "EHLO a2nlsmtp01-02.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752330AbdFMAYk (ORCPT ); Mon, 12 Jun 2017 20:24:40 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id KZcRdvrhngsnaKZcRdvIw0; Mon, 12 Jun 2017 17:23:39 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1dKZcR-0003rP-10; Mon, 12 Jun 2017 17:23:39 -0700 From: Long Li To: "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, KY Srinivasan , Stephen Hemminger , Haiyang Zhang Cc: Long Li Subject: [PATCH] storvsc: use default I/O timeout handler for FC devices Date: Mon, 12 Jun 2017 17:23:37 -0700 Message-Id: <1497313417-14815-1-git-send-email-longli@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 X-CMAE-Envelope: MS4wfAREHT82ijtTc4JatVDeR+T+PrUhGTs3Gn6ccpPeZHKz4Ay8SjqHKi/BtywNE68G1tETKKx0eyJNw5ZXAF/qnbGNyWyE88rFk/x0j+7bFtKyi+q1twjY BJ1p9ygx0NYs0eGqtZ9IP51IKXOQHHmDMNtmTsqBV23kfUULMVS5/0HeiPFPrqvPbUV3qhJAhocO3H5sI0J9y+JjSBgW72uE55qXObz2wvNHJkPjCECpa9mT zrtHOzWsKnRp3hdn/HriiUWOqPZSh9B9D+YLzv+z1K1r5EEbwp0ZRoBGfbYNoljCuSFv2GjmTIW/phZqunlLfYjWqPxDsWOfGOHyJ9Vw3PDmpIPSltcIOoFw w9bzR+ScZiKj+qZHBCqzNgAM+AOVteDYUwXe28AmQoM6jKTWk4Q+QLop5pP5+EZNZjOBrPNBPg809Pe7Tq596Zw/JseYNA== 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 FC disks are usually setup in a multipath system, and they don't want to unconditionaly reset I/O on timeout. I/O timeout is detected by multipath as a good time to failover and recover. Signed-off-by: Long Li Reviewed-by: Johannes Thumshirn --- drivers/scsi/storvsc_drv.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 8d955db..d60b5ea 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -486,6 +486,7 @@ struct hv_host_device { unsigned int port; unsigned char path; unsigned char target; + bool is_fc; }; struct storvsc_scan_work { @@ -1495,6 +1496,11 @@ static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd) */ static enum blk_eh_timer_return storvsc_eh_timed_out(struct scsi_cmnd *scmnd) { + struct hv_host_device *host_dev = shost_priv(scmnd->device->host); + + if (host_dev->is_fc) + return BLK_EH_NOT_HANDLED; + return BLK_EH_RESET_TIMER; } @@ -1738,6 +1744,7 @@ static int storvsc_probe(struct hv_device *device, host_dev->port = host->host_no; host_dev->dev = device; + host_dev->is_fc = is_fc; stor_device = kzalloc(sizeof(struct storvsc_device), GFP_KERNEL);