Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754297Ab1CVTn1 (ORCPT ); Tue, 22 Mar 2011 15:43:27 -0400 Received: from fxip-0047f.externet.hu ([88.209.222.127]:38598 "EHLO pomaz-ex.szeredi.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753165Ab1CVTnV (ORCPT ); Tue, 22 Mar 2011 15:43:21 -0400 To: Al Viro CC: miklos@szeredi.hu, 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 In-reply-to: <20110322190002.GW22723@ZenIV.linux.org.uk> (message from Al Viro on Tue, 22 Mar 2011 19:00:02 +0000) Subject: Re: [PATCH 0/6 v7] overlay filesystem - request for inclusion References: <20110322152602.053930811@szeredi.hu> <20110322183919.GV22723@ZenIV.linux.org.uk> <20110322190002.GW22723@ZenIV.linux.org.uk> Message-Id: From: Miklos Szeredi Date: Tue, 22 Mar 2011 20:43:17 +0100 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1461 Lines: 49 On Tue, 22 Mar 2011, Al Viro wrote: > On Tue, Mar 22, 2011 at 07:58:17PM +0100, Miklos Szeredi wrote: > > On Tue, 22 Mar 2011, Linus Torvalds wrote: > > > On Tue, Mar 22, 2011 at 11:39 AM, Al Viro wrote: > > > > > > > > Locking analysis would be really nice; AFAICS, it violates locking order > > > > when called from e.g. ->setattr() > > > > Locking order is always: > > > > -> overlayfs locks > > -> upper fs locks > > -> lower fs locks > > > > So it's really pretty simple and easy to validate. > > In which *order* on the upper fs? In copy up it does: -> lock parent on upper -> lock child on upper So a setattr with copy up would go like this: -> lock child on overlayfs -> lock parent on upper ->lock child on upper -> lock child on upper > > Protection is exactly as for userspace callers. AFAICT. > > Pardon? You traverse the chain of ancestors; fine, but who says it stays > anywhere near being relevant as you go? Not quite sure I understand. There are no assumptions about locks in overlayfs keeping anything relevant in upper/lower fs. Everything is re-checked and re-locked on the upper layer before proceeding with the rename. Thanks, Miklos -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/