From: Linus Torvalds Date: Mon, 13 May 2024 19:09:18 +0000 (-0700) Subject: Merge tag 'vfs-6.10.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=103fb219cf57fc3641d92af2f4f438080cea3efc;p=linux.git Merge tag 'vfs-6.10.mount' of git://git./linux/kernel/git/vfs/vfs Pull vfs mount API conversions from Christian Brauner: "This converts qnx6, minix, debugfs, tracefs, freevxfs, and openpromfs to the new mount api, further reducing the number of filesystems relying on the legacy mount api" * tag 'vfs-6.10.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: minix: convert minix to use the new mount api vfs: Convert tracefs to use the new mount API vfs: Convert debugfs to use the new mount API openpromfs: finish conversion to the new mount API freevxfs: Convert freevxfs to the new mount API. qnx6: convert qnx6 to use the new mount api --- 103fb219cf57fc3641d92af2f4f438080cea3efc diff --cc fs/tracefs/inode.c index 417c840e64033,abd0b477e2875..a827f6a716c44 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@@ -362,9 -295,6 +345,8 @@@ static int tracefs_apply_options(struc { struct tracefs_fs_info *fsi = sb->s_fs_info; struct inode *inode = d_inode(sb->s_root); - struct tracefs_mount_opts *opts = &fsi->mount_opts; + struct tracefs_inode *ti; + bool update_uid, update_gid; umode_t tmp_mode; /* @@@ -378,31 -308,12 +360,31 @@@ WRITE_ONCE(inode->i_mode, tmp_mode); } - if (!remount || opts->opts & BIT(Opt_uid)) - inode->i_uid = opts->uid; + if (!remount || fsi->opts & BIT(Opt_uid)) + inode->i_uid = fsi->uid; - if (!remount || opts->opts & BIT(Opt_gid)) - inode->i_gid = opts->gid; + if (!remount || fsi->opts & BIT(Opt_gid)) + inode->i_gid = fsi->gid; - if (remount && (opts->opts & BIT(Opt_uid) || opts->opts & BIT(Opt_gid))) { ++ if (remount && (fsi->opts & BIT(Opt_uid) || fsi->opts & BIT(Opt_gid))) { + - update_uid = opts->opts & BIT(Opt_uid); - update_gid = opts->opts & BIT(Opt_gid); ++ update_uid = fsi->opts & BIT(Opt_uid); ++ update_gid = fsi->opts & BIT(Opt_gid); + + rcu_read_lock(); + list_for_each_entry_rcu(ti, &tracefs_inodes, list) { + if (update_uid) + ti->flags &= ~TRACEFS_UID_PERM_SET; + + if (update_gid) + ti->flags &= ~TRACEFS_GID_PERM_SET; + + if (ti->flags & TRACEFS_EVENT_INODE) + eventfs_remount(ti, update_uid, update_gid); + } + rcu_read_unlock(); + } + return 0; }