lkml.org 
[lkml]   [2009]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] O_NOACC: open without any access


On Wed, 24 Jun 2009, Al Viro wrote:
>
> i_filesystem_fop is certainly bogus, but why do we want to bother with
> file_operations at all?
>
> Unless you really insist on unlimited use of ioctl(2) on such beasts (and
> any users will be non-portable for obvious reasons anyway), there's no need
> to go anywhere near ->open() *or* ->f_op in general.

A lot of filesystems (especially network filesystems) want to do something
special when you open a node on them.

NFS, for example, does that whole alloc_nfs_open_context() thing to keep
track of RPC credentials etc. It's where things like "filp->f_private"
get set etc.

So if you don't call open(), you'll not initialize the filp sufficiently
to do lots of operations.

But yes:

> Just add new methods to ->i_op (and we already have that coming from
> fs code) and teach do_filp_open() to
> * call permission() with new flag (MAY_TALK_TO_FS_NODE) for such
> open()
> * do not die with -ELOOP on symlinks if we have O_NOFOLLOW + your flag
> * do not call ->f_op->open() at all for such open()
> and we are all set. Hell, we can even teach sys_ioctl() that given set
> of ioctls maps to calls of our new methods. Taken from ->i_op...

Sure. That will work, but I do think that it's going to be more hacky than
just trying to make the file descriptor look as real as possible, and just
calling "open" on it.

But I don't really have any strong opinions.

Linus


\
 
 \ /
  Last update: 2009-10-18 23:28    [W:0.054 / U:1.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site