Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp36526lqm; Mon, 10 Jun 2024 11:53:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUIs1Ly1QEBPkOjK1yy7Jj3aL6F8tFoPWERLi79umdyqD6/TorRMzf385SrO+Ub9g8YKBpOzxZhCPHFM8exZavTpxKqWawWliRLRKneBA== X-Google-Smtp-Source: AGHT+IHNtmF7H4nMvYNOXM1cAx9b/KLI574TyU45gl15LJ8gX+tiMIO4oazmbRh+5/4K4fnRakao X-Received: by 2002:a25:b20c:0:b0:de5:50a7:bc9a with SMTP id 3f1490d57ef6-dfaf64a73damr10130933276.5.1718045610611; Mon, 10 Jun 2024 11:53:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718045610; cv=pass; d=google.com; s=arc-20160816; b=mRCsuF6A7q1GHao1+ljZoQ0eUC7ye9h4t1stFNoIl9kfAdgJwEE2Y4/T+pQAAmTIUp 6c96t5nr5Dwl4PT9Bn+IMiiNj0Jrb9WeQdOkehCnxnBlkid3uW4UarcLYQeMTZ+I0CxB lZQUPwUrfNneFNN/CJ70VAV7244V830HegQcLEYbrwRqzcK3r9P3iKlQ18ucW4nJI/zI jGH2MRrnKJV43BFE9qCB4mcNwP542zVJI7/9VSeTuhYWKEng3PFrdiylgKbg2o8n2Z9g XeyzmHFZa32RXVmB3Z188c/PJsoo49spnoRUbheZpqorL43mz1cMryxspLkkIE1QM/+u TYjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nPDd4pHK3huS/bYarDMNvstf9AhHNsvf/CKokouyd7I=; fh=0/voi+FFg46sMUrS+Ymli1nN0PnEgU4oqiUfDDTtbe4=; b=JMLOCIxLNzCSFfpMtfFGYAHSBhaTPM42AyMBXP5vE/UkzsRCalAt0QD6GbD9KuO2zM SD3BM+xfG3PsngXDHyCuXOSfgKxcQjoG86UAOA3w4j93OdZN5K5WELTN+dGeINc8R2nw BeMBMvp1Ah2GhConEePTpIFPU5GCbTkO+gbrzJ9XgZ1ekTACzKZSL1H0n0dGd9PEb1z8 p76y5+7PZiFNRqXo/0Sb/u1hSKTNUIfluKtAynbosZvz9fCjax4zaTD48BaMlqKoLbCl CeGURzHG3S27NZ9hw44uYRtqcykl0ZmnnKDuDrabjUNG2/Lzdp0refuw4cllLvwd9buK jfBA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vF1dyYyB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-208766-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208766-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-44038a8760esi97329031cf.174.2024.06.10.11.53.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 11:53:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208766-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vF1dyYyB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-208766-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208766-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 772671C21393 for ; Mon, 10 Jun 2024 18:53:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20EF912F397; Mon, 10 Jun 2024 18:53:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vF1dyYyB" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42C187482; Mon, 10 Jun 2024 18:53:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718045593; cv=none; b=lkqNrNJic545D1fpj/47H8pXBK1WrEqD6DNDr94WLm0ORmZn7WegIfKWKvJir6yxSD3hILrf3bxNH6i9GtTQR8YPZS8B//cLUqOvcdwqxFEUg1kNPTseRT1BPEuN3l/rXirnCcT5KRqs1/sLA6VsRFWmNiyyLaxRRn3zermiw/M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718045593; c=relaxed/simple; bh=I98Y7QWonOUW8VtV8Ziw+2/VviXGTMMP9IFQ+8hdMEs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lzKPMhxoL44xI9E+Lq2lo2Sh4aRESNKgE5W/pH5vVS1eekr+96EhG3SX49ajUrsbhES/54UFpFJ9FVjUaWmF6bPmgajVTqV9VXJJg2mogMQkCPR0vb3iEajj4BQ4MrDHaxI8XU9gVY79LpDXBRBRq769iCI1/zY6VcxmQ6S/uzk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vF1dyYyB; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57BA1C2BBFC; Mon, 10 Jun 2024 18:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718045592; bh=I98Y7QWonOUW8VtV8Ziw+2/VviXGTMMP9IFQ+8hdMEs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vF1dyYyBlQXhXzGrzE9Q8qLqzLpVrIPx7UXUGQ0gkQdeTfGIcBgXsajqXjYhDQmY9 VS+XAtbCfcZr8bR+7dRQ8vhkd+Hm8JBajhV1Qzi/jygW1VZKQqU3wA1nTQnKnolOFe RbXDw58KdHM3ElK330jq7qK8N2E4QX5RrknLDrqPVxfJStj+mJHc7o9xgOXFRijsOU YiyMdQ3GnvMMQijmMaYh0wyqPv7Cnm1LZCrfBiMbppwpw2gQ29LX2Ek/sTuTPxnP+0 AKkISnLHG/y+QUJUP1VBq3p0WI1xdWTJqG3NcnvQ2LyGZem6z4ZcoL4pB3Z3jp94wg oi8neoB3IIfiw== Date: Mon, 10 Jun 2024 12:53:09 -0600 From: Keith Busch To: Venkat Rao Bagalkote Cc: sagi@grimberg.me, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, sachinp@linux.vnet.com Subject: Re: Kernel OOPS while creating a NVMe Namespace Message-ID: References: <2312e6c3-a069-4388-a863-df7e261b9d70@linux.vnet.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2312e6c3-a069-4388-a863-df7e261b9d70@linux.vnet.ibm.com> On Mon, Jun 10, 2024 at 01:21:00PM +0530, Venkat Rao Bagalkote wrote: > > Issue is introduced by the patch: be647e2c76b27f409cdd520f66c95be888b553a3. My mistake. The namespace remove list appears to be getting corrupted because I'm using the wrong APIs to replace a "list_move_tail". This is fixing the issue on my end: --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 7c9f91314d366..c667290de5133 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -3959,9 +3959,10 @@ static void nvme_remove_invalid_namespaces(struct nvme_ctrl *ctrl, mutex_lock(&ctrl->namespaces_lock); list_for_each_entry_safe(ns, next, &ctrl->namespaces, list) { - if (ns->head->ns_id > nsid) - list_splice_init_rcu(&ns->list, &rm_list, - synchronize_rcu); + if (ns->head->ns_id > nsid) { + list_del_rcu(&ns->list); + list_add_tail_rcu(&ns->list, &rm_list); + } } mutex_unlock(&ctrl->namespaces_lock); synchronize_srcu(&ctrl->srcu); --