From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] union directories From: "rob pike" MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20010322032845.A4AE7199E7@mail.cse.psu.edu> Date: Wed, 21 Mar 2001 22:28:37 -0500 Topicbox-Message-UUID: 72fc3a98-eac9-11e9-9e20-41e7f4b1d025 The manual says "creation goes to the first element of the union that permits creation". Doesn't that means that it shoud jump non_writable?. Actually, the manual page bind(1) says, [-c] can be used in addition to any of the above to permit creation in a union directory. When a new file is created in a union directory, it is placed in the first element of the union that permits creation. In this context, I don't feel it's ambiguous. Bind(2) says, When a create system call (see open (2)) attempts to create in a union directory, and the file does not exist, the elements of the union are searched in order until one is found with MCREATE set. The file is created in that directory; if that attempt fails, the create fails. which is even clearer. As to what it *should* do, this topic was one of the most discussed in the early days of the system. The current behavior obviously reflects an easy implementation. It's worked well in practice but better designs may exist. Lookup should win whenever creation wins. I'm not sure what this means. There's no "winning" going on, and lookup cannot work the same as creation if the file does not exist, since there's nothing to look up. If there is an existing file with that name, in any element of the union, it is the one to which creation will always apply. This is all a legacy of Unix's model that create means two different things in the two situations. -rob