From patchwork Thu Nov 30 03:40:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10084191 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 E5F23602B9 for ; Thu, 30 Nov 2017 03:41:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC7F129935 for ; Thu, 30 Nov 2017 03:41:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D172629B05; Thu, 30 Nov 2017 03:41:20 +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,DKIM_SIGNED, DKIM_VALID,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 6D6D029935 for ; Thu, 30 Nov 2017 03:41:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753441AbdK3DlQ (ORCPT ); Wed, 29 Nov 2017 22:41:16 -0500 Received: from mail-bl2nam02on0048.outbound.protection.outlook.com ([104.47.38.48]:19264 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752980AbdK3DlI (ORCPT ); Wed, 29 Nov 2017 22:41:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Tg01WS9rzE0LK/uacEkjBshjT/hT/TSC8voABI/xW24=; b=myJYXFjfJRUN76dDLZX+/wNDWFjPzIf2XXXAyCLCOhkKwR+bgKDp9XoVD9dh6RjUAgzqrof2KklsnljU2xKJYh/u7TsIpzbSIp0CuWhbaZUMYkpGiVcRUvnZHcPRObkNTvpW4rRdziHKpHjOarlyTdex0mBi95ARtnDKE4irfno= Received: from BY2PR07CA0095.namprd07.prod.outlook.com (10.166.107.48) by CY1PR0701MB1947.namprd07.prod.outlook.com (10.163.141.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Thu, 30 Nov 2017 03:41:05 +0000 Received: from BL2FFO11FD049.protection.gbl (2a01:111:f400:7c09::147) by BY2PR07CA0095.outlook.office365.com (2a01:111:e400:7bff::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.282.5 via Frontend Transport; Thu, 30 Nov 2017 03:41:05 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BL2FFO11FD049.mail.protection.outlook.com (10.173.161.211) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.218.12 via Frontend Transport; Thu, 30 Nov 2017 03:41:04 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 29 Nov 2017 19:40:49 -0800 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id vAU3enZ1015142; Wed, 29 Nov 2017 19:40:49 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vAU3enxg015141; Wed, 29 Nov 2017 19:40:49 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 09/22] qla2xxx: Fix NPIV host cleanup in target mode Date: Wed, 29 Nov 2017 19:40:34 -0800 Message-ID: <20171130034047.15070-10-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171130034047.15070-1-himanshu.madhani@cavium.com> References: <20171130034047.15070-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(2980300002)(428002)(199003)(189002)(81156014)(51416003)(5660300001)(1076002)(106466001)(2950100002)(8676002)(81166006)(6666003)(42186006)(80596001)(48376002)(50466002)(50986010)(76176010)(33646002)(305945005)(69596002)(16586007)(36756003)(54906003)(356003)(110136005)(316002)(86362001)(101416001)(50226002)(72206003)(478600001)(105586002)(2906002)(8936002)(47776003)(4326008)(189998001)(87636003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1947; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD049; 1:1OMLFGQgPQBhFb46bm7KdG53Zs/ABp7AcFy1p4jp+XBp8yRhceX9d5tq8r1DfJ9ZBHJ2Xlpbn6opQ/DCZlavylOMi4vudIelLHFkUZ8RTTkd3hgqWWYe0Dt19W2FkDWv X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bba63edc-38d6-4a2f-1751-08d537a42f75 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603280); SRVR:CY1PR0701MB1947; X-Microsoft-Exchange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ftM6zUJzK+Wsgq/kHJW2hAVVY3LZk0Himv0jCdPNWq/M2uopWWqo4JORHp5BzdYQPCrkmUXQgrH1AWEXNkXMgn4KMpoiRnmbC5hxaomCMH7tG1HfrEYnwJQ24z0jrUjfQurEaOu81BT90NxTtRvAhJUFKW4ApGbRoACTg7DzBQCLcHTA8phNE3SffnIlU1kYdQI92sEvGFGFdu5pVmy+zSASI9xcw0w4fMyT8arRVqp+ufH4/GCfiDeq5tnRi1obZL9oon7qTg0JjIHnDhDH6AYqw+UK878zvR9QSNETV8PlcIuoMjg0v18LTGU9nLgLcqCdC6YWAcbTREUB8IRZW20eCEh1t/FF7illLQtmEqaK4KAWcL4yAz1TfbxcZvIruvkuf5U9Jaw2bsiSiBrbB7mOCdJQoJRMk4GpWn3BbEVeJRypgMu9+t1KRBmHJWQuI439WcA4P0jYqkwbvuhcWoNw5o921lkxzSccLqIHYrPQrZ9TLZMmt1joX4u X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3231022)(93006095)(93001095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(6072148)(201708071742011); SRVR:CY1PR0701MB1947; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY1PR0701MB1947; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1947; 4:ZdEtk1YP7cYnMblTYfV6wrrXDS3v2y1O3ZzM8k/fRCSzXau046dCtnCYy0guTrEckHyD8Tg/Bhg6auNpcxNK/Bwegb5U32Rg22DxDZ1MUCs0avYZlKH03zxm/rId+drIC1566R2B8fKs4/DqLWGK9REE0plLU/8hzBrPrkBuCniLyPoxUt1vLXUa8aOkH4j0ZMVn5nJXL5FUZp2G7Q0BSdxYaSoQCSny5a6hzjNlwmc2w0Q9dhU9iI8HyBamuHHGTZupTtAkDUndOIoBDkCcCWQogWxeeLYVaODjRHlfuD7aw35U4M/03cR277h5w8jh X-Forefront-PRVS: 05079D8470 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1947; 23:/JifMD8JrJycWos6wT7QBOA0oiRYKlpW2hkgZCp?= =?us-ascii?Q?45vE2G/EiF1xmhZBr50s0EroZXOETnb1Pd7bP8w+ZSk/KwWVE0AoMc54S/oh?= =?us-ascii?Q?lCxCF99oG0j7/8o79m4/UcnheQ1ljVJ4i06tnn3KVWJdicRBhHOJWkEjNZMh?= =?us-ascii?Q?AtVCjKGmSd4ht2CqGsGjWI39FpclDvwmwfyWTnRmIl7IO/dzc9pgPseOHpqo?= =?us-ascii?Q?y7qs7nQ1js++YF2BuTb/zzaN8PWlfkcIKTUiagA/TrSASEUecriBWbMQUJp9?= =?us-ascii?Q?h+rWbWPPpI3ho5hgWEYRL94R/iD1wCGmpwLsX/IowTwboNKGpirI/4xeZerw?= =?us-ascii?Q?Lfb3rIy05W6SWbJvB7IdT11KlP0QKX0IzFgn3nGdjk21ilVO7Tm2uoBu8Zqi?= =?us-ascii?Q?TsrVefg7kdyk59AaweNSGiUKN/KzUTpMRlYDW+BS+KnAZwGTfWIfCETAsRu5?= =?us-ascii?Q?yac2M9p0CT2N0Z+JIuqs+0+rfMvkXleGyTVcAkcXgmeB/3YG6dsW/CC3zD35?= =?us-ascii?Q?Vmpr/DETWZOD0aHwIfXiSMLaA3x0MjDR/Ooa6vjpgUyQMcWpHW7X5+Ioxz6n?= =?us-ascii?Q?kpj4g0dYymu5VQ/RVYRMoPTClWARpzKk4nIBLUsO6/RfS/Tq28CmMkI3Kv9q?= =?us-ascii?Q?BCyd5WM2riyJ/VnWa2wWBCfr29zWYPN62t8kFU4/Y1Jp2BlSAXZaGXNe4aNy?= =?us-ascii?Q?4pB84y4ITZv4oDSdc3nZz622LbDZdi1R/Fghg/VQ2rt/lyikPSaC+AVEtmgg?=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aeuRMg3Gfj96V4JZVyo2Mk3cwoDl/L6iOmRoX887HukGotLlVa5zjEg41WSx/J8TGQ/hae3DHkSa5duHcbsLG3vv9gjU9fafWAjjuL0n3b+EDG5O50zY1K89P7DKfzxOpkwCmbHe0aydRxXThLKTKy3GwaTHhAijUn3oovpHPy8DAJFALWdPRN0EWpPXZiaYmQigfQhrwj1mAn6WQzy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2017 03:41:04.9573 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bba63edc-38d6-4a2f-1751-08d537a42f75 X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1947 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: Sawan Chandak Add check to make sure we are cleaning up global target host list only for NPIV hosts Fixes: bdbe24de281e2 ("scsi: qla2xxx: Cleanup NPIV host in target mode during config teardown") Cc: # 4.10+ Signed-off-by: Sawan Chandak Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke --- drivers/scsi/qla2xxx/qla_target.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 924d58f5408f..1bec8aebb7b6 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1561,8 +1561,11 @@ static void qlt_release(struct qla_tgt *tgt) btree_destroy64(&tgt->lun_qpair_map); - if (ha->tgt.tgt_ops && ha->tgt.tgt_ops->remove_target) - ha->tgt.tgt_ops->remove_target(vha); + if (vha->vp_idx) + if (ha->tgt.tgt_ops && + ha->tgt.tgt_ops->remove_target && + vha->vha_tgt.target_lport_ptr) + ha->tgt.tgt_ops->remove_target(vha); vha->vha_tgt.qla_tgt = NULL;