Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp542443lqp; Wed, 12 Jun 2024 08:58:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVkUYjZZxFUvvgUfhmE92PV74TZJIK1UNNv8G0n8rp3jRlfxsFt99J2HPaQKUW1ASEgoCSy6p9olEs8hJi3c7gu/vQKNAdaC70WxU4koQ== X-Google-Smtp-Source: AGHT+IHFXE19XRKRfugd5DXjS7EpVFpesGdZ8c7yK+dp3cZzdir5OibhmW73ZwGwuGdUrxEef8vz X-Received: by 2002:a2e:b801:0:b0:2eb:e67f:3c65 with SMTP id 38308e7fff4ca-2ebfc9d087bmr10675711fa.21.1718207918345; Wed, 12 Jun 2024 08:58:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718207918; cv=pass; d=google.com; s=arc-20160816; b=fhyCZUSmaiCZwFpW6C5SSQPP7tPYZSQVYgA//1Y/MaD8tWe8DK04Bj6ZOm//V+Z2US zGNnFzMtShfXR5sI+bhGGhPH6801BV9bFfUyNrTh+nxqjsB5zj+itxe77KQ7fcyiNyZv 72lhEuF/oyKVrviOfMlr/ZcbymOhVhAa7TwFMliyVMqLS9c4ifQJ5UtjwmOHbKo+cpuI INC7JvnxxSUqHsa8ZLXhpLK3mh2H+ItfZH1a7qiVUaCyvPY/haxQfqZZ4paoSh5ee4Zt U+X6n6jfmqQ7tKr/JS7PKlc3jVIEywpn/oJ8OuTpSpckFo2dOrXlX8QeoUcM77M7oMgv kqdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Dp9jB3/zWqEW0lejCiauS6edrezGeGq1zpJr+Kx+fZI=; fh=xbRWc02XV7VItOH0DU0/7wig5o2Ry/HCLxAJe4b0KOk=; b=KBj3Vg7zAubdiS2dWz2kINXt9TIXtwh4VQmIcoyT+tqdgWnCFjDwXxfVIdc7IXB6Sk aEhG/d+PFUc2/FzyQOshIEPnECPMZadMT74Jc3CYEaubW+vt8tEriynJWysUmfk+9tEe RC1w3KHxE8JOstSyX8RYvB+0pFwLXoyxt1GzmTqgiREReNYrvGBEH6OSBRLGT2wIuHNr lnPw9mZGM2dXb335LFN2gahsW+TAnc/kOWau1Cba4133B255E20hq1Rz+4wz+RWISrko C/hlrAa+IMWVxw8nMGmXy0dh7KDSyK1DUT49YehIEfS3DNv8CP/kfIt75w2WmxA7n8ZT 3tDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@meta.com header.s=s2048-2021-q4 header.b=hV7y+HxN; arc=pass (i=1 spf=pass spfdomain=meta.com dkim=pass dkdomain=meta.com dmarc=pass fromdomain=meta.com); spf=pass (google.com: domain of linux-kernel+bounces-211822-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211822-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=meta.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c682eefd1si5153144a12.388.2024.06.12.08.58.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 08:58:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211822-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@meta.com header.s=s2048-2021-q4 header.b=hV7y+HxN; arc=pass (i=1 spf=pass spfdomain=meta.com dkim=pass dkdomain=meta.com dmarc=pass fromdomain=meta.com); spf=pass (google.com: domain of linux-kernel+bounces-211822-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211822-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=meta.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 16BE11F2876A for ; Wed, 12 Jun 2024 15:52:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D00CB180A83; Wed, 12 Jun 2024 15:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=meta.com header.i=@meta.com header.b="hV7y+HxN" Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) (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 964FF146017 for ; Wed, 12 Jun 2024 15:52:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.153.30 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718207524; cv=none; b=KAJtnTSCnfAWQEgh3x5Dvw4qizKe9XMrMLrkNhne9pXgG5uUSlzv6BrxZXGsHy4LHXpPsBe/++7v1MTFLKcjNPVMFD2tUnoEd7+vyLnrl10c8BfLTDnZ4D6rZ+dOEln6Sv70TOnNoo0wzk3510ihsfdvKjI0TSgDTMXZcfOsZ3E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718207524; c=relaxed/simple; bh=N86oabt2fKTMO2uOL8z7pPMGu8O/KQBt+1LpSMDdwSo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MEPGmysitEr5yZ0hCF4bY3wTnlbmVN6MvpaegC1s7SaMaBJEnRZBBAA3F8SuByjxK82I7N3AXkZZqAox6brMJDGO5QUwD911NVwNl76KD4bLVbTdrn/e/thvLkW0eG5sRMypE5mH1+MORwikH0jc+x38D67ezhT4xD/xY1hg4+I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=meta.com; spf=pass smtp.mailfrom=meta.com; dkim=pass (2048-bit key) header.d=meta.com header.i=@meta.com header.b=hV7y+HxN; arc=none smtp.client-ip=67.231.153.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=meta.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=meta.com Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.17.1.19/8.17.1.19) with ESMTP id 45CFbEQ6024314 for ; Wed, 12 Jun 2024 08:52:01 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=cc : content-transfer-encoding : content-type : date : from : in-reply-to : message-id : mime-version : references : subject : to; s=s2048-2021-q4; bh=Dp9jB3/zWqEW0lejCiauS6edrezGeGq1zpJr+Kx+fZI=; b=hV7y+HxNxvW3yl2z+NBnGRGgju03oovha427d0bVPLpvulwd7Dpxq4Z/NgoozRYJOvcR +Xt/4MxiTMlgoUXQAI1wFf+hX0TZ371I6GFpGXgXZYDPeqsTqNJsqQCuXrjkUtZbEZLZ 66KEAGqPhDNDAwHI9Nc2QZmCkD7ILOwWNOvnsnuhKhv38YElYtKTzpjV6iuJ5CQZsYmc hSAus7BVC9RGLNJGgiUuanNri6MFatJb0TvpMAwnG0w+pslM1+mt45/+f+d6xKPDcJnc HxL7cuBYW+KevdR72T9866U/2E5/zvlZetAbPFaqIFQgjRNh8Wm42FYboUK1oU0mTctk Dg== Received: from maileast.thefacebook.com ([163.114.130.16]) by m0089730.ppops.net (PPS) with ESMTPS id 3yqefm836f-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 12 Jun 2024 08:52:01 -0700 Received: from twshared26916.05.ash9.facebook.com (2620:10d:c0a8:1b::2d) by mail.thefacebook.com (2620:10d:c0a9:6f::8fd4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1544.11; Wed, 12 Jun 2024 15:51:58 +0000 Received: by devbig638.nha1.facebook.com (Postfix, from userid 544533) id 06B8FF5EA646; Wed, 12 Jun 2024 08:51:47 -0700 (PDT) From: Keith Busch To: , , CC: , , , , , , Keith Busch Subject: [PATCH 2/2] nvme: fix namespace removal list Date: Wed, 12 Jun 2024 08:51:35 -0700 Message-ID: <20240612155135.3060667-2-kbusch@meta.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240612155135.3060667-1-kbusch@meta.com> References: <20240612155135.3060667-1-kbusch@meta.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-GUID: qeSLCxNhe5c5qv8wtUvzILNfGT1BH2aF X-Proofpoint-ORIG-GUID: qeSLCxNhe5c5qv8wtUvzILNfGT1BH2aF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-12_08,2024-06-12_02,2024-05-17_01 From: Keith Busch This function wants to move a subset of a list from an element to the end to another list, so do that with the new list_cut helper instead of using the wrong list splice. Fixes: be647e2c76b27f4 ("nvme: use srcu for iterating namespace list") Reported-by: Venkat Rao Bagalkote Tested-by: Venkat Rao Bagalkote Signed-off-by: Keith Busch --- drivers/nvme/host/core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index f5d150c62955d..30fec15872b3d 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, =20 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_cut(&rm_list, &ctrl->namespaces, &ns->list); + break; + } } mutex_unlock(&ctrl->namespaces_lock); synchronize_srcu(&ctrl->srcu); --=20 2.43.0