Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3530393pxf; Mon, 15 Mar 2021 11:36:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVdrDCgvGqeQ4j42es50ceFd/bt1vpS1VS0DgW+eNFVGKxItR9qQyNblhoSBC7dJYPFBxT X-Received: by 2002:aa7:d588:: with SMTP id r8mr31383965edq.88.1615833402765; Mon, 15 Mar 2021 11:36:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833402; cv=none; d=google.com; s=arc-20160816; b=VPlqS3gwdKGUsPwEdEPvTCQu7MjMXQelKf3hM0+awzxf/mkJ8hq4RwUWS9off9VZwT /5X72/r1G5hkM0H53JQyeVo8J6HmY0AskyyPQeUKFcAlqbGrDDlzWuz/qSAsmCjy2M6c xGqkfe0JXv+2x+sy6i4mCJXtK8M+qTbV1WRPFNRvHtJn8yJjBS6dNSmXqYeD4YKzHUjq RTJYG6gmMCzdFK6RugCjVIhmewJVJLP1ZJyy5tiFX+NtDhsf5GgTiPaA0EeC18FrBDnE frnR2qm0aeZ8sD+ddSiDcB5hSfBuH+DFp4Wrq7PlNXrKRNjOp2dAFGt1Km+umGlrAMVG DrFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WmCr6JlwQDiIanHdqIhmHT/bxqmB6b91dZw4eursRb0=; b=knUTqGr7fC3DQ/pQIDlSjzn7A1QvT8fCA/yippUdiVNsBHCVAtDjBwaEXGZkr5odyE jRLkP8MVDGDOfLvkPTJu5wioQLqO2c+h566Kwzvs0Kdis4PS+yzZt5yorarPPcPJmohu nDibj8qOAuI4K5IxYa/1hkvohCPFN76f+s/jQQOGjJFBRn/jl3O2HnfPz1iTmik8zsKd 0uveiU8WuPqxeUJWMUBsWd9ByohDWl7GT+QYmJ+iTY1ZUTYPCbLgZXXXMuP6CZl3EOqE rqgcmD2eBzyn2V/Nvys/dwDQXrQt1hOm0oCGHCb1te4I//v1JpA4Ro0HrJEd5jypeIj+ SHgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K5UxBkkU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w26si10840806eju.454.2021.03.15.11.36.20; Mon, 15 Mar 2021 11:36:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K5UxBkkU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241029AbhCOOsW (ORCPT + 99 others); Mon, 15 Mar 2021 10:48:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:50168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234488AbhCOODl (ORCPT ); Mon, 15 Mar 2021 10:03:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 67E4E64EFC; Mon, 15 Mar 2021 14:03:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615817020; bh=UcsAEqwzcrROjqapXTx8ABQo444UPYI3CUiTu7H0l/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K5UxBkkUZfWbHMKZEm91ib/jST+59ceDiAO/vMyHDPTxAS/1diUSokLr1Y9ggcixF mwcm1/If47Hbcz0tLxSv5xl5KZK1WgVh5ezx7AGXPdGzNY9Xh5uqlr+son8CbGqDuQ FUTOJGPXbZuwF9ZMQh/2HyzjS4qaWRj783IvoW/4= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nigel Kirkland , James Smart , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.10 250/290] nvme-fc: fix racing controller reset and create association Date: Mon, 15 Mar 2021 14:55:43 +0100 Message-Id: <20210315135550.468382436@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: James Smart [ Upstream commit f20ef34d71abc1fc56b322aaa251f90f94320140 ] Recent patch to prevent calling __nvme_fc_abort_outstanding_ios in interrupt context results in a possible race condition. A controller reset results in errored io completions, which schedules error work. The change of error work to a work element allows it to fire after the ctrl state transition to NVME_CTRL_CONNECTING, causing any outstanding io (used to initialize the controller) to fail and cause problems for connect_work. Add a state check to only schedule error work if not in the RESETTING state. Fixes: 19fce0470f05 ("nvme-fc: avoid calling _nvme_fc_abort_outstanding_ios from interrupt context") Signed-off-by: Nigel Kirkland Signed-off-by: James Smart Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 5ead217ac2bc..fab068c8ba02 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -2055,7 +2055,7 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req) nvme_fc_complete_rq(rq); check_error: - if (terminate_assoc) + if (terminate_assoc && ctrl->ctrl.state != NVME_CTRL_RESETTING) queue_work(nvme_reset_wq, &ctrl->ioerr_work); } -- 2.30.1