From patchwork Tue Feb 6 12:09:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 197434 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1506473dyb; Tue, 6 Feb 2024 04:36:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdcHl6mwPV0lnhhhXncGxBw1p1zU89tSFfkXN+a3yievpG2WLXV53hz9OWNUWj3jKUwNVc X-Received: by 2002:a05:6a20:3d20:b0:19e:982e:c3f3 with SMTP id y32-20020a056a203d2000b0019e982ec3f3mr1605802pzi.51.1707223002859; Tue, 06 Feb 2024 04:36:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707223002; cv=pass; d=google.com; s=arc-20160816; b=rFdcg/kY7hvn7a2bMPxy0LAM/gyK0gsImMcAYNrpuesbjVZOF3u34+V9G2rMxxDJ3/ ERzbT4AI1SGFh/65SiqmABZ6HwG+mMqu9LikrWj3Y9KbFIDdpz1MULNu9p66OQgVaQKx 1G7iUVz2MRofcd1CG2SDE6TYw1C1Fg25tlDRgqo7eWTfqgkELXjQGvKLiRIBHtXDsjWU phHljuQrboowwLtcC+9TcysZgqGR1FjvKCZGXf2vt6Qix00ZOgh+kW6ks7n7ecpGSe1V zHlAEfpbALtksiQ4QZOx0UZPSuV9lb3YI9l7HgGT610l95vlCJfkNnA/8A/+aPOFsVlt 6Riw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=ez93nIj3r0KL5LhMXr8lgScygvkcsmAkg7g6211UaaY=; fh=slcU1Vi/WjECeD8so4t/+zX88V/gCfsyO/nwFu1nUTg=; b=WCL0N8bNJ7s9RWxXriJsOgM56T5ePTeA0mIE6tAF0UbNgGEXQmoDkm8nwY+LkkOjiZ j4lR5MrSemF0V1F8cLu9oQa11Sl9AJTfn0nao2DeOtWcQyg3Tew6qbdXnKy4lJYERAp0 uHy3zVFQl3VVt6ckBXWoB9+5jUMYrKgl3Y/K5IEQlJ1KBQdoveTzRWKl076fl+5zd/VW 6g2pQOjZpgKUuNakIZFcZi+k+hiBhtuB3F0M6e/VohP7c+cvIF6YUTuv0yOxi/fXWYnm wqEQlu2U8whfPwFvGIYz+fwaX7JOhD//iuuqiTNTJbu4kXAAr9iTQyQgtpBcbaZ8oOFC nUHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-54921-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54921-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCUsHquZuLLNWn7PUwgSeuZql7QY0JtvKOggIg17pBTDxMOvJHNYonz8lMk77+rnpjUCG1yMKWxxm/w2f3f2u0s+NDHILA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e24-20020a631e18000000b005d6a99217dasi1632423pge.403.2024.02.06.04.36.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 04:36:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54921-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-54921-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54921-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D4CCCB27EB1 for ; Tue, 6 Feb 2024 12:27:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01505151454; Tue, 6 Feb 2024 12:09:41 +0000 (UTC) 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 B4EDF13B290; Tue, 6 Feb 2024 12:09:25 +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=1707221365; cv=none; b=MMLqDeBOdJAp8eAFvqh44hJ8ngwcink92D62QdpVrtzX2/CC55TbwJeThrOfXrMzMZ6ksN+KShdcMh331k2RZeE5RXFL3vSdcg3vJFYH6bkrTJYLj4NHgdM4DdBJym2i9ffVgb46SYDQ0y0nLcKfMFdokj0FM3xqvAkmAeNdF/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707221365; c=relaxed/simple; bh=3cuwo8jKNFJ8ZNaRFdtkUgaWTecxRB1l6ECQ5pijtZI=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=id7hF8Kq4zkPepNDkZxydV9VHr9jSk+WCTXnog3BXnt2Jm3UXT082zXyhf7sN7IKCesQjoYr587ODPFL1WOaoNYpMrdofqyydZCkhl0hTf2wmfjlcSLQqWz3RJhvRwJfdbk3T3x1avmo8IyGzADEmQxvUTqstczdIsqg/ykOIaI= 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 8EA08C43394; Tue, 6 Feb 2024 12:09:25 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rXKGw-00000006bOL-04MI; Tue, 06 Feb 2024 07:09:54 -0500 Message-ID: <20240206120953.870617585@rostedt.homelinux.com> User-Agent: quilt/0.67 Date: Tue, 06 Feb 2024 07:09:51 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Linus Torvalds , Greg Kroah-Hartman , Sasha Levin , Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers Subject: [v6.6][PATCH 46/57] tracefs: remove stale update_gid code References: <20240206120905.570408983@rostedt.homelinux.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790153067282487787 X-GMAIL-MSGID: 1790153067282487787 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-=wj+DsZZ=2iTUkJ-Nojs9fjYMvPs1NuoM3yK7aTDtJfPYQ@mail.gmail.com/ Fixes: 8186fff7ab64 ("tracefs/eventfs: Use root and instance inodes as default ownership") Signed-off-by: Linus Torvalds Signed-off-by: Steven Rostedt (Google) (cherry picked from commit 29142dc92c37d3259a33aef15b03e6ee25b0d188) --- 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, struct inode *inode, inode->i_gid = attr->gid; } -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 = gid; - - if (ei->entry_attrs) { - for (int i = 0; i < ei->nr_entries; i++) { - ei->entry_attrs[i].gid = 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 = dentry->d_fsdata; - int idx; - - idx = 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 *parent); 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 *dentry); #endif /* _TRACEFS_INTERNAL_H */