Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp57974lqm; Mon, 10 Jun 2024 12:34:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV94kzSdklcbcI5BOn8l/jIIM2RMwQJoj5tqS0DCrylsF2QXZy3OPrWieB2W4BN5OFzx7wMi/8Pi7QGNZfyEEUONhC8YLrhmZj7T9BUGw== X-Google-Smtp-Source: AGHT+IEHBbuey+X0EBRhJ7dMq5wLnuXV1hbp7u+BfL4k0LiD+kqHtQkPXm1xnS7Nz34BuAfFZrw9 X-Received: by 2002:a05:6870:3310:b0:254:7dbe:1b82 with SMTP id 586e51a60fabf-2547dbebf76mr10359736fac.48.1718048043763; Mon, 10 Jun 2024 12:34:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718048043; cv=pass; d=google.com; s=arc-20160816; b=OXv8xz9oyBfhmu8EUwciAiD5OM/fzlu8ppg7VSNXscOxewvHgAwh6t6LP/YJBRkVt5 IPvF4fFohRLOgF7BobHJ94JF7GOm02sIdEkRRP0phSqSdC7Go/2i9ku9LPf9OwQerP3Z /g0Xd9zANLH4U45xQpRwz63rV/r/nzbqggMOEczaLktA05FjpCZG9ADkAQRd4+UDrdb1 zbgW8BLWMM2ICBgnC4IXNjfXTRpFsB8/NPXAkd/0BEAeDjbjIPlmdBJKa4ljfXNAEEYU BO8c6C5YM0r21tgeBHopJTc2hAj0keckXVSswsBaE21RLaRr0ZJHZs/c5S3OtHlseXX7 2eQw== 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=0auTPA4vYidS64dKlGZ2iuWsz92CCvwlVwRB7qaRuYs=; fh=Qk9SgIMWl70BZcFuULjbN89U7ljdVRFuOwKCaVGjZjY=; b=hrLn27T+M1cIyVtt/uODPggAs56O3A9k0+JAgCuxzuuoBVY6X+PRSp5DcODGM/BY8E 69P5Pze8I94jtNHvYyo5eqKrQpqeCVUY/tN9ZOvurebDNUXZosUD57JYjN/Un2xSUCLe MBm3lf/PWm/ws3ZCj036sssuu4SBRujgQUAvmkpUn3CPxXkuIujcTOWxet2+LANpPX8w nhHDaJ+dBVBObnUDljDHL4qEWqaSuXA1+poZOjVJNRaRAxzUin0NHmN1KhAejwkXuJjb PX8khRQtMcTwDPv+YeZOm1wiUAZsKtkRwVql+d4JAjBKe8g9TWOPUQKnByPoHD18UhGF h91w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LRkBnj3q; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-208804-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208804-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 af79cd13be357-795597417a1si588835885a.53.2024.06.10.12.34.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 12:34:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208804-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=LRkBnj3q; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-208804-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208804-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 750D21C21AAE for ; Mon, 10 Jun 2024 19:34:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E07C314D714; Mon, 10 Jun 2024 19:33:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LRkBnj3q" 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 140B72230F; Mon, 10 Jun 2024 19:33:55 +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=1718048036; cv=none; b=idC6r3zJdekcf7SNZbp5qhAiP/KfIcUUMRAtSPmMkVvWQU05+Fjl6XDJx4EnYMMQcr2lWQkRj4v3/mdkSb9Grh1abibmbajMLPlA+Sq/Npj0TMA+glsgloljslXMu3XQWUdExuXg7ykCC+kbTqpccybRpVjVkCGw7OUKcu09B+M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718048036; c=relaxed/simple; bh=Qk5Vp5/sI/Gldp06bVN/w//AsSVkw1JHkdQm2GlWS3o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BaAOAV7FyirTcKvqlJvu3ms57Fq4yNZOTLz+tcTQxYISH2UMrVbE8qbyKx3Fik0E3QXedKjZhu8BDS7NuqKvkEjiPXgc97j5II7bRH5g97n7mdZghYql8rjY/Hl30WNwhH8woqBHZhKYFvtmOuU3wxSlsDpCYwZaB1FCDMosOUo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LRkBnj3q; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24A64C2BBFC; Mon, 10 Jun 2024 19:33:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718048035; bh=Qk5Vp5/sI/Gldp06bVN/w//AsSVkw1JHkdQm2GlWS3o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LRkBnj3qKLzKtc+3T5Oij/zRoN3CPoJC7GS5nVXb/86MZithcRd6sMyUvqmLiuTQq pfdjVpplwIOj0hgPBKTLQwNVOUhWufQo/Nz3EGhkIw2Ap9qq7/2KJiSQtwlmrZav/R Y4Fjx471dGhT/sWZ1ydiRA/gIiheH19aiatm3VQ7oCBB0M1L2INCSzXPTB6ja5tGj1 /vpAeA0tVtZw+i9nFLeqRhVi/DxX43c6938Ok5M3vcZPiMG8cGI3+PxKTyXelp9dry MTyJEFng7Av4ucas1DQkJXLVpsQchgXgwgVtzS9X1c5qBRcisVuz5DZ6Lrs75vPqhd TI7lq1JrELaNA== Date: Mon, 10 Jun 2024 13:33:53 -0600 From: Keith Busch To: Sagi Grimberg Cc: Venkat Rao Bagalkote , 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: On Mon, Jun 10, 2024 at 10:17:42PM +0300, Sagi Grimberg wrote: > On 10/06/2024 22:15, Keith Busch wrote: > > On Mon, Jun 10, 2024 at 10:05:00PM +0300, Sagi Grimberg wrote: > > > > > > On 10/06/2024 21:53, Keith Busch wrote: > > > > 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); > > > > -- > > > Can we add a reproducer for this in blktests? I'm assuming that we can > > > easily trigger this > > > with adding/removing nvmet namespaces? > > I'm testing this with Namespace Manamgent commands, which nvmet doesn't > > support. You can recreate the issue by detaching the last namespace. > > > > I think the same will happen in a test that creates two namespaces and then > echo 0 > ns/enable. Looks like nvme/016 tess this. It's reporting as "passed" on my end, but I don't think it's actually testing the driver as intended. Still messing with it.