From nobody Wed Feb 11 12:59:33 2026 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 59B261420CA for ; Wed, 22 May 2024 16:49:48 +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=1716396589; cv=none; b=s5Q5VQK1C+RhRi8QWMLaJMwNrxoIXWMMJk5tnd3kq1PRKu2/fMX+48tUgKSLT3VTpqRxXbZjG3JZHn5jz+rg7WbRAElP1mSVT6LxcbJx/6XsN8WJzPpYkK+3cxrXx4peLxzhUDU4C0PCuOHTa1NUOm8VsRNN8D9Q3Pyp7kRRpgM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716396589; c=relaxed/simple; bh=V145cZNiWNCtXZ8E8drCo4cEY4Xy3jDEou2pmLZ7cPc=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=ovok/7NvlMkw4U/P2L6ObK1ie5g23/e3X0p4If+g3yC2zbJoHPSx9Du/DNWDmpAvtafNyimap7Qep+XpFZUDLnAvp57nOrSiqUD14epCQflm4UD9w3vtmnn9EKLZwv5SDaSUL5yYJ5WWqpPR3jZdFOb7wXjeGKbb1pIBKcMkrcQ= 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 BF53CC4AF08; Wed, 22 May 2024 16:49:48 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1s9pAd-00000006HQ7-3s4t; Wed, 22 May 2024 12:50:31 -0400 Message-ID: <20240522165031.782066021@goodmis.org> User-Agent: quilt/0.68 Date: Wed, 22 May 2024 12:49:44 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [PATCH 2/4] eventfs: Remove getattr and permission callbacks References: <20240522164942.590663963@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: "Steven Rostedt (Google)" Now that inodes have their permissions updated on remount, the only other places to update the inode permissions are when they are created and in the setattr callback. The getattr and permission callbacks are not needed as the inodes should already be set at their proper settings. Remove the callbacks, as it not only simplifies the code, but also allows more flexibility to fix the inconsistencies with various corner cases (like changing the permission of an instance directory). Signed-off-by: Steven Rostedt (Google) --- fs/tracefs/event_inode.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index fb0fcd419805..4af6380eb236 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -250,49 +250,9 @@ static void update_events_attr(struct eventfs_inode *e= i, struct super_block *sb) ei->attr.gid =3D parent->i_gid; } =20 -static void set_top_events_ownership(struct inode *inode) -{ - struct tracefs_inode *ti =3D get_tracefs(inode); - struct eventfs_inode *ei =3D ti->private; - - /* The top events directory doesn't get automatically updated */ - if (!ei || !ei->is_events) - return; - - update_events_attr(ei, inode->i_sb); - - if (!(ei->attr.mode & EVENTFS_SAVE_UID)) - inode->i_uid =3D ei->attr.uid; - - if (!(ei->attr.mode & EVENTFS_SAVE_GID)) - inode->i_gid =3D ei->attr.gid; -} - -static int eventfs_get_attr(struct mnt_idmap *idmap, - const struct path *path, struct kstat *stat, - u32 request_mask, unsigned int flags) -{ - struct dentry *dentry =3D path->dentry; - struct inode *inode =3D d_backing_inode(dentry); - - set_top_events_ownership(inode); - - generic_fillattr(idmap, request_mask, inode, stat); - return 0; -} - -static int eventfs_permission(struct mnt_idmap *idmap, - struct inode *inode, int mask) -{ - set_top_events_ownership(inode); - return generic_permission(idmap, inode, mask); -} - static const struct inode_operations eventfs_dir_inode_operations =3D { .lookup =3D eventfs_root_lookup, .setattr =3D eventfs_set_attr, - .getattr =3D eventfs_get_attr, - .permission =3D eventfs_permission, }; =20 static const struct inode_operations eventfs_file_inode_operations =3D { --=20 2.43.0