From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Van Hensbergen" Subject: Re: [RFC][PATCH 2/14] Add a new mount flag (MNT_UNION) for union mount Date: Tue, 15 May 2007 07:06:30 -0500 Message-ID: References: <20070514093722.GB4139@in.ibm.com> <20070514093902.GD4139@in.ibm.com> <20070515081652.GD3465@in.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Jan Engelhardt" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Jan Blunck" To: bharata@linux.vnet.ibm.com Return-path: Received: from wr-out-0506.google.com ([64.233.184.232]:29592 "EHLO wr-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756413AbXEOMGb (ORCPT ); Tue, 15 May 2007 08:06:31 -0400 Received: by wr-out-0506.google.com with SMTP id 76so2122956wra for ; Tue, 15 May 2007 05:06:30 -0700 (PDT) In-Reply-To: <20070515081652.GD3465@in.ibm.com> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On 5/15/07, Bharata B Rao wrote: > > So there can be two cases in union mounts: > 1. A file exists in topmost layer and also in one or more lower layers. Deleting > the file would result in the top layer file being deleted and a whiteout being > created in the top layer. > > 2. A file exists in one or more of lower layers, but not in the topmost layer. > Deleting this file would result in just a whiteout being created in the > topmost layer. > I'd imagine there is a third potential option, which I'll admit strays a bit from the conventional UNIX semantic. If only one layer is marked as writable, then any changes (including delete) only effect that layer. I could imagine this would be useful in situations like overlaying a sandbox on an otherwise read-only source code tree (you might want to just get rid of a modification by removing your file and have it replaced by the original underlying source). I suppose a further extension would be to have multiple layers marked as mutable and functions such as delete would effect all mutable layers, but functions like create would only affect the top mutable layer. As an aside, perhaps it would be useful to mark the mutable layer at mount time (instead of having it always be the top layer). Again this could lead to some optional non-conventional file system semantics, but its proven useful in Plan 9 union mount semantics and it seems a fairly trivial extension to what you currently have. -eric