From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 0/6 v7] overlay filesystem - request for inclusion Date: Tue, 22 Mar 2011 20:11:01 +0000 Message-ID: <20110322201101.GZ22723@ZenIV.linux.org.uk> References: <20110322152602.053930811@szeredi.hu> <20110322183919.GV22723@ZenIV.linux.org.uk> <20110322190002.GW22723@ZenIV.linux.org.uk> <20110322195331.GY22723@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, apw@canonical.com, nbd@openwrt.org, neilb@suse.de To: Miklos Szeredi Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, Mar 22, 2011 at 09:06:38PM +0100, Miklos Szeredi wrote: > On Tue, 22 Mar 2011, Al Viro wrote: > > Proceeding with rename is not interesting; proceeding with copyup is. > > > > Who said that by the time we get to copy_up_locked you will still have > > dentry (and upper) match lowerpath? Or that ->d_parent on overlay and > > on upper will change in sync, for that matter - there are two d_move() > > calls involved... > > If rename is involved, than rename itself already did the copy up. > And that's checked before proceeding with the actual copy up. If > there was no rename, then that guarantees that things are in sync, at > least for the duration of the copy up. What do you mean, before? It's not atomic... What happens if e.g. you get A: decided to do copy_up_locked blocked on i_mutex B: did copy_up did rename(), complete with d_move() did unlink() in new place A: got CPU back, got i_mutex proceeded to copy lower into new location set dentry to very odd (upper,lower) pair