From patchwork Wed Jan 24 16:07:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dupuis, Chad" X-Patchwork-Id: 10182781 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 E76066037F for ; Wed, 24 Jan 2018 16:07:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4E87288F3 for ; Wed, 24 Jan 2018 16:07:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9271288F6; Wed, 24 Jan 2018 16:07:16 +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 363CC28909 for ; Wed, 24 Jan 2018 16:07:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934224AbeAXQHO (ORCPT ); Wed, 24 Jan 2018 11:07:14 -0500 Received: from mail-bl2nam02on0060.outbound.protection.outlook.com ([104.47.38.60]:28128 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934021AbeAXQHM (ORCPT ); Wed, 24 Jan 2018 11:07:12 -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=3PlRIFgkb0ejDxrxbWx8T6deHNB2XeySBhkhXk+9KNs=; b=WXWC8N26s5LXYaBuU7n8kgUSaktDVOQyDHGCooLdrQYTr/i51feKEbbbGiBfC/qb78BCPYE60/vANFCIxHh8d1L3wLrNC23Cr9+AKeyXhoUfI6t/n3dJkW4sDVDl8yoAPx+qyQko12vaxsjxPgE3Zq/YKhp3vWluK7bLs19Y4ps= Received: from SN4PR0701CA0001.namprd07.prod.outlook.com (10.161.192.139) by BY2PR0701MB1943.namprd07.prod.outlook.com (10.163.155.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Wed, 24 Jan 2018 16:07:10 +0000 Received: from BN1BFFO11FD013.protection.gbl (2a01:111:f400:7c10::1:102) by SN4PR0701CA0001.outlook.office365.com (2603:10b6:803:28::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.444.14 via Frontend Transport; Wed, 24 Jan 2018 16:07:10 +0000 Authentication-Results: spf=fail (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; oracle.com; dkim=none (message not signed) header.d=none; oracle.com; dmarc=none action=none header.from=cavium.com; Received-SPF: Fail (protection.outlook.com: domain of cavium.com does not designate 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1BFFO11FD013.mail.protection.outlook.com (10.58.144.76) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.428.12 via Frontend Transport; Wed, 24 Jan 2018 16:07:09 +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, 24 Jan 2018 08:07:06 -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 w0OG77Jc032735; Wed, 24 Jan 2018 08:07:07 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w0OG76hu032734; Wed, 24 Jan 2018 08:07:06 -0800 From: Chad Dupuis To: CC: , , Subject: [PATCH] bnx2fc: Fix check in SCSI completion handler when reqeust has already timed out. Date: Wed, 24 Jan 2018 08:07:06 -0800 Message-ID: <20180124160706.32700-1-chad.dupuis@cavium.com> X-Mailer: git-send-email 2.12.0 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)(376002)(39380400002)(346002)(39860400002)(396003)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(8676002)(107886003)(81156014)(81166006)(5660300001)(8936002)(69596002)(50466002)(59450400001)(16586007)(316002)(42186006)(80596001)(6916009)(1076002)(48376002)(54906003)(50226002)(2906002)(47776003)(105606002)(2351001)(87636003)(85426001)(478600001)(4326008)(106466001)(36756003)(51416003)(305945005)(86362001)(72206003)(356003)(336011)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0701MB1943; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD013; 1:uXjfgE4Rsms5ZflLecJUquJkkIUF/owwHqWbqgc1MjEg/79IIgtoEDQ4ymnG93M/wQP1R1OkTrGVzu1zdtJfAsXx8BonPJRkg7AiZFW/Nq2Y+r5hoPl6eOLtGLNZgpri X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7ee4e535-a0f1-481a-bf9b-08d563448623 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:BY2PR0701MB1943; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB1943; 3:Z9TUeMNrZdSl4tEatSPGhre6QVeplQOVogbbWkbjuPwUmX1whqk95975BsJjs5qYrctVam2uTOaHiRKEQMnBSjifl52LmTTZ1xhVUAhmi+uhtgxT3JrNGWO8gyHcbns/FEGLOlRZE5bmnhqHozv76t3rfGvx47a+TeIwmvTqGtw9s1aV/uVFYfCJQIgXdeALKJh4oiTbxOjnJ2EvKUTMSwK60kEF7Xg9GKSNPCFeghsV2l9TvE34IfdR299gzwytH6piPNxYAPGDZceNMk7kp5jNVuKP57QrisaSyVleTlxIe5XxBonKMWDi/CsCLwc4qCKXQh82ljCsyzK2kjICozRYFTmTqv375+jkdW5z56c=; 25:zEgY0s9/m/YQaaINkMI2pr8xTEpKyIgAyd3qRSigtBxtsxyOW9DifXEbW48ejTsQ+Pbe7xwf9VLdIOibCMCyO0joNJeFNwWZ1Wy4r1EtugtFBCr/ZUZkI7HSaOpszFz71PBxSwNgGNBc/cWzLGnqml6gGQ5UQBrM/hKxnQGo5x8PiHkKxvXt50mrAF+kwO/hXQeX0ZUrMZ+H4ILJua6F4+srrhDAnRpwG7QAPEogroM3QPEfgQ8N4k9LZfxsREyz+2quYXCt0AXn7jdRkxHlBPXP4nXh05BYtVFloROzfQgkhYnYpsCoPzFTifh9mZUUxaidP8k/qOsrOV3QR+v8GA== X-MS-TrafficTypeDiagnostic: BY2PR0701MB1943: X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB1943; 31:yfE9knRRQyiis5kK4Lo9HqBkcRSb7sU/eRbVV/CA1COvMaR7Dnbf9Xk4s/9ZP8O1gGroXbnREi/MWiuXbia568ftyFh6S+grAE3OEJvMFpAVFz4dnlkAGRUc2M8L1Uj7KlNGB/ABJb6f2bYhGwmBToBNRuqME0dVoQHpldbbgoQkNRdKgPG3GshCxvMary6gmY0l9pCcMHsXn7cgryT884mLygS6LsQFYuZxZcpdtG8=; 20:To7J3FA9wkutib2MTXJ+Th58CKEbqI5yXqAD813DxoMyxWrsC2MEuyJhObmMbmwgH+Bu6RYlrjff4Iv58EHvE5d0AT8frfBYpD6voPklMO4DsfDVoQ9sBspiGFH53t8kOpI1RV4qYN3zuA4I+NeA+PrTzOYP6tzjcUxxaJwJTBUIl2V0aNNvs1DRUTsZX3XR1Ef9MbtUMmsnZS8ef0jaGS7/jYdhagXkYWWqVXLkDZ1sgNUQvoUZtg0aXNx0AZcpsb1rptaE170R8drZlWPUotB8pKlDIhUpyqfFsZM97zdyyouOVvhJX6nJJXkohU6B+qVg9h/nxbOGYoKWKYxpMhhawurJDVHgrNX2uqr+Qsg0ZCZ7DJG3y/k88vXlxyywFvQtPJJHqXwP/KAGDjbpuNlSN5ecrjEb87ilunfUjA6RXaCDXcUTg1Jitlm+HRe6KK/THa0fwHI3xdXrFZ/zSANZz64J8T0ZIKxqhDVI8VWEg7WOgDD3nR/3QFrSAt3k X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(60795455431006); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231023)(2400081)(944501161)(6041288)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:BY2PR0701MB1943; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0701MB1943; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB1943; 4:SDro/nj023jdNY58MrpCCSFQXbsxv7K1F2gzazDBk6XUO7hntAsHxPzSR8iMwII9IckVY05dpMuTX9qqxNs0GK22eG329qmTtbxG7obEi1qhKA3TgErPnkP50vZmNP/pkuU0j87c3cQ0r/enyx88EREuguKrRCogbyMFVO6Sk/hJSdDLDERCeRhGhU554gJVULPr7aF2JMAU1raVhWF5Tg/nGqJZTuTV2Lc1khHau3lLR0BffPe4cfjMWWINUxQPYPVajHUXVeSpt4QdqetHzYSCmLn0NhddII9zSynbaEuyfOYXYJUGF9DNqv036sk4 X-Forefront-PRVS: 056297E276 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0701MB1943; 23:B9zgzy3llXgM2tOBMcK5GUVEwDAt5rULirqQG1e?= =?us-ascii?Q?z5rV4XHEgV4//JguHCVf+Zq0vnmOqkCZcvVtLV4wybq/nW/Uk9O3p2YupWaO?= =?us-ascii?Q?kAc2stjTFx0NI8CNi2x6+DSGrAByb9Nb+qnUShHZF4tU2Q56sC5pKtaz7mxm?= =?us-ascii?Q?S2JyvJYmrUOsArjv56mXVRQgG0tWKwzXibDb+ALxN/WdwOIhCEjLFDaXjJPL?= =?us-ascii?Q?uqei6nAirs1Vp7CyaioxUu6tNsFDjl3um+b+qZ/9ZXhQL1oo3+KQlAYPltdZ?= =?us-ascii?Q?+dIpEzqVrypaaW6Stu1X8VS57n/z+QkgK0isWpjvSs+E1tAcKZWCY2RVUglW?= =?us-ascii?Q?l8fnWaywWu/lj9Rzg8A2tGTXoxxoUPfQywpkUaV7IQf2+4KkYtcoo/0WwN8l?= =?us-ascii?Q?eDiEc5giVqb4wdop/Djg9ax4K2rK7e1QkzGrfiQpM160wF6ijqBqpAcoB2ec?= =?us-ascii?Q?rK6++qstxhTEbooFS50ruxqKPH/T99SYuJzRD5tDQyknGx8qC0ViDSs6NQyk?= =?us-ascii?Q?LRLpWZncy396kaDAvs/608Hkq7Rr6n1itrJBALJ2hpq86qp2Mnkr36YJwZnr?= =?us-ascii?Q?9sXnNV07aR1bGHD0lcSYc0AKtYFLo+WVGkYZWx63HTiE4gp+Kt7V8QP0qBWG?= =?us-ascii?Q?NWyvFzszfY32kCZHHq+RMJKzIGB9nRDGpo91bs/wU60H2775at1pojdFR6so?= =?us-ascii?Q?Joa9zMWutUsvPpYRowW6AQUZSX+1vDpk7ysFewm5opcHLhH/50yHYvNCvUgu?= =?us-ascii?Q?BjmnLYC9GmzPhdsqHyQbxdJhd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Xz2zI07va4Y1wQpdotE5D84McrvMxAuCeTZrP3zUUAhdT2CqGfPGlrEPEeeMzq6fuT5WsbL9P1fEa0ktLeMOm1+rJUiDvff6PNSbUYPaNbGjrvgAvEJpsAj3ugR7HOqGsZ9BkFL+y9eBBW5YvPBBRga+od4zzaqs6LEKKOQDpKr1B0FI2XPmEo6divrPDTKI215klVDGJHvM4ZorszaVBaZx0JDF8K4ELHG97ND0oJHEGv/Dmx7c/G SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2018 16:07:09.0664 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7ee4e535-a0f1-481a-bf9b-08d563448623 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: BY2PR0701MB1943 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 When a request times out we set the io_req flag BNX2FC_FLAG_IO_COMPL so that if a subsequent completion comes in on that task ID we will ignore it. The issue is that in the check for this flag there is a missing return so we will continue to process a request which may have already been returned to the ownership of the SCSI layer. This can cause unpredictable results. Solution is to add in the missing return. Signed-off-by: Chad Dupuis Reviewed-by: Laurence Oberman Tested-by: Laurence Oberman --- drivers/scsi/bnx2fc/bnx2fc_io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c index 8e2f767147cb..5a645b8b9af1 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_io.c +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c @@ -1889,6 +1889,7 @@ void bnx2fc_process_scsi_cmd_compl(struct bnx2fc_cmd *io_req, /* we will not receive ABTS response for this IO */ BNX2FC_IO_DBG(io_req, "Timer context finished processing " "this scsi cmd\n"); + return; } /* Cancel the timeout_work, as we received IO completion */