From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [RFC] atomic create+open
Date: Thu, 06 Oct 2005 12:41:04 -0400 [thread overview]
Message-ID: <1128616864.8396.32.camel@lade.trondhjem.org> (raw)
In-Reply-To: <E1ENWt1-000363-00@dorka.pomaz.szeredi.hu>
to den 06.10.2005 Klokka 16:38 (+0200) skreiv Miklos Szeredi:
> Currently it's impossible to implement a network filesystem that is
>
> a) served by an unprivileged userspace process
>
> b) supports "strange" open semantics, e.g.:
>
> open("foo", O_WRONLY | O_CREAT, 0400);
>
> c) not overly "hacky"
>
> The basic problem is that because of a) permission checking cannot be
> separated from the actual operations.
>
> By the time the ->open method is called, the file has been created
> with a read-only mode, and the server won't be able to open it in
> write mode.
>
> Several hacks come to mind for solving this, but these have severe
> problems and are excluded.
>
> One approach for solving this properly is to add a new atomic
> create+open method to inode operations. The prototype would be a
> merger of ->create() and ->open, like this:
>
> int (*create_open) (struct inode *dir, struct dentry *dentry, int mode,
> struct file *filp);
The reason why we do it as a lookup intent is because this has to be
atomic lookup+create+open in order to be at all useful to NFS.
Just doing create+open atomically is worthless since it leaves you with
a bunch of races where someone on the server can create, say, a symlink
between the RPC call to lookup and the RPC call that creates the file.
> A different approach is to extend the open_intents structure and allow
> the filesystem to do the open from ->create(), but this is a much less
> clean interface. Trond Myklebust has a patch that does this (no longer
> applies):
>
> http://client.linux-nfs.org/Linux-2.6.x/2.6.12/linux-2.6.12-63-open_file_intents.dif
I'm going to fix this up.
Cheers,
Trond
next prev parent reply other threads:[~2005-10-06 16:41 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-06 14:38 Miklos Szeredi
2005-10-06 16:41 ` Trond Myklebust [this message]
2005-10-06 17:02 ` Miklos Szeredi
2005-10-06 17:06 ` Miklos Szeredi
2005-10-06 17:25 ` Trond Myklebust
2005-10-06 17:30 ` Miklos Szeredi
2005-10-06 17:42 ` Trond Myklebust
2005-10-06 17:51 ` Miklos Szeredi
2005-10-06 18:00 ` Jamie Lokier
2005-10-06 18:48 ` Daniel Jacobowitz
2005-10-06 18:38 ` Trond Myklebust
2005-10-06 18:49 ` Miklos Szeredi
2005-10-06 19:17 ` Trond Myklebust
2005-10-06 20:17 ` Miklos Szeredi
2005-10-06 21:12 ` Trond Myklebust
2005-10-07 6:01 ` Miklos Szeredi
2005-10-07 13:38 ` Trond Myklebust
2005-10-07 13:59 ` Miklos Szeredi
2005-10-07 14:47 ` Trond Myklebust
2005-10-07 15:18 ` Miklos Szeredi
2005-10-07 16:01 ` Trond Myklebust
2005-10-07 17:20 ` Miklos Szeredi
2005-10-07 15:13 ` Trond Myklebust
2005-10-07 15:28 ` Miklos Szeredi
2005-10-07 16:23 ` Trond Myklebust
2005-10-07 17:27 ` Miklos Szeredi
2005-10-07 17:36 ` Trond Myklebust
[not found] ` <1129061494.11164.38.camel@lade.trondhjem.org>
[not found] ` <E1EPeM4-0000Xz-00@dorka.pomaz.szeredi.hu>
2005-10-12 13:20 ` Trond Myklebust
2005-10-12 13:52 ` Miklos Szeredi
2005-10-12 19:01 ` Trond Myklebust
2005-10-12 19:53 ` Miklos Szeredi
2005-10-12 15:20 ` Miklos Szeredi
2005-10-06 17:07 ` Trond Myklebust
2005-10-06 17:23 ` Miklos Szeredi
2005-10-06 17:36 ` Trond Myklebust
2005-10-06 17:47 ` Miklos Szeredi
2005-10-06 17:59 ` Jamie Lokier
2005-10-06 18:13 ` Miklos Szeredi
2005-10-06 18:42 ` Trond Myklebust
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=1128616864.8396.32.camel@lade.trondhjem.org \
--to=trond.myklebust@fys.uio.no \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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
all inboxes | Powered by JetHome®