lkml.org 
[lkml]   [2008]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch 07/14] vfs: pass dentry to permission()
From
Date
> > From: Miklos Szeredi <mszeredi@suse.cz>
> >
> > The following patches clean up the i_op->permission() method and the
> > related VFS API.
> >
> > Here's an overview of the changes:
> >
> > - ->permission() is passed a dentry instead of an inode
> > - ->permission() is passed a integer flags parameter instead of a
> > nameidata pointer
>
> No. Take a good look at the instances.
>
> a) only one aberrant case cares about dentry, and for extremely
> wrong reasons. /proc/sys/ stuff. ecryptfs, of course, will be happy
> with any variant.

Yeah. The real reason I changed to dentry is not /proc/sys or
ecryptfs, but because it's the Right Thing. And if we have to touch
all instances anyway, then it basically comes for free.

Why dentry? Because of filesystems which operate on names and not
inodes. Currently all these manage to get by, because their
->permission() just uses the cached attributes. But that should not
necessarily be the case.

Look at the inode_operations, each and every one passes a dentry (or
dentries) to the filesystem, except permission().

OTOH there isn't any immediate need for this, it's just an interface
rationalization thing, so...

> b) few flags that are looked at are trivially mapped to new MAY_...

OK.

> I have a patch series that does it, but it involves tons of fixing the
> sysctl handling to be finished ;-/ And yes, we need sysctl to quit
> doing the "I want to get ctl_table entry, so I'll do very painful search
> by dentry every damn time" in any case - look at that code, it's far
> too ugly to live.

I shut my eyes and just squinted while touching that code ;)

>
> IOW, consider this ->permission() API change NAKed.

I'll fix b) and repost. There's a bit more to this series, than just
the ->permission() API change.

Miklos


\
 
 \ /
  Last update: 2008-05-22 09:03    [W:0.064 / U:22.996 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site