From nobody Wed Dec 24 10:22:18 2025 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 B77BC1078D for ; Mon, 29 Jan 2024 03:25:24 +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=1706498724; cv=none; b=rAnkV1RRUgolw6+rR2zufwHBkq3fwadOFy6Ejsy7D5aatAK96P1RrjIpI0V3mWlsMTuxgbzxrsWaXKtsxp4iiFQv5khZ2N44NRJ8yB5xSRznTXPFROae7RLWA8fggoJyX60kOlZcHsZVFsdRndzlntIJT1dCYonkvuDN3ezHCDU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706498724; c=relaxed/simple; bh=RnbwjrjDZZt5dBQ8lSVav9CcZQtdfsC0kXd6oQD/gQw=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=MSMmXtFxEiyh26IKTXKHaPkq+2hhS/+4VSBMVyFa6yJAP18Mp8znIWpTpNOGQCjs7vM7lztVhvWXOg9kA92gYtajuycO1fCKGiEycki5Ua7Enme4IQlYGcaXiLG37Kh1kYddaBJNTnw7ifS5RevrwYRcTKsZVw7EJHDr0TMexCM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53163C43390; Mon, 29 Jan 2024 03:25:24 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rUIH7-00000004FrW-0UuX; Sun, 28 Jan 2024 22:25:33 -0500 Message-ID: <20240129032532.975198083@goodmis.org> User-Agent: quilt/0.67 Date: Sun, 28 Jan 2024 22:25:09 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Linus Torvalds Subject: [for-linus][PATCH 2/2] tracefs: remove stale update_gid code References: <20240129032507.290291577@goodmis.org> 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 Content-Type: text/plain; charset="utf-8" From: Linus Torvalds The 'eventfs_update_gid()' function is no longer called, so remove it (and the helper function it uses). Link: https://lore.kernel.org/all/CAHk-=3Dwj+DsZZ=3D2iTUkJ-Nojs9fjYMvPs1Nuo= M3yK7aTDtJfPYQ@mail.gmail.com/ Fixes: 8186fff7ab64 ("tracefs/eventfs: Use root and instance inodes as defa= ult ownership") Signed-off-by: Linus Torvalds Signed-off-by: Steven Rostedt (Google) --- fs/tracefs/event_inode.c | 38 -------------------------------------- fs/tracefs/internal.h | 1 - 2 files changed, 39 deletions(-) diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 6b211522a13e..1c3dd0ad4660 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -281,44 +281,6 @@ static void update_inode_attr(struct dentry *dentry, s= truct inode *inode, inode->i_gid =3D attr->gid; } =20 -static void update_gid(struct eventfs_inode *ei, kgid_t gid, int level) -{ - struct eventfs_inode *ei_child; - - /* at most we have events/system/event */ - if (WARN_ON_ONCE(level > 3)) - return; - - ei->attr.gid =3D gid; - - if (ei->entry_attrs) { - for (int i =3D 0; i < ei->nr_entries; i++) { - ei->entry_attrs[i].gid =3D gid; - } - } - - /* - * Only eventfs_inode with dentries are updated, make sure - * all eventfs_inodes are updated. If one of the children - * do not have a dentry, this function must traverse it. - */ - list_for_each_entry_srcu(ei_child, &ei->children, list, - srcu_read_lock_held(&eventfs_srcu)) { - if (!ei_child->dentry) - update_gid(ei_child, gid, level + 1); - } -} - -void eventfs_update_gid(struct dentry *dentry, kgid_t gid) -{ - struct eventfs_inode *ei =3D dentry->d_fsdata; - int idx; - - idx =3D srcu_read_lock(&eventfs_srcu); - update_gid(ei, gid, 0); - srcu_read_unlock(&eventfs_srcu, idx); -} - /** * create_file - create a file in the tracefs filesystem * @name: the name of the file to create. diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h index 45397df9bb65..91c2bf0b91d9 100644 --- a/fs/tracefs/internal.h +++ b/fs/tracefs/internal.h @@ -82,7 +82,6 @@ struct inode *tracefs_get_inode(struct super_block *sb); struct dentry *eventfs_start_creating(const char *name, struct dentry *par= ent); struct dentry *eventfs_failed_creating(struct dentry *dentry); struct dentry *eventfs_end_creating(struct dentry *dentry); -void eventfs_update_gid(struct dentry *dentry, kgid_t gid); void eventfs_set_ei_status_free(struct tracefs_inode *ti, struct dentry *d= entry); =20 #endif /* _TRACEFS_INTERNAL_H */ --=20 2.43.0