Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp42843lqm; Mon, 10 Jun 2024 12:05:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWt/jz4aEZOycKsdgB5oFmDpkEBonRcqPyczeci7Ba03mtUWpCVtDimi/idV7TZ/fyWVd/7boO0o/TTWJL6geDZ2hvm4KaE76urO15siw== X-Google-Smtp-Source: AGHT+IHXb7WQ7rY0FgcA4v7fvuEsEykLjuduKHbj50LW5ery82jHQKCJoW6FPD/KW3xZJAqY3xt+ X-Received: by 2002:a05:6a00:178b:b0:705:9513:c105 with SMTP id d2e1a72fcca58-7059513cb32mr4158084b3a.26.1718046313322; Mon, 10 Jun 2024 12:05:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718046313; cv=pass; d=google.com; s=arc-20160816; b=Gaxu3pWKcS2LcFKwFAwm1K7zxJ1Mllt+f1khYsL2EdHFnwhT399LMqgHm+x3KIJjVU Cf89GsQOtrnxiHooI3zotQ3FmamCn7YjAFV2zvYzOjzd9NckvnhpnhkRon0x9jYYftfs 3biRQFzCDGHtcwvUlXJwqyjC0pW1qJROFTR3I9fYYx6rWMmB/A4vppfu/tT4RM/Bvn97 BzfJ27BLOFs0+CoUfuKCXRspCrq2cSQokCVErB1PZJ8c9Tn2XMxweeYTX0kWsbKhlguB YVkQlFAoFnuOQki/wCLcoLwCxtz71V2rRedredZjZAY7+iRAS1n0S0+YnNmYHrRKZVLZ dMCg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=RzcwVjd3wuF7qA5HimwlYDFzQ23qzUuT3/7uHPghCl4=; fh=g34TSK3VbBLRkLsZmW6Wfvnftc+2Qg0uF0ToKtKe6rc=; b=hi+lD3pBddDiUBRmC7zCcyWtiDvYQJ+Eo9c7tooJevdqTbFXY355cQ5vnFqNYSKzkr uocfj48ju5cLn/tclMtwX2uqEeuASFqDA38Gi52l5M+cAB8H39gSlhGsJKt/FLhGFEyl 1oEc++AS3A3VMU9darwTOzDwGRfWKidRBib1HnWl85jaMt6brJRi4rlZaYf1+wlxibX8 SS8xoW+b9GsO4U+GoK+MKJdvYMRt8LEdpfxb5UdbQnjUt3dCkgWpR9oNm5UD58W2mAZz E1EmKdP+QggDVReghoBSRE3QuMislYhMyjRsnKYqs6X2ZFg0DPTCDBqIzrsAP2JD8qJ8 nJ1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-208771-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208771-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e96e3aed3csi3811730a12.717.2024.06.10.12.05.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 12:05:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208771-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-208771-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208771-linux.lists.archive=gmail.com@vger.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id F21EF285162 for ; Mon, 10 Jun 2024 19:05:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 56F8614C584; Mon, 10 Jun 2024 19:05:06 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40B421B5A4; Mon, 10 Jun 2024 19:05:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718046305; cv=none; b=sTV5QnvsuW/It3EzX2ttk5FnN5XkCtzkergYH0syAB7u8uCxhal2yODriqOxuy3Ftm4EtyXqKtDdCjJVrUiwLH6B8poOUdHFlXnS8/qtMJaNtoZ5Zx32+8YyKHzwmv4hgjK7rWQNeuva3PCq24RimIZYIRrvyxAt0N7yQcBHOKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718046305; c=relaxed/simple; bh=DYw5X4U5HLsZyrnq7FpFUJMkaKGQJYDLUdfj4fuMRHg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tmUa+Ikq0UMKs8X6FAGcl08wTJn+VRkykEZ53rLnBuuyB9egzc+maUbbd3jndk5dxFv9XDPpm7U6nJS7W/zEt9K/KqAUevu2VDn86YeWUkCUPAah6y22EHCzy7S7QADdY7wqQ8rnX98uEiAXUhLPBHTAeU1GO12DgN3jQIQQ3+4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=grimberg.me; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=grimberg.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-35f223c99a3so194840f8f.2; Mon, 10 Jun 2024 12:05:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718046302; x=1718651102; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RzcwVjd3wuF7qA5HimwlYDFzQ23qzUuT3/7uHPghCl4=; b=N/ubT16tvDEjiT7yngOASYbvLe/IWGMQzox2Ir16q98InmbvHvJll2CCPpq35sjNAo eL9a7E1/8uhl2ZPybJ0z7qjO4BJYJs34oBCNP07FAF5J3UtoXYHf8bKzCYGMCKPB/r4Y p7BFTlPI5ihf1ugmSIuA+Fag36iTq/hCLGgU8wBIoMSQxPbgDbK/tgQE2xKux36/0R6c UxzTXhspx6bjxIfZB/u/k1yd1WaiPir9LxgrqOVy9abK0yGVtcIQbvDX81WBOqsbZcid Y7+7jlRzqHEovXJO0jXw7S3c6DMIUUJOZVjDghu47SdrNOCUaM2+sZLTohipHtrdXa9L cv/A== X-Forwarded-Encrypted: i=1; AJvYcCVqSU0klp6g5Y9HIKrwcP07z4gEN19KcojrvT4xgvekXPbG0E0hM9B+QoXZoJyW4ZGYkMR0zkMQx/suTjscgnfti0uh1jhma2ahTEzs X-Gm-Message-State: AOJu0YzTmM36sDKPngMpf7pzmvGU4PFw5dxdUckYzedGSjeGbWlOpx+2 faVG1Cjm7BfHRSOGSkuARZjrUdTPHBlagFOzV5mKMYG9wKfOHWTy X-Received: by 2002:a5d:526a:0:b0:35f:1412:fa8a with SMTP id ffacd0b85a97d-35f1412fcddmr4011456f8f.1.1718046302401; Mon, 10 Jun 2024 12:05:02 -0700 (PDT) Received: from [10.100.102.74] (85.65.205.146.dynamic.barak-online.net. [85.65.205.146]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f0f2b0d85sm7800267f8f.42.2024.06.10.12.05.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Jun 2024 12:05:02 -0700 (PDT) Message-ID: Date: Mon, 10 Jun 2024 22:05:00 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Kernel OOPS while creating a NVMe Namespace To: Keith Busch , Venkat Rao Bagalkote Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, sachinp@linux.vnet.com References: <2312e6c3-a069-4388-a863-df7e261b9d70@linux.vnet.ibm.com> Content-Language: en-US From: Sagi Grimberg In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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?