Julian Elischer <jul...@whistle.com> 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 d...@dotat.at f...@demon.net To Unsubscribe: send mail to majord...@freebsd.org with "unsubscribe freebsd-current" in the body of the message