Re: [for-linus][PATCH 09/13] tracefs: Set the group ownership in apply_options() not parse_options()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 25 Feb 2022 17:11:00 +0000
Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:

> On Fri, Feb 25, 2022 at 11:52:00AM -0500, Steven Rostedt wrote:
> 
> > @@ -293,6 +292,9 @@ static int tracefs_apply_options(struct super_block *sb)
> >  	inode->i_uid = opts->uid;
> >  	inode->i_gid = opts->gid;
> >  
> > +	if (tracefs_mount && tracefs_mount->mnt_root)
> > +		set_gid(tracefs_mount->mnt_root, opts->gid);
> > +  
> 
> Umm...  Why bother with tracefs_mount here in the first place?
> You have the superblock the operation is applied for - right in the
> arguments.

Ah, because I didn't realize they were one and the same ;-)

> 
> Just make that
> 	set_gid(sb->s_root, opts->gid);
> and be done with that.  Same place in tracefs_apply_options()...
> 
> Incidentally, I'm not sure you need to keep ->i_gid assignment - set_gid()
> won't miss that inode, so...

Makes sense. Thanks.

I guess I wont be sending my pull request to Linus now :-/

-- Steve




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux