Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp889084pxj; Wed, 16 Jun 2021 16:23:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrrs1tqNl570YGxXaySLbVdR8fDzXcuz1SB4QRyS5TXirGEDLFNBtBgAZ3/JbFwVtjABVq X-Received: by 2002:a05:6e02:f41:: with SMTP id y1mr1318155ilj.305.1623885791309; Wed, 16 Jun 2021 16:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623885791; cv=none; d=google.com; s=arc-20160816; b=ba4oStYKrqzYawef/E/oT0cXeDti69+STwQO53Udj+qxT3XtZiGAwcqL6pnQdV0eRe 66ZtVtao4AH2CVYr3gS8R84RrKZKaX9FgNI+G0njLn6eTUhuTJpCRFHv/rgbj8UWBg5R fnfmQHi7D+UFzN4eNIaIfEQpwkk+9iwqHT6kpRvRprCUG9XaOKLn+mangs2HfjKlGYh9 EQYy9UL0MkGdB9LnTnb2kR0/tqvLTkR1myZ1xxjfLWcYb0K9CeyHjqkAFpKn6JwMU53W HS6P4EV9zU/jncvDP20IIw+A/oFkJl3p+FNSFRRLbiNUPHzjzqNgn86GF1EbxkWRBcK5 /4Lg== 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=JorA+lLf6BxxZZOGsuPrEQujV9zlyWQsdPNl7wLAysc=; b=IJ48z1Dz3gA1jh2KeqPz19BuWzXDlR7KnPU4GsVZq27dMWOIQdiDiOzbcLeaiOGlx4 Z43y1aHghkFLzBAlNI4y404kEUp2pfXcRYDlm//UsebFM0nINOaK8lFJXZm1xaC3neb+ 2ZPCEW8flNfEJubd7WM7A6r+aBBs428YxlckxT6jxstreJpW8SBcBDf7LGt60Of/WmEi WPnQGbhGH7byKSVncZUSndWw2qZ6YyDAcpmsWDiW1KfznfI/yW2FkV22izFW3mFntLZq ex7dC/Y1Vf99w/rJvWf/L53n8lyx/lOmsu3DdEYHd0GparSoOcwVAdSjTwVT3ef7zzFD F0gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UaVlRPhD; 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 i1si4588029iow.32.2021.06.16.16.22.59; Wed, 16 Jun 2021 16:23:11 -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=UaVlRPhD; 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 S235611AbhFPPpq (ORCPT + 99 others); Wed, 16 Jun 2021 11:45:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:56450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235319AbhFPPnC (ORCPT ); Wed, 16 Jun 2021 11:43:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 85EA9613FE; Wed, 16 Jun 2021 15:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623857899; bh=na31MgO79blGNGq2tw8e/gm26XvdqvGPIV3mHVLaqiY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UaVlRPhDIITR+wWTy7BNE2Ub/kZBjpaF8RF3BxIEMSXPaHCoAWOcEEvrxkQW/OPhk PEOoXK42unFQ1v0fuKKA0hUHyT7XPNacb+0NlGPR4dtlqerG7ZmW3x/80Q2hlRncn2 7UJYsi9Pd7xJE8grg2Qin+GTIIoKaQcgo/iGQV1U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hannes Reinecke , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.12 38/48] nvme-loop: do not warn for deleted controllers during reset Date: Wed, 16 Jun 2021 17:33:48 +0200 Message-Id: <20210616152837.852028752@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210616152836.655643420@linuxfoundation.org> References: <20210616152836.655643420@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: Hannes Reinecke [ Upstream commit 6622f9acd29cd4f6272720e827e6406f5a970cb0 ] During concurrent reset and delete calls the reset workqueue is flushed, causing nvme_loop_reset_ctrl_work() to be executed when the controller is in state DELETING or DELETING_NOIO. But this is expected, so we shouldn't issue a WARN_ON here. Signed-off-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/target/loop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index fe14609d2254..0f22f333ff24 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c @@ -463,8 +463,10 @@ static void nvme_loop_reset_ctrl_work(struct work_struct *work) nvme_loop_shutdown_ctrl(ctrl); if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) { - /* state change failure should never happen */ - WARN_ON_ONCE(1); + if (ctrl->ctrl.state != NVME_CTRL_DELETING && + ctrl->ctrl.state != NVME_CTRL_DELETING_NOIO) + /* state change failure for non-deleted ctrl? */ + WARN_ON_ONCE(1); return; } -- 2.30.2