From mboxrd@z Thu Jan 1 00:00:00 1970 From: ron minnich To: 9fans@cse.psu.edu Subject: Re: [9fans] ls, rc question In-Reply-To: <200403190532.i2J5W2MU097145@adat.davidashen.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Thu, 18 Mar 2004 22:50:10 -0700 Topicbox-Message-UUID: 37a6af60-eacd-11e9-9e20-41e7f4b1d025 Well, I guess it's confusing the way some union stuff works, but once you start trying to do things with unions to make them less weird, it can get ugly fast, see this from a bsd list: " Perhaps one situation would be, modify a lower-layer file so that the modified file now exists in the upper layer, with the original still in the lower layer. Then try to delete the file. The upper-layer version will be deleted, but we don't want the lower-layer version to now start showing up, because we 'delete'd it. We also don't want to delete the lower-layer version, because it's a union filesystem, and that's one of the features of a union mount -- the lower layer is not allowed to change (much). So, cover up the lower-layer version with 'whiteout' in the upper layer so that it becomes not visible to the union-mount, but still exists via non-union-mount access. " Also see rm -W on bsd. Or how about this: "Running find(1) over a union tree has the side-effect of creating a tree of shadow directories in the upper layer." BSD does do this: "In this example, /b is layered over an empty directory /mnt, then /a is layered over the new view of /mnt. Duplicate names are suppressed so that only one occurrence of `x' (and also `.' and `..') will appear." (see http://www.usenix.org/publications/library/proceedings/neworl/full_papers/mckusick.a) Seems once you start to try to get smart there's no end to it. I've had it put to me that union mounts would so hopelessly confuse users that they can't be used. The first time I showed them to a quite smart CS person she blanched a bit -- "how can anybody use that given you don't really know what those two files are?" And here I was showing it off -- "see how you can build kernels outside the kernel tree". The only reaction was: "yeah but having two pccpu files show up in ls is hopelessly confusing. " I had to disagree :-) The thing is, reads from a union directory do in fact give you the union. But what would you do for stat etc? I'm not sure you could do much different that has been done without really making the kernel pretty dirty (see above). ron