Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1941096imm; Thu, 24 May 2018 03:18:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqbgn9nGkLoRoGx6KXUeRY7QKarm52kw9VF3jJbc2QRVIE4klEXQiT7E1mnaWEa9O9uukWC X-Received: by 2002:a17:902:8c92:: with SMTP id t18-v6mr6777702plo.337.1527157100711; Thu, 24 May 2018 03:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527157100; cv=none; d=google.com; s=arc-20160816; b=dg7JiW/o4ftLXRVaExKbT7R/qH7pnpOFGeh8m5rNeM0kae2T1V1nxK4Buz233ZrhMu Pma71L9cqthyLn6hs0BJMs79+7ASavl/3tXANqiEkC/d4WXt3yCIAhpJQfnwBYun48+i M/QiGoJo7P1xetWxU74MmHY55l/4uEJ/UyBbpSw7tSMIulo1CvRNWGhDM+xdDqIki78H IGHueL04Qkwe7NOKuyhF3HgYI4hSzHcAajhph9yvk3QdKkpL7UmR5JOb7LIjIlFyGCVr Oi949Q0OXr2w6kDeRFLgXKyVfX/t7/eNcfUhRPnSZAFEI9xDtiyvfEK32Vro+FYgEtuu z8EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=0TDW4W4BRkLohQw+RlNdjdgpj5ZbBjcj5jRg1M+uXOE=; b=R/gjX0gD8swgO/sVO3QOikBdKBt/Ves1Rw79sA0EShZ09cZzda67ZgLc9JFbPgAZ0G 93xF2YYhv5FjGjb9zl+QTM6kzCQ6xGkYLNHOte484tftM13DRLNHIH+dcDdFlPekl8It 6W8sFhyzXrZDYwdyis3h8Q2K6xORbjTCfAkt+EnakRnP8tTkrTjazhjjD++GxAIv5AwN nwCkyuDu6J/Rc8p/RkZbU3hiYMn5G6WuuRzUSPiNE2Pgr/89WPouBnbrY0J4rv6dmB0R uU9dkIPg43PKLEoHFaIohQbxZUpXTcU51aANrfTHJAlQRM8b6mOxG3d70PcQ7UFdN1wP iohA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jFEIFeKM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x17-v6si21304979pfh.354.2018.05.24.03.18.06; Thu, 24 May 2018 03:18:20 -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=@kernel.org header.s=default header.b=jFEIFeKM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031827AbeEXKRV (ORCPT + 99 others); Thu, 24 May 2018 06:17:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:53422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030922AbeEXKD7 (ORCPT ); Thu, 24 May 2018 06:03:59 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D925D20870; Thu, 24 May 2018 10:03:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156239; bh=+LNeqcUMwKXPr7RjY7LLVSwVrTEJ1eaxGjuJT8CbIAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jFEIFeKMVEpJMYEUL4fAuyVlWC+1xvxAfhg7WEJ4gn/YPzcKAUFe9g+8FnRM48+bz ehWfXhokohY+q30QnIjr87WKiUNYcwbFoldZozqdJXBb5FpavWNcgW8h7wRw6rM/rB EhBbKzDv4eV4RXyO+/jvzGVE1GRoznUfId/KiQCc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dick Kennedy , James Smart , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.16 115/161] scsi: lpfc: Fix IO failure during hba reset testing with nvme io. Date: Thu, 24 May 2018 11:39:00 +0200 Message-Id: <20180524093032.113712063@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: James Smart [ Upstream commit 91455b850956bc13708a074bd1400f54aae74890 ] A stress test repeatedly resetting the adapter while performing io would eventually report I/O failures and missing nvme namespaces. The driver was setting the nvmefc_fcp_req->private pointer to NULL during the IO completion routine before upcalling done(). If the transport was also running an abort for that IO, the driver would fail the abort with message 6140. Failing the abort is not allowed by the nvme-fc transport, as it mandates that the io must be returned back to the transport. As that does not happen, the transport controller delete has an outstanding reference and can't complete teardown. The NULL-ing of the private pointer should be done only when the io is considered complete. It's complete when the adapter returns the exchange with the "exchange busy" flag clear. Move the NULL'ing of the structure to the done case. This leaves the io contexts set while it is busy and until the subsequent XRI_ABORTED completion which returns the exchange is received. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/lpfc/lpfc_nvme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/scsi/lpfc/lpfc_nvme.c +++ b/drivers/scsi/lpfc/lpfc_nvme.c @@ -982,14 +982,14 @@ out_err: phba->cpucheck_cmpl_io[lpfc_ncmd->cpu]++; } #endif - freqpriv = nCmd->private; - freqpriv->nvme_buf = NULL; /* NVME targets need completion held off until the abort exchange * completes unless the NVME Rport is getting unregistered. */ if (!(lpfc_ncmd->flags & LPFC_SBUF_XBUSY)) { + freqpriv = nCmd->private; + freqpriv->nvme_buf = NULL; nCmd->done(nCmd); lpfc_ncmd->nvmeCmd = NULL; }