From patchwork Mon Jan 29 03:25:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 193226 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp339199dyb; Sun, 28 Jan 2024 19:26:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmQ+2FKqinMpaHaSSJuTpG8eF9JY2W2XGt/pKr2c83ShGGwQF/4lyZsuhEgctaQ89pCAaN X-Received: by 2002:ac8:5803:0:b0:42a:525b:b76b with SMTP id g3-20020ac85803000000b0042a525bb76bmr6618353qtg.55.1706498769439; Sun, 28 Jan 2024 19:26:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706498769; cv=pass; d=google.com; s=arc-20160816; b=lexpPQSDWsdVeyQAjGghOEFwzEocj3d6CyKJgScJCold3tNlviyctGg9yBn3eQquXX Lt0w5o1YtiHgCtgxuAiUhiWzOOK0RckfHKVlhDc3tEAl9NWQL/qsNEsWoxTL5qlKj6Zn M1kWEreSw8H8q/Ika/4X9/8lbGVFD+jETiQOjZNa/LPELDujDUGioRQlSCM4smiCZPi5 jlbEh4iR43tOfoF3lxcXO3QmkIln4cfNkuy5q0roMurUB5LL2gRGfgiOBP4728cYnBdz DYIMx05IdKIX+xIVWYaAvlbaC6kg9nZTYkoHB19baYM3TXs9gDBClm/usJ2YCZBWeMdX m3HQ== 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=Y0oO9OYv4fsUuM0r75f6NybcP+SEzVd4nX4k5C6cREM=; fh=mapKFvE3Su4/54sYraTbr5edn5lsA07x7IZamsFtihs=; b=llva/s+FPDiwy+kjKLe5+72JCXsrTC6mhgoLLkBCjOO+AhfpgAzKE4i0lOASsjJu42 j7TBw207cFfn5/AjJlgi0N9zh3/wppkL3XcVW6azfAn7BhQBr2kzh9F5/0jUDTKCyWtk mDXsOd7KqRE+KwK0tb/frL0wQMEVodCsM5+4GCkUJchvrbWHVuO7xpo2sVZNJL3HdhpA aQRPk1oUsHNQGbagN9dsMe9q9y0ivpky1PkZ0xsust51DIaBMJ6kIk/+vJczhWfU+6wy za1N8nh4TlXoC+dK81aC0GwIHKBkFYOxA6DYVHhhqJFt0rRtcQtVpiHPvQcnWr3ZRKN+ HrIA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-42124-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42124-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id n8-20020ac85a08000000b0042a09a98ae1si6999393qta.67.2024.01.28.19.26.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 19:26:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42124-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-42124-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42124-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3DF8A1C21877 for ; Mon, 29 Jan 2024 03:26:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59F061EB42; Mon, 29 Jan 2024 03:25:26 +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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789393653652863610 X-GMAIL-MSGID: 1789393653652863610 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) --- 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 */