From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Howells <dhowells@redhat.com>,
Miklos Szeredi <miklos@szeredi.hu>,
alan@lxorguk.ukuu.org.uk, hch@infradead.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
adilger@sun.com, akpm@linux-foundation.org
Subject: Re: [RFC] O_NOACC: open without any access
Date: Wed, 24 Jun 2009 11:53:36 +0100 [thread overview]
Message-ID: <20090624105336.GO8633@ZenIV.linux.org.uk> (raw)
In-Reply-To: <alpine.LFD.2.01.0906231019250.3240@localhost.localdomain>
On Tue, Jun 23, 2009 at 10:34:49AM -0700, Linus Torvalds wrote:
> That said, I do _not_ like the notion of
>
> > Add a new inode->i_filesystem_fop pointer
>
> regardless of whether it's in inode->i_op or wherever. I think we should
> just handle this in the regular "inode->f_op->open" routine, the same way
> we handle FMODE_EXCLUSIVE (O_EXCL), FMODE_NDELAY (O_NONBLOCK) and lack of
> access rights (O_NOACCESS) in the driver open routines that currently
> handle those specially (O_NDELAY is spe
>
> Al?
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.
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...
If we want full-blown ->ioctl() coming from the fs code on such opens, we
will need distinct file_operations, no matter what we do with ->open().
It's also doable (we'd need ->i_fop pointing to new foofs_special_file_ops
and its ->open() to be a boilerplate that would replace file->f_op with
the normal one in case of normal open()), but it's more boilerplate patches
and I really don't see what would it buy...
Comments?
next prev parent reply other threads:[~2009-06-24 10:53 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-18 6:55 [RFC] O_NOACC: open without any access Miklos Szeredi
2009-06-23 13:46 ` Christoph Hellwig
2009-06-23 14:12 ` Miklos Szeredi
2009-06-23 14:34 ` Christoph Hellwig
2009-06-23 15:13 ` Miklos Szeredi
2009-06-23 15:52 ` David Howells
2009-06-23 16:06 ` Alan Cox
2009-06-23 16:10 ` David Howells
2009-06-23 16:31 ` Miklos Szeredi
2009-06-23 16:33 ` Alan Cox
2009-06-23 17:05 ` David Howells
2009-06-23 17:34 ` Linus Torvalds
2009-06-23 20:04 ` Miklos Szeredi
2009-06-24 10:53 ` Al Viro [this message]
2009-06-24 11:12 ` Miklos Szeredi
2009-06-24 16:40 ` Linus Torvalds
2009-06-23 22:44 ` David Howells
2009-06-23 17:20 ` David Howells
2009-06-23 16:53 ` Christoph Hellwig
2009-06-23 16:59 ` David Howells
2009-06-24 17:02 ` Ulrich Drepper
2009-06-24 18:06 ` Miklos Szeredi
2009-06-24 18:34 ` Ulrich Drepper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090624105336.GO8633@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=adilger@sun.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dhowells@redhat.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).