From patchwork Mon Dec 4 22:45:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10091721 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 5DB12600C5 for ; Mon, 4 Dec 2017 22:46:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FABD29387 for ; Mon, 4 Dec 2017 22:46:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 448A529446; Mon, 4 Dec 2017 22:46:12 +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 D4F2829387 for ; Mon, 4 Dec 2017 22:46:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752283AbdLDWqK (ORCPT ); Mon, 4 Dec 2017 17:46:10 -0500 Received: from mail-by2nam03on0088.outbound.protection.outlook.com ([104.47.42.88]:37712 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752050AbdLDWpw (ORCPT ); Mon, 4 Dec 2017 17:45:52 -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=ceGYR7YVh5RyqYpdjJRh4fFQT4bfu30eqWHrb+Dx7ls=; b=SHXgtLgakg0lfeqU/lairzKTN6sWMLMdFpBZRw8FBy9Tca44gKrGlx+E7eScJ9LAX7xEPiGYLJXoypO3H7ULjuS+cQGQCLhmxc3/BeoLKrPgS99qLKaCeJwxhw5tUi1A/dqCAQ1e6v0OCKNxBPmIbB9ztIQfF0YlUDbm1C5G0m8= Received: from CO2PR07CA0059.namprd07.prod.outlook.com (2603:10b6:100::27) by DM5PR0701MB3813.namprd07.prod.outlook.com (2603:10b6:4:7f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Mon, 4 Dec 2017 22:45:50 +0000 Received: from BL2FFO11FD054.protection.gbl (2a01:111:f400:7c09::161) by CO2PR07CA0059.outlook.office365.com (2603:10b6:100::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.282.5 via Frontend Transport; Mon, 4 Dec 2017 22:45:50 +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 BL2FFO11FD054.mail.protection.outlook.com (10.173.161.182) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.239.4 via Frontend Transport; Mon, 4 Dec 2017 22:45:50 +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; Mon, 4 Dec 2017 14:45:21 -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 vB4MjLJZ003513; Mon, 4 Dec 2017 14:45:21 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vB4MjLFj003512; Mon, 4 Dec 2017 14:45:21 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 17/22] qla2xxx: Clear loop id after delete Date: Mon, 4 Dec 2017 14:45:12 -0800 Message-ID: <20171204224517.3409-18-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171204224517.3409-1-himanshu.madhani@cavium.com> References: <20171204224517.3409-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)(189002)(199003)(101416001)(8936002)(105586002)(189998001)(50226002)(80596001)(2950100002)(69596002)(50466002)(33646002)(1076002)(86362001)(54906003)(106466001)(110136005)(48376002)(6666003)(36756003)(76176011)(2906002)(4326008)(305945005)(356003)(5660300001)(8676002)(81156014)(81166006)(47776003)(51416003)(87636003)(316002)(42186006)(16586007)(72206003)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0701MB3813; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD054; 1:qc+oI4A2c0hpDBWub1NC3AQdAwU0S1CCoNdY+lcfob0XOO5VGQy8FV+Bf4/tcOMRhuSRMM3ATB0QJkQTtG2bSLBdLtfb2HLenQA+bqyQ9+1e03w02q7bRRaSoNb55JnS X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 00d39d04-e966-472f-de3e-08d53b68c49f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603286); SRVR:DM5PR0701MB3813; X-Microsoft-Exchange-Diagnostics: 1; DM5PR0701MB3813; 3:Oi4tkoJaVCtdST0KSHDAzneDOzh1j4uygvHdY2NpDq5lIpNl9tt26NL/didP0f2Xm5naEKO1VA7HcQm0Pmj2DaPwTu3ls0SUdZZL9eYAPnP3wSr0KgUjcv3c+VBj/U4INwlq6ZfK3hblsPJu8qjkUq5qokrKh0ETN9HVC1X6hhwWUFJd76RM/jWSAui4W4vZn232o88mT2B+TxcTggB8gfniJE4A4g0AyX0MSuzvcsRSxbecjHid/w5iUVC7V2QVk84zO9jKV0rIysIttRUziDMx7qUhKQqmSv4NEe+nYHIvmUm6ELj2f4vabPOU7b4yo6FUp6k0knU4nreITD7mG/ikr7NqL0zHDeYm9tkfsrM=; 25:J1I0i/8m2w5AVp4za09SS8rwiNZxIL40xLsewGfBa+/ZW9LncqLZDVBj1Vx7uncs3Z43l+WbT8MJ3jSKcsgx19J+jgP9YpjQexc9DUDPgEoEzYEe09jLqGSer6IYcBroVIabvEYNWPcHVBAVUavpYquAKRuIga+i2iaFG14d+oom1GAvk75vwNSyvCeoNNqo1teJ5bytLrBgXeEP+NEwhLxCV3C39x4Btx/FRsveXgpy8ZfEC283VwK+4mCEZx0Fy1N0mvLx8CI2/O5CbHlqRaywsR4FyYQ8v9NFggJp3Q2vkPeU+uUwfPuGKY0nBOgNGhV5AyEiN+5TMJKjqcZrxQ== X-MS-TrafficTypeDiagnostic: DM5PR0701MB3813: X-Microsoft-Exchange-Diagnostics: 1; DM5PR0701MB3813; 31:8twi4u9khYzu6HXaTQ7LcbhBI4+OR/yWiBdS0N/i8GZz/P01SFTygwez6nuXsOi2mTywvwyfcfD9GHo7mfCPJ8z82yeHKUJOufTyM2PfddrMccv1CACHBqS+DAv/8/AzrVQUz5BCQikHVBANYq+wXswbQFc1YYRBL5GgtfwayN8Il92L7s0iu6/qpuwax9d8qSIzy5K5mwrIZcBlRvClHXJPwv8rc9WaDdsqFTWBFzM=; 20:Ozsf1LBzggQG34btLsrHrATjz5w9PEBGUA3XIaeRPIg2/Yc2nQyGWTTMBDAuubrs4I+y5bHa4ueCf/bODVGrIHKi/Qu8ru3hbjYLamoJxNnH0kMUklXcwCxu6Gz6XQ/Qx8cY8T9VRcTCGdcONcjtDKyCt9keYxk+jJqCXFN0K05pFJhvWyoE6SibH8PZSjZi258ppebNPjAb/XdgGatQVE+Jmw7I2vGLMmWiKwXo8FtRBQLbAKQFUQwr5cGC7zZbgAtvNL4db8Mdi8cmjUJQ34dDF4xP27FYNM5ua+3MxKQ6eHek64MkTeTt0/+PZvU8BJs4YtKWS1WvHNpmwdBbzXXFpqLnDnv+DZXyb2XjHCSF7cZzzYWAWiReGL/WeMxczmrtYIX+grD3IHvU0rqTlVhLxHwKynzKBSZoB0xerUk28NETODu3H1/DWdrNJ25XbBx8gVsF0+0RaAGe/1IaIbKGjkxONTgA+IJA4xEVGKksXS6NFAQa2xYgclQYiLH+ 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)(10201501046)(3231022)(3002001)(93006095)(93001095)(6041248)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123558100)(6072148)(201708071742011); SRVR:DM5PR0701MB3813; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR0701MB3813; X-Microsoft-Exchange-Diagnostics: 1; DM5PR0701MB3813; 4:aUXSZkIq5MFAxroySIK09+TEfbEBsxlKExSzVRsEoUpef+1zgaMz0pZ24yNwr+c+BDMsfeTnBJ0WIsvSKZ9sMt6s+Eb34LDqXTtO/fteim8qzf3u2mNGt3MuPx0PgWw9nqChCzVpis+Pgwwwcqu6MBH4pSEY68hg2IEsCEngA495EsRmYBB57i0Z1PXLgJZWKprcXD9dGxPOcZk5IZ/fm2gxPvEimfO82tmGx3Ts5DAPP3KeriHBNrGNqBchPHlewyToHsJCSEigrGKLDg4CPacDqpeyKG8q+DnifMRJX+UNESHRkp4aRnUO49vmtM7v X-Forefront-PRVS: 051158ECBB X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR0701MB3813; 23:ghd3cahSvqcZRdEcbVy+Z1ZqqDtSGo/CcEF+600?= =?us-ascii?Q?OZ0wHX86yA8BkYasEzT8MoA/JgeZXPuIpYSZnk4hUeOABD9JY00Yx+PJyMEm?= =?us-ascii?Q?9fuXcvdJESEjDCVS504njYf40BFR4NOxxTE1OJ72gucT9N5x9lHJRjTCqL8H?= =?us-ascii?Q?1Ma+mUBQi0U702kRDNV0ZJFlwf9bk9y1viYNyjV2nBVpahGSo/jaEaRev7Sk?= =?us-ascii?Q?2UYK71a5herKTGNgzOdqt7WoSEkYf0cIY3rP9C2DWki1tm54ZGlA4esqrP3u?= =?us-ascii?Q?i4xjjgfsoKPJL0vYorruxdnvbst8pwK45qeuPG6ik7n/ZlpKumkxQyLR4L2K?= =?us-ascii?Q?WSIi/yt3f4qJ6QcT6iTR43t8y/lLhRd/ZqjcHXkHY76FdesI0hxwVjO/cabh?= =?us-ascii?Q?qfBE6SiPAbgvyqKzcabkWoAGiEcvyOb5BqKuE5XlU46bA/GsP17msBuJ9ARO?= =?us-ascii?Q?y6SBDdcToSy/CcqLusrdVu7k1st2oKsV5b4AHKSEEIYYa886p+Umw0Xwn/IH?= =?us-ascii?Q?jZIi5S+mjPXF0qnE8wl6siEo7YGDyE3+IgHozQXeCJGV8eSf4jLPEgbXpjIG?= =?us-ascii?Q?sKnz87Og+uHWUolfbJROl9Ox6wPzxHqmO8uyogQEhMPmgI0ICUMjXwjll5UZ?= =?us-ascii?Q?Ani3GtXfTGIhLpJcLo9vcOof1PB0jiIQ20aaf9BqOrsvan5BTUujJr0XP6gS?= =?us-ascii?Q?+SZctj6TEM5aBAivr+7hX0XJEROrTQPw5xLWrDAGE5Y7Pnjs3K6mQJhDz3nY?= =?us-ascii?Q?KYt3jZyg3bY0ABIyM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UA0YC4v4cN+3RP7/qWAk5D4xeeUIyJSW8dkpQogYkoVN6g2apnOTedYPZabS0f8lZCE0tgPyfaQ7mExjrtuQIvvk6gneEKbNW9bx60lQ9mRvmCxh8mSkSJoQeVp9P/tGjrFj2Cd90A2HgZ8PZK4X/eRai8kljvh SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2017 22:45:50.0498 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 00d39d04-e966-472f-de3e-08d53b68c49f 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: DM5PR0701MB3813 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); }