From nobody Fri Feb 13 18:35:07 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 9E07C12838F for ; Thu, 23 May 2024 21:23:21 +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=1716499401; cv=none; b=Ph2gUP8XV6bFM0FI9KSU5Y/npPuIxE5uapsw/gBYydQex6t+wTdUswsrf4sl5CRoB7Sdv53Ls36NOCtx7k62JSv7DZ27wz+R6GjcOzlfg1A6vXJZ8+eNIcIpfJPqNKg19wQkR67dfVtmfwmueEuC0UuZkj9eHH3zLj5r/YQe93g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716499401; c=relaxed/simple; bh=krRDAMZ6xTgFMUtD/RVVOB1jD17MwEJGX9YoC2sERuQ=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=C3MTLLUYQnCHwY8EIvqyw7W7j3HA4jDFk2aPiOaE6tm3IYGPwElglXd8LjJ9JPfdjS9pZ9enk12HpaeWxrwuHYXNZuqEJmyui00aSR7YxtTqOQkZKSv+5R33nkhGVO5wvcBouI/gtXLj6stYaawTrf56NC/EKcD5nOc0IG2jWYY= 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 496FBC4AF4D; Thu, 23 May 2024 21:23:21 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sAFux-00000006lAf-08iV; Thu, 23 May 2024 17:24:07 -0400 Message-ID: <20240523212406.897870866@goodmis.org> User-Agent: quilt/0.68 Date: Thu, 23 May 2024 17:23:04 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Masahiro Yamada , Linus Torvalds Subject: [for-linus][PATCH 6/8] eventfs: Remove getattr and permission callbacks References: <20240523212258.883756004@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). Link: https://lore.kernel.org/lkml/20240522165031.782066021@goodmis.org Cc: Linus Torvalds Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Andrew Morton 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 92987b5c8d9d..f32c6f7eb29f 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