Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7472141rdb; Wed, 3 Jan 2024 18:24:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+7VL7vmAZ8gFQ26+k0DpLgcUB19InfRd+pzKkvwf4bYBdqECqMeFasuc2cyxfYHLcZ5LM X-Received: by 2002:a17:907:908a:b0:a23:4c5d:dab4 with SMTP id ge10-20020a170907908a00b00a234c5ddab4mr7067929ejb.62.1704335057714; Wed, 03 Jan 2024 18:24:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704335057; cv=none; d=google.com; s=arc-20160816; b=A7TrAKzMuITK6eobUbeTDBb6SsYwDUWJPo9I/hTZxLMUp77jyk4/z8yp/99ydL/Ahn USbjf6P10lD8ZzUckaaq66VwLcR6wNJNS1SEl0HNplADlehbDsg119N4KePrnxAz/Gyd 0s7Qh3etEnYXRJAfyNWPWqx8+BkOSNj+dHXyyl8y9HEsKgmzm5t2kGWwu6VHapKE7iH/ RVKl7iW0xOfNplk4pTuSuB80USbwY6yHC59EFPPnT+AyuXrKqTLMoZubk1gjHuiYl5iR DLy3rxbH7NSUrCDLL/aZDi8vfdy/RaBVxW5Y+frTAtKQB/2vGzDZmbgS9AD/xlwXRDWW X9eA== ARC-Message-Signature: i=1; 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 :subject:cc:to:from:date; bh=GjRf7BgYx5GcqrvKQJ++SBx7KyP5yLTRB2/J4Nlmy2c=; fh=OxOp+U/dcy5APTeHcSqFAwgsJF8dU3EWCs0HdGVKAPY=; b=c7oGDkgQpbEpAAFzjM+72fQWtFtgMnSGVz6XtAA3lb/o8IRXAp/Fk4LSlPdafIxZMQ F2WvJc/wdBvarEtnhxo+Tpfiv3/bBCF9uj1E0owMciefMR7evTOW8LKpjoIRFNsVSdtb CzMTM7XwDCTu95lFl/oLOGg6I31CD/l0Ig7owKBWgzNieNgdBkjZ7+Yu7cKqhOzRItVp hDExDkgeVRnsyd9/Qwvfv91OCnoItV7Ap9lo0Sv9qK/F+CLEY7pUmvNpRPP6dLeJvOPP E3sFG+2GYeeaXBUMxHw65DIbrXLqIa4mJuy04Q+v7Bs+fM+TSKYFdhSr3ZIXXV3Ceeyc t9Jw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-16201-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16201-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ez21-20020a1709070bd500b00a26f02b8c35si7999425ejc.799.2024.01.03.18.24.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 18:24:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16201-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-16201-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16201-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6DBF51F262F1 for ; Thu, 4 Jan 2024 02:24:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8554E4C6F; Thu, 4 Jan 2024 02:24:04 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org 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 11F651FB4; Thu, 4 Jan 2024 02:24:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 861D3C433C7; Thu, 4 Jan 2024 02:24:02 +0000 (UTC) Date: Wed, 3 Jan 2024 21:25:06 -0500 From: Steven Rostedt To: Al Viro Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Mathieu Desnoyers , Linus Torvalds , Christian Brauner , linux-fsdevel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH] tracefs/eventfs: Use root and instance inodes as default ownership Message-ID: <20240103212506.41432d12@gandalf.local.home> In-Reply-To: <20240104014837.GO1674809@ZenIV> References: <20240103203246.115732ec@gandalf.local.home> <20240104014837.GO1674809@ZenIV> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Thu, 4 Jan 2024 01:48:37 +0000 Al Viro wrote: > On Wed, Jan 03, 2024 at 08:32:46PM -0500, Steven Rostedt wrote: > > > + /* Get the tracefs root from the parent */ > > + inode = d_inode(dentry->d_parent); > > + inode = d_inode(inode->i_sb->s_root); > > That makes no sense. First of all, for any positive dentry we have > dentry->d_sb == dentry->d_inode->i_sb. And it's the same for all > dentries on given superblock. So what's the point of that dance? > If you want the root inode, just go for d_inode(dentry->d_sb->s_root) > and be done with that... That was more of thinking that the dentry and dentry->d_parent are different. As dentry is part of eventfs and dentry->d_parent is part of tracefs. Currently they both have the same superblock so yeah, I could just write it that way too and it would work. But in my head, I was thinking that they behave differently and maybe one day eventfs would get its own superblock which would not work. To explain this better: /sys/kernel/tracing/ is the parent of /sys/kernel/tracing/events But everything but "events" in /sys/kernel/tracing/* is part of tracefs. Everything in /sys/kernel/tracing/events is part of eventfs. That was my thought process. But as both tracefs and eventfs still use tracefs_get_inode(), it would work as you state. I'll update that, as I don't foresee that eventfs will become its own file system. Thanks, -- Steve