From mboxrd@z Thu Jan 1 00:00:00 1970 From: Valerie Aurora Subject: Re: Union mounts and fchown/fchmod/utimensat Date: Tue, 30 Mar 2010 17:31:22 -0400 Message-ID: <20100330213122.GA15431@shell> References: <20100326224533.GB29874@shell> <23818.1269704603@jrobl> <20100329183925.GA24328@shell> <20100329234843.GG9876@shareable.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "J. R. Okajima" , linux-fsdevel@vger.kernel.org, Alexander Viro , Erez Zadok , Christoph Hellwig To: Jamie Lokier Return-path: Received: from mx1.redhat.com ([209.132.183.28]:63161 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752272Ab0C3Vbp (ORCPT ); Tue, 30 Mar 2010 17:31:45 -0400 Content-Disposition: inline In-Reply-To: <20100329234843.GG9876@shareable.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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