From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.155]) (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 0DE9A1A275; Sat, 8 Aug 2026 00:00:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786147239; cv=none; b=HSPlC5EsMtjrs3FGpocjFFaUB6r5krLyAH7VsTqI1ruWVLltTZGErEa9JDZTaUToBbS1x8aXJ6wOjK1csFlZ3OlnhASejX0BBNgih4eztzid6UjCv3h29wjCTCnCUXpW7ov6ECshIfj1ROPq7NvA6t47KZixOvCePSC4Cir24Vs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786147239; c=relaxed/simple; bh=0tSZeBRVvKvkwivhLopdZfGQkyHCxZzT27f8mZjthhw=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WkeFU8vXgsqQiKDehjyQdPdemrlNjufcDKu8j10145NmnypCQwQrOialcUrPhQMD98W2LFhdTZD1aqrh/4/WQPRECo1fFqULenRsblOdjRn/7MhmUCYjH6ODi6PaWgO6U0YGtynpR8UjGfWUBMzuE3l6RWJpvQs2t+gXOSwrOMc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rostedt.org; spf=pass smtp.mailfrom=rostedt.org; dkim=pass (2048-bit key) header.d=rostedt.org header.i=@rostedt.org header.b=HCMaz6Lx; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Ymfhyta8; arc=none smtp.client-ip=103.168.172.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rostedt.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rostedt.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rostedt.org header.i=@rostedt.org header.b="HCMaz6Lx"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Ymfhyta8" Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id D1B13140012E; Fri, 7 Aug 2026 20:00:35 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Fri, 07 Aug 2026 20:00:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rostedt.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1786147235; x=1786233635; bh=5fjioxdF86XfES2DbYBetaj2+5wOEm4NcVCx7s28aPc=; b= HCMaz6LxBSVJclILl1ZbkFOpn7quLjJFV/MG5iC+SieMcxbqlnFG+U/sEQcKobwj iye4OX8Nqo56UTK/q4ADouDUXQmzx/fVS4XB5swlCmeTo1l8tskl5p/9vRd0oT59 ddfpxvXjc3BV5jL/jpwx40nRVCBGhXwsgRkebfF/UvodfOW5JBykQVXYyhebOygG C9eij3L5iMymxWhZGFyL7nqbd5ZGxYxxO1uZI+iGlT9gGp+NhAmQCX/xnFdpDxWn cyNF0ymZ1E5KzicvkUxLTfmqErnc9RfOvbWMTsWcLd/YZYXr5GeTFr8aoIBlYnan GaMdosWgaTyzxSITQZTafA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1786147235; x= 1786233635; bh=5fjioxdF86X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I/NOXnOfJc/19w X-ME-Proxy: Feedback-ID: id06e481b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 7 Aug 2026 20:00:35 -0400 (EDT) Date: Fri, 7 Aug 2026 20:00:39 -0400 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: LKML , Linux Trace Kernel , Mathieu Desnoyers Subject: Re: [PATCH] eventfs: Use children field for rcu head and add memory barriers Message-ID: <20260807200039.1bc728f3@gandalf.local.home> In-Reply-To: <20260808071506.cacd0c21059c942a5d2d173b@kernel.org> References: <20260807170408.2d324df5@gandalf.local.home> <20260808071506.cacd0c21059c942a5d2d173b@kernel.org> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 8 Aug 2026 07:15:06 +0900 Masami Hiramatsu (Google) wrote: > Looks good to me. > > Reviewed-by: Masami Hiramatsu (Google) > > The critical issues Sashiko mentioned will be fixed by Shuangpeng's patch[1]. No ;-) The critical issues Sashiko mentioned was from a review of that patch which stated: "This isn't a bug introduced by this patch, but does this still leave concurrent SRCU readers vulnerable to list pointer corruption?" Thus Shuangpeng's patch doesn't address it. I was in the process of applying Shuangpeng's patch and I look at the Sashiko review and wrote this patch to fix that issue too. I plan on applying both. > [1] https://lore.kernel.org/all/20260806022719.375354-1-shuangpeng.kernel@gmail.com/ > > Thank you, > > > Reported-by: Sashiko > > Closes: https://sashiko.dev/#/patchset/20260806022719.375354-1-shuangpeng.kernel%40gmail.com > > Signed-off-by: Steven Rostedt > > --- > > fs/tracefs/event_inode.c | 24 ++++++++++++++++++++++++ > > fs/tracefs/internal.h | 4 ++-- > > 2 files changed, 26 insertions(+), 2 deletions(-) > > > > diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c > > index 39c7a34531e8..677c39b0d62f 100644 > > --- a/fs/tracefs/event_inode.c > > +++ b/fs/tracefs/event_inode.c > > @@ -124,6 +124,16 @@ static inline void put_ei(struct eventfs_inode *ei) > > static inline void free_ei(struct eventfs_inode *ei) > > { > > if (ei) { > > + WARN_ON_ONCE(!list_empty(&ei->children)); > > + /* > > + * The ei should have no children if it is being freed. > > + * The SRCU iteration has a smp_rmb() to make sure it > > + * sees a child (that may have already been freed) > > + * before it reads is_free. If is_free is set, it must > > + * not use the child it acquired from ei->children, as > > + * the list may be used for SRCU. > > + */ > > + smp_wmb(); > > ei->is_freed = 1; And Sashiko found a bug here (from reading the comments). The smp_wmb() is supposed to be *after* the ei->is_free = 1 !!! I'll send a v2. -- Steve > > put_ei(ei); > > }