Received: by 10.213.65.68 with SMTP id h4csp2182678imn; Sun, 8 Apr 2018 21:54:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/gg2cfEqo5moQY3qO4ttUB3zM5cVGPQ6/Xe95VVoSDySnS/UWCUO58Fy2COf024++qBxWh X-Received: by 10.101.97.4 with SMTP id z4mr15562445pgu.354.1523249691617; Sun, 08 Apr 2018 21:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523249691; cv=none; d=google.com; s=arc-20160816; b=OhdrYzF1mhcW4oT2I8SCq95LmcoirmB0UCqd3xqVakrz6gsulsbNDq9FSEXUnQowMu FoAhf8WuyOWRwnhFs5Yg8ujHDSlRJCEWhFw9cBVcsYVJ+MOsut5BXDCT3aoT3siZeRu4 s6/LCR74dn9fIW+X505KK9dmELSR5116gyQjdfZd8cx3s8di7Ih+9wrhfl4i3JU7QVqt 6bcZAeZGlAYOFpTRX3I+z4JvLv/6MDbt5LPCQ3MBkCP3Dv+hXEm5OSRMdq3Ju089FsxT vs1kKW7PsGO7Z5AbH11G2jNBKLx3PnFNZ64scRVmOFMpO9kixE9N2CNR/uHNYGAg1r71 rugw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=jIsOdtafxrI0goY36MDgoEJutbk9T0Taji8FwyD64o4=; b=ouJnmdYkpVSSsj0S3SxUpk6YLQfrm29zRT0aQJSPRa8tXdRfAps5mnzViI1IGjfq3f O4fGANC029Yu22qBSbmFvDUq48rS9O8zluFataVp3htfWPlABXLZbN6rnYjGePiR43JW b+gg/diFmaCA3R72BIVUu66PXBAym/lcAArR41WJ1C8527u6W0S/sBPZupKcn1tn1KF7 tQUuZ5/mcBYoL4CJTd3lddeuzCFTefJpYgqqehHFANi1QVZjyEB2iEVqPzrvJVPI7kqG fBmqmHpSpL29Fc7XCs1P2rMCDlEsB1uPsbOvBMhIZFizT0wdgyFrxJafGNK3iYsA7aMU ZYgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=mxcB4+Fv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 38-v6si13985336plf.737.2018.04.08.21.54.13; Sun, 08 Apr 2018 21:54:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=mxcB4+Fv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753320AbeDIAR5 (ORCPT + 99 others); Sun, 8 Apr 2018 20:17:57 -0400 Received: from mail-bl2nam02on0136.outbound.protection.outlook.com ([104.47.38.136]:51875 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753239AbeDIARw (ORCPT ); Sun, 8 Apr 2018 20:17:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=jIsOdtafxrI0goY36MDgoEJutbk9T0Taji8FwyD64o4=; b=mxcB4+FvRmkJ7WOffefWXzAPn3JHMp2lnyH/YaG1Q+cKf5WFBjjB1plC92A4ZDdD034IPQMy/P3UVIsmfddmuAuBCibFthcGNE3Wec+ZKvRPtD7sAZ+unBJjO6zXke74aj3zYMvkDq9/XkAKfFwXH/vu4zGbV4KLu2besJzWPCw= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1048.namprd21.prod.outlook.com (52.132.128.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:17:45 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:17:45 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: James Smart , James Smart , Christoph Hellwig , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 039/189] nvme-fc: fix rogue admin cmds stalling teardown Thread-Topic: [PATCH AUTOSEL for 4.15 039/189] nvme-fc: fix rogue admin cmds stalling teardown Thread-Index: AQHTz5geCQ1TIBTO1kuePnH6wPXU9g== Date: Mon, 9 Apr 2018 00:17:17 +0000 Message-ID: <20180409001637.162453-39-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1048;7:xQSaMe3cbnc9AoLkwSM2dGjOZ0FXa4bxEHJhhQQ5f2lYTqJLAaZGlR7lHcbpkNK3phN9ptgSa5HMLsUW2AMULlZt6EbHYicKh4aLvnuDiRk9z3m0Ey5nbHTj2mtUvlQvEzsH5xPGspJto5P+hZeQfLgrmDnD5PLPfbeb+d2tvYM8sM5SqyG1VuL2tYkqXJ4AmNDSVrLAJUrVadeuy5ODsFR2tpw+sM10tVb98W2sERTixU/zm0Es/YOFSKckGcoX;20:2zD3zlIFLhqVPixJhNdlwVwwp1Bsh9hdln7mkaWk+XDv4gaNi6E8udJq7bMnO4jXzNlr7uQdkwqwyEWcTaJsiPWY1FMqdDeBjCtBH6hpswTxU1Tx143bHX+NpTtphzSJQxuSIAu6d+Yp7vEteGj+q0XMDh8hwYc2m956IYBr1pE= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: b8ac3382-d7d0-4217-de1b-08d59daf517c x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1048; x-ms-traffictypediagnostic: DM5PR2101MB1048: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1048;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1048; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(39380400002)(376002)(39860400002)(346002)(396003)(189003)(199004)(86362001)(1076002)(575784001)(99286004)(6116002)(110136005)(3846002)(54906003)(39060400002)(22452003)(3280700002)(105586002)(2906002)(76176011)(4326008)(6512007)(6436002)(6486002)(3660700001)(6666003)(7736002)(59450400001)(86612001)(25786009)(2900100001)(14454004)(97736004)(53936002)(107886003)(68736007)(102836004)(36756003)(6506007)(26005)(186003)(106356001)(305945005)(5250100002)(72206003)(478600001)(2501003)(10290500003)(81166006)(5660300001)(8676002)(66066001)(316002)(81156014)(2616005)(10090500001)(11346002)(446003)(476003)(8936002)(486006)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1048;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: pl7vFSvpaYfQYB2jAL/qAKojYqAMquHz5av1xkr3ereMTTxp0Wa5NligT9/eX4nw+hZmbAX5scqHge1sV1b+UHfC81sDc44bs4T2BpgUC4sk8tSAAmmwhukBdLZaqNyykEsxuHaDByxKzG9/8MwJ+zwtCyodU/e8xKQZVHZZoHOVljBCYJlyoKuM4SdJzFE0SQi/Pb3rgqmbfaISyVNQq6dA64YA4LoZR5N0/YIyFcpMeEUP+w1TiIH1h2t9E9V2UA/ugnI9+orevT+N95OCzXj9iS0SyJpnrKtgGhzKnDaaOBYt8wYk3pmduCiVHQHg1xOhRrA4l1I5XZZmY3zxN8JAIMkn5krijEc8YOe30Y63dQAyzB5i5oeAZ2CrvXqzoPoSQlb+YWHfTVdcgWuZhZ9PzhmCTLRvqplsEFN8Yx0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8ac3382-d7d0-4217-de1b-08d59daf517c X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:17:17.1983 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1048 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Smart [ Upstream commit d625d05ef0f0914a706d824fab85472a42be6659 ] When connectivity is lost to a device, the association is terminated and the blk-mq queues are quiesced/stopped. When connectivity is re-established, they are resumed. If an admin command is received while connectivity is list, the ioctl queues the command on the admin_q and the command stalls (the thread issuing the ioctl hangs/waits). if the connectivity is lost long enough such that the controller is then deleted, the delete code makes its calls to initiate the delete, which then expects the core layer to call the transport when all references are removed and the controller can be freed. Unfortunately, nothing in this path dequeued the admin command, so a reference sits outstanding and things stop, hanging the delete indefinitely. Correct by unquiescing the admin queue in the delete association. This means any admin command (which should only be from an ioctl) issued after connectivity is lost will detect the controller is in a reconnecting state and will (fast) fail the command. Thus, a pending reference can no longer be created. Once connectivity is re-established, a new ioctl/admin command would see proper device state and function again. Signed-off-by: James Smart Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/fc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 794e66e4aa20..8f9ddd0e392c 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -2921,6 +2921,9 @@ nvme_fc_delete_association(struct nvme_fc_ctrl *ctrl) __nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[0], 0); nvme_fc_free_queue(&ctrl->queues[0]); =20 + /* re-enable the admin_q so anything new can fast fail */ + blk_mq_unquiesce_queue(ctrl->ctrl.admin_q); + nvme_fc_ctlr_inactive_on_rport(ctrl); } =20 --=20 2.15.1