From: Jan Harkes <jaharkes@cs.cmu.edu>
To: linux-fsdevel@vger.kernel.org
Subject: Re: fixing redundant network opens on Linux file creation
Date: Mon, 6 Jan 2003 14:56:14 -0500 [thread overview]
Message-ID: <20030106195614.GA688@ravel.coda.cs.cmu.edu> (raw)
In-Reply-To: <OF67125828.C6A675A8-ON87256CA6.0069A3BC-88256CA6.006C0A33@us.ibm.com>
On Mon, Jan 06, 2003 at 11:42:26AM -0800, Bryan Henderson wrote:
> >There is a lookup intent patch from lustre group. It can be found
> >somewhere in the archives. Pushing that (or something along that lines)
> >to mainline and using that would be IMHO most beneficial
>
> Better still would be to add a "create-and-open" VFS call and have namei
> use it. This solves a number of problems, including the fact that it is
> impossible to correctly implement an exclusive create and open with a
> shared filesystem (because between when Linux confirms that the file
> doesn't exist and when Linux does the VFS create, another system may have
> created the file).
But create is a directory operation, while open is an operation on a
file. It is just a matter of convenience that open(..., O_CREAT)
happens to create the directory entry if it doesn't yet exist. Logically
they shouldn't be combined.
Perhaps having the exclusive create lock the object and pass that info
on to the associated open. In Coda these objects are named 'virgin
files'. And they have some special properties, such as being able to
write to a file you were allowed to create even when the ACL's are set
so that you have no write permission.
I sometimes wish that file creation would have been done the other way
around.
- Open/create a new, unnamed object, which gives a file handle.
- Link this open handle into the filesystem's namespace.
That way the application can lock the object, or write the data to it,
etc. before making it visible to the world. Might have solved some of
the possible inconsistencies for networked filesystems and is probably
more resiliant wrt. symlink attacks.
Jan
next prev parent reply other threads:[~2003-01-06 19:56 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-06 17:25 fixing redundant network opens on Linux file creation Steven French
2003-01-06 18:14 ` Richard Sharpe
2003-01-06 17:59 ` Jan Hudec
2003-01-06 19:42 ` Bryan Henderson
2003-01-06 19:56 ` Jan Harkes [this message]
2003-01-06 21:58 ` Bryan Henderson
2003-01-06 21:31 ` Andreas Dilger
2003-01-06 22:23 ` Bryan Henderson
2003-01-06 22:48 ` Andreas Dilger
2003-01-07 1:06 ` Bryan Henderson
2003-01-07 13:19 ` [Lustre-devel] " Mike Shaver
2003-01-07 17:28 ` Bryan Henderson
2003-01-07 18:50 ` Andreas Dilger
2003-01-08 17:52 ` Bryan Henderson
2003-01-08 19:11 ` Peter Braam
2003-01-09 2:08 ` Bryan Henderson
2003-01-09 3:36 ` Peter Braam
2003-01-06 22:18 ` Marcos Dione
2003-01-07 9:35 ` Jan Hudec
-- strict thread matches above, loose matches on Subject: below --
2003-01-06 18:46 Steven French
2003-01-06 19:26 ` Richard Sharpe
2003-01-06 20:29 ` Richard Sharpe
2003-01-06 20:50 Steven French
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=20030106195614.GA688@ravel.coda.cs.cmu.edu \
--to=jaharkes@cs.cmu.edu \
--cc=linux-fsdevel@vger.kernel.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).