On Tue, Dec 12, 2023 at 12:21 AM Christian Brauner <brauner@xxxxxxxxxx> wrote: > > I think you want > > opt->uid = current_fsuid(); > opt->gid = current_fsgid(); > Thanks for catching this and the suggestions! Added the above two lines in the v4. > because bpf_init_fs_context() is called from fsopen() which may be > called inside a user namespace. Then you can just transfer > > s_fs_info->uid = opts->uid; > s_fs_info->gid = opts->gid; > > and then always use: > > inode->i_uid = s_fs_info->uid; > inode->i_gid = s_fs_info->gid; > > when initializing inodes. Otherwise looks good.