From patchwork Thu Nov 30 03:40:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10084195 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 088A3602B9 for ; Thu, 30 Nov 2017 03:41:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F374829935 for ; Thu, 30 Nov 2017 03:41:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E86DB29B02; Thu, 30 Nov 2017 03:41:22 +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 73A8329935 for ; Thu, 30 Nov 2017 03:41:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753465AbdK3DlU (ORCPT ); Wed, 29 Nov 2017 22:41:20 -0500 Received: from mail-sn1nam01on0069.outbound.protection.outlook.com ([104.47.32.69]:10912 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753446AbdK3DlR (ORCPT ); Wed, 29 Nov 2017 22:41:17 -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=tZIwj9QWXGFh0ZxslFMn4VUqVXddpaVtQTqCTSGRsk4=; b=S6Lrfq0XAaucn0ajMB2Z3vU0Us2xLpgZwmaOqw61C4CuJKRrXpri5AHy0lLfnRsFyLcRX92dmKygcDTvpyXxp9e4xPppPu4tl65HhRQ369sia2jnC5mdP5Bo8phGtTkoao7vgAWoemVG5MoX0SZp8qMxg+PeqQydANUtkUcMHTw= Received: from SN4PR0701CA0013.namprd07.prod.outlook.com (2603:10b6:803:28::23) by SN2PR07MB2526.namprd07.prod.outlook.com (2603:10b6:804:6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Thu, 30 Nov 2017 03:41:16 +0000 Received: from BL2FFO11FD056.protection.gbl (2a01:111:f400:7c09::109) by SN4PR0701CA0013.outlook.office365.com (2603:10b6:803:28::23) 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:16 +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 BL2FFO11FD056.mail.protection.outlook.com (10.173.161.184) 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:16 +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:51 -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 vAU3epvS015174; Wed, 29 Nov 2017 19:40:51 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vAU3epEO015173; Wed, 29 Nov 2017 19:40:51 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 17/22] qla2xxx: Clear loop id after delete Date: Wed, 29 Nov 2017 19:40:42 -0800 Message-ID: <20171130034047.15070-18-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)(2950100002)(51416003)(101416001)(86362001)(6666003)(47776003)(33646002)(106466001)(50226002)(36756003)(1076002)(105586002)(69596002)(50986010)(76176010)(48376002)(50466002)(8936002)(42186006)(80596001)(4326008)(81156014)(81166006)(8676002)(316002)(2906002)(110136005)(305945005)(54906003)(356003)(16586007)(72206003)(478600001)(5660300001)(189998001)(87636003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR07MB2526; 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; BL2FFO11FD056; 1:Qf9FdzfspekEg8W6PrpRkorKFql0g77RppmEKR7vEKMGksAHlH0AV/V3GGtFXDLg8FTJJ+Aq7boSrFqRYnnPkfKSd0PDbhasAOLI24eiBmiAnF2t1MnhOLU+Td98+2Ki X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3fdc6060-df5f-413b-8b87-08d537a43614 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603280); SRVR:SN2PR07MB2526; X-Microsoft-Exchange-Diag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FqqjsYaaHw74xeN5sjSXIlW6EkSCD6RnmTXmg8evRINSISlXCdgzNKSbmXYt7w10MDvdDEfsu72CXiyZ+me29pCdoZPx8Fj5EHcls/t94smyyVoms2qANPkO4RBzCLMemEccEwOgIZyzSy/Pl+KhHV5zbE45O2NHWLjGB8oa9NzNjJif8Wphx7y3orz3XT0UzU9AAwXX4kUPdD+c3sfxcKsGeasm8zzC7KUghQog0oy9g7hllAk8ElcTRlArGoXVIaHgR11XW4CIELQQM86/KBMa4WHKi/RrqoPNaFnwIKFIhiS9tBz+TJsWZYrePceX+sGEG6pkA19VSASwyG7Gfr16s2Ydeg5I0Ux2w4U44S9f0BvI3zZBAbz+R1X42y/V8nOzZ+bgp21xdDpHxjqH2jWQzGFJNxsILhH3NK3+XqQwuGHhpw35OjzFA3phaAtBGoMz90kaZG5yPS9uDvnxAKtMn1BietfPPaKPrjm X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3231022)(10201501046)(3002001)(93006095)(93001095)(6041248)(20161123562025)(20161123560025)(20161123558100)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:SN2PR07MB2526; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN2PR07MB2526; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2526; 4:1Op49Ogg9BTnKI7y4lzEmJGk9BBjSOUSpN3Gi+D5vJrSGXQ5VDgLXz+wBRT6DYRA7tGND5119eBjOpJwJ2OAlFDSHjyALS2iPCeSEVZxmxHaNvjzfjBNEfzw5Pj2tjx74CbyBT0ZQDuwA7SMo71321KyPcAediF24SKn7vC1X3WyWnAtRjIQGk95yyW03gE4biQj+GsASiP86Fq4N50wJ/5pD915DyuUQiyH4i2HoHz8bbuJ3VAKblHdS4CY3c5Ca+wqtwQDTv55o2zcu1bz9Smx+k7couv6AdCIZqyKpzAFXkGJaoVJzOkKybcar+Kx X-Forefront-PRVS: 05079D8470 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR07MB2526; 23:E7UrkwHMK9PVAG6EoW0OsN2GUntH1DsRfW+j0fn8n?= =?us-ascii?Q?wuOqrZF63dyF35XZZF8z389/alV8GlWj+c9I2yahq1zDNLWMIGQgCbJaOr30?= =?us-ascii?Q?vfakloYqqrU7F2DnRmQpcy+DiaJg51hmVoHOsbVDIWCghXgWoItijVWxiPfl?= =?us-ascii?Q?4I31fCv8a/87hUWF5H+rGBMHFB9sIwd6dJzSalNrjIl+mh64vbyLvW/tfPQ8?= =?us-ascii?Q?Vha5EwVUhCQjWZZBP2J0yvINKnt5AzEj/1r7g+LA4f3hB9/Ec3rZl/9S5Gn/?= =?us-ascii?Q?USamaPl06Bs9pKRX9dBZWPBQOsu16FFGJO0ON5YaAb62YepFvFgpH+NRW4vG?= =?us-ascii?Q?H0VPxBWcMyM+aK1Y6FKthCsRg8iczmUOZVUzDo0g4ttizNXUbj5ZzEAbp3tV?= =?us-ascii?Q?ofjwyvChuxVHnOw2nqvTFXAHJSdqZp0V3ZPoJEZqXXCDaJbzVGa3vG+Bzjb2?= =?us-ascii?Q?bSqYNJtPerbnbQJh5+pG2Qh6Fi3IChPVRzdu8vSgIp4ciad9wijoAEii2Dmu?= =?us-ascii?Q?nwNMuNf1wSe//mdc+sr6eUBzrZZslLerPP6HGvOFbsAyNFEqSsfKcUXwqsoj?= =?us-ascii?Q?FvymythvhUuQLnVFEyS5FyvCzZa8LkpR2OghmjzJIA/zM0ulJezcywa7/cAT?= =?us-ascii?Q?QjUp5modn4iz8bsLWvCsF4p0mY0ZXChUVrkX37oj/ODwRs3IDXJFN1DQ5uTk?= =?us-ascii?Q?ZbajUzYuEFlJasUlJr5wNoiBqby8wpi7Nq5rU8xKQNUmwKA5juuFNo1KdeTN?= =?us-ascii?Q?gCK5s8zlTKkSInkKayD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Uiaus6xB8xhCUmy38B2pJVIymiOXcDu+KLR4DzMdqRhX9JeHvcHCvIUNRcVTg3gWX/BhFByE4dEpHyeIsrcaGuUqKC2NTaKfngjodrWXbsqvMHTnCnQw/4dOYezQ3I9a/40uEiCpnPe6E6RfE+p5qJCOOd/pdEojYfEI2qRvfHVok/zbr2G SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2017 03:41:16.0841 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3fdc6060-df5f-413b-8b87-08d537a43614 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: SN2PR07MB2526 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: Quinn Tran clear loop id after delete to prevent session invalidation of stale session. Fixes: 726b85487067d ("qla2xxx: Add framework for async fabric discovery") Cc: # 4.10+ Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke --- drivers/scsi/qla2xxx/qla_target.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 1c219998ab60..0c0453f2ca9e 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -986,7 +986,7 @@ static void qlt_free_session_done(struct work_struct *work) sess->send_els_logo = 0; } - if (sess->logout_on_delete) { + if (sess->logout_on_delete && sess->loop_id != FC_NO_LOOP_ID) { int rc; rc = qla2x00_post_async_logout_work(vha, sess, NULL); @@ -1045,8 +1045,7 @@ static void qlt_free_session_done(struct work_struct *work) sess->login_succ = 0; } - if (sess->chip_reset != ha->base_qpair->chip_reset) - qla2x00_clear_loop_id(sess); + qla2x00_clear_loop_id(sess); if (sess->conflict) { sess->conflict->login_pause = 0; @@ -4600,9 +4599,9 @@ qlt_find_sess_invalidate_other(scsi_qla_host_t *vha, uint64_t wwn, "Invalidating sess %p loop_id %d wwn %llx.\n", other_sess, other_sess->loop_id, other_wwn); - other_sess->keep_nport_handle = 1; - *conflict_sess = other_sess; + if (other_sess->disc_state != DSC_DELETED) + *conflict_sess = other_sess; qlt_schedule_sess_for_deletion(other_sess, true); }