From: Ray Strode <rstrode@redhat.com>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Rik van Riel <riel@redhat.com>, Andreas Dilger <adilger@sun.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
elb@psg.com
Subject: Re: RFC: O_PONIES semantics (well O_REWRITE)
Date: Thu, 11 Jun 2009 10:32:52 -0400 (EDT) [thread overview]
Message-ID: <2052026674.3251581244730772312.JavaMail.root@zmail02.collab.prod.int.phx2.redhat.com> (raw)
In-Reply-To: <1244730231.5047.11.camel@heimdal.trondhjem.org>
Hi,
> How is this any different than just having your application use
> mkostemp() to create a temporary dot file, then renaming it when done
> writing?
Creating a temporary file and renaming is what applications do now, but it has problems that Rik already mentioned:
- Apps forget to fsync() before rename()
- Apps forget to copy permissions over
- Apps forget to copy acls, selinux labels, and other xattrs over
- Apps create the temporary file in /tmp and then the rename() fails on systems where /tmp is a separate mount
It's not that it's not possible to do, it's that it's hard to do right. There are a huge number of hoops to jump through to just to properly save a file.
And apps get it wrong. Most apps get it wrong in some way or another.
Also if it's in the kernel then filesystems could potentially hook into the process and prevent the early sync.
--Ray
next prev parent reply other threads:[~2009-06-11 14:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 1:03 RFC: O_PONIES semantics (well O_REWRITE) Rik van Riel
2009-06-11 5:53 ` Andreas Dilger
2009-06-11 14:06 ` Rik van Riel
2009-06-11 14:23 ` Trond Myklebust
2009-06-11 14:32 ` Ray Strode [this message]
2009-06-17 13:52 ` Rik van Riel
2009-06-11 9:51 ` Artem Bityutskiy
2009-06-12 2:07 ` Jamie Lokier
2009-06-12 2:20 ` Matthew Wilcox
2009-06-12 17:06 ` Ray Strode
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=2052026674.3251581244730772312.JavaMail.root@zmail02.collab.prod.int.phx2.redhat.com \
--to=rstrode@redhat.com \
--cc=adilger@sun.com \
--cc=elb@psg.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=riel@redhat.com \
--cc=trond.myklebust@fys.uio.no \
/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).