From: Valerie Aurora <vaurora@redhat.com>
To: Jamie Lokier <jamie@shareable.org>
Cc: "J. R. Okajima" <hooanon05@yahoo.co.jp>,
linux-fsdevel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
Erez Zadok <ezk@cs.sunysb.edu>,
Christoph Hellwig <hch@infradead.org>
Subject: Re: Union mounts and fchown/fchmod/utimensat
Date: Tue, 30 Mar 2010 17:31:22 -0400 [thread overview]
Message-ID: <20100330213122.GA15431@shell> (raw)
In-Reply-To: <20100329234843.GG9876@shareable.org>
On Tue, Mar 30, 2010 at 12:48:43AM +0100, Jamie Lokier wrote:
> Valerie Aurora wrote:
> > I'm working on the assumption that this is okay. Basically, an
> > in-kernel copyup has the same effect on an application with an
> > O_RDONLY fd as a userland copy-up to a temporary file followed by a
> > rename() to the original name. Editors, among other applications, use
> > this sequence all the time. If it breaks under union mount copyup, it
> > will also break if you edit the file with vi.
>
> Ouch. That's fine for rename-over style updates, but if an
> application depends on in-place updates, or if it depends on file
> locking to serialise something (using O_RDONLY for read locks and
> O_RDWR for write locks), it will get confused.
>
> Now, that may be acceptable compromise non-POSIX behaviour.
>
> But if it only works with rename-over style updates.... Why have
> in-kernel copyup at all? Why not simply forbid writes to lower files?
Hm, I'm not sure we're on the same page. In-kernel copyup will work
transparently in most cases. An application that opens multiple fds
with O_RDWR or O_WRONLY will see completely coherent changes. It's
only when an app opens a file O_RDONLY, and then depends on seeing
writes or metadata changes from some other agency (another app, or an
fd opened with write permission) that union mounts will break things.
The question is how common that is.
Does that make sense or I did I miss your point?
-VAL
prev parent reply other threads:[~2010-03-30 21:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-26 22:45 Union mounts and fchown/fchmod/utimensat Valerie Aurora
2010-03-27 15:43 ` J. R. Okajima
2010-03-29 18:39 ` Valerie Aurora
2010-03-29 23:48 ` Jamie Lokier
2010-03-30 11:16 ` Theodore Tso
2010-03-30 20:30 ` Valerie Aurora
2010-03-30 21:31 ` Valerie Aurora [this message]
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=20100330213122.GA15431@shell \
--to=vaurora@redhat.com \
--cc=ezk@cs.sunysb.edu \
--cc=hch@infradead.org \
--cc=hooanon05@yahoo.co.jp \
--cc=jamie@shareable.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).