From owner-freebsd-current Fri Feb 26 5:36:49 1999 Delivered-To: freebsd-current@freebsd.org Received: from server.noc.demon.net (server.noc.demon.net [193.195.224.4]) by hub.freebsd.org (Postfix) with ESMTP id 66F8014F48 for ; Fri, 26 Feb 1999 05:36:20 -0800 (PST) (envelope-from fanf@demon.net) Received: by server.noc.demon.net; id NAA02681; Fri, 26 Feb 1999 13:36:03 GMT Received: from fanf.noc.demon.net(195.11.55.83) by inside.noc.demon.net via smap (3.2) id xmab02672; Fri, 26 Feb 99 13:36:03 GMT Received: from fanf by fanf.noc.demon.net with local (Exim 1.73 #2) id 10GNQx-0002lU-00; Fri, 26 Feb 1999 13:36:03 +0000 To: current@freebsd.org From: Tony Finch Subject: Re: mount -o union broken recently? In-Reply-To: References: <199902252147.NAA01813@vashon.polstra.com> Message-Id: Date: Fri, 26 Feb 1999 13:36:03 +0000 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Julian Elischer wrote: >On Thu, 25 Feb 1999, John Polstra wrote: > >[...] >> >> Here, you did the union mount on top of an existing mount point (da1). >> I don't know for sure, but I suspect that this is the only case in >> which union mounts are designed to work. > >I was led to believe (last time I read the code) that any directory should >be ok for a union mount.... I was led to believe the same by the manual: union Causes the namespace at the mount point to appear as the union of the mounted filesystem root and the existing di- rectory. Lookups will be done in the mounted filesystem first. If those operations fail due to a non-existent file the underlying directory is then accessed. All cre- ates are done in the mounted filesystem. I did a brief experiment on the 3.0-RELEASE machine as follows: # mount /dev/da0s1a on / (local, writes: sync 1163 async 18438) procfs on /proc (local) /dev/da0s1e on /usr (local, writes: sync 363 async 41653) /dev/da1s1e on /www/da1 (local, writes: sync 12 async 38) # ls da1/subdir this_is_da1 # mount -o union /dev/da2s1e da1/subdir # ls da1/subdir this_is_da1 this_is_da2 # So that machine is happy enough with union nounts on top of subdirectories. On the 3.1-STABLE machine, I tried union mounting on top of a mount point: # mount /dev/da0s1a on / (local, writes: sync 9824 async 55852) /dev/da0s1e on /www (local, writes: sync 5484 async 10400) procfs on /proc (local) /dev/da0s1f on /srcdelta (local, writes: sync 2569 async 2659) # ls /srcdelta thing # ls /www apache obj # umount /srcdelta # mount -o union /dev/da0s1f /www # ls /www thing # Still no joy. Is it sorrect that this magic is implemented in sys/kern/vfs_lookup.c? The odd thing is that AFAICS no-one has made significant changes to this code. Tony. -- f.a.n.finch dot@dotat.at fanf@demon.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message