From mboxrd@z Thu Jan 1 00:00:00 1970 From: Valerie Aurora Subject: Re: [PATCH 21/32] union-mount: Make lookup work for union-mounted file systems Date: Tue, 19 May 2009 13:30:38 -0400 Message-ID: <20090519173038.GC722@shell> References: <1242662968-11684-1-git-send-email-jblunck@suse.de> <1242662968-11684-22-git-send-email-jblunck@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: jblunck@suse.de, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, bharata@in.ibm.com, dwmw2@infradead.org, mszeredi@suse.cz To: Miklos Szeredi Return-path: Received: from mx1.redhat.com ([66.187.233.31]:48242 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752005AbZESRbo (ORCPT ); Tue, 19 May 2009 13:31:44 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, May 19, 2009 at 06:15:52PM +0200, Miklos Szeredi wrote: > On Mon, 18 May 2009, Jan Blunck wrote: > > On union-mounted file systems the lookup function must also visit lower layers > > of the union-stack when doing a lookup. This patches add support for > > union-mounts to cached lookups and real lookups. > > > > We have 3 different styles of lookup functions now: > > - multiple pathname components, follow mounts, follow union, follow symlinks > > - single pathname component, doesn't follow mounts, follow union, doesn't > > follow symlinks > > - single pathname component doesn't follow mounts, doesn't follow unions, > > doesn't follow symlinks > > Ugh... I do wonder if this could be done in a less complicated way, > there does seem to be a fair amount of duplication between these > functions. Yeah, I agree. My best idea so far is not very good - have one skeleton function and pass in function pointers for the lookup_topmost() and build_union() functions. Do you have any ideas? > Worse, it looks like there are still i_mutex lock ordering issues > (__hash_lookup_topmost()/__hash_lookup_build_union()). What happens > if two separate unions of two filesystems are built where the order of > branches is reversed? We have a similar problem in union_copyup_dir(). Hm, thinking about this, only one of the file systems can actually change while we are doing work. That might help us get out of the lock ordering problems. Thoughts? -VAL