mounting a tree with mount_nullfs does not work as expected if the filesystem has other nullfs filesystems mounted below. The files from the tree itself show up, but not the files from mountpoints under the tree. See below for an example. Expected behaviour would be that all mountpoints from the nullfs mount show up on the tree that it's mounted on. Fix: Unknown How-To-Repeat: My original use-case: # mkdir -p testdir shares/testdir somejail/shares # touch testdir/{moo,cow} # ls testdir cow moo # mount_nullfs -o ro testdir shares/testdir # mount_nullfs -o ro shares somejail/shares # ls shares/testdir/ cow moo # ls somejail/shares/testdir/ # ^^^^ no files here
Responsible Changed From-To: freebsd-bugs->freebsd-fs Over to maintainer(s).
That is expected behaviour, according to mount_nullfs(8): The mount_nullfs utility creates a null layer, duplicating a sub-tree of the file system name space under another part of the global file system namespace. It mentions sub-tree of a single file system only. nullfs is technically very different from loop mounts in Linux or nullfs in DragonFly, it doesn't map part of file name space elsewhere, but duplicates file system sub-tree. Messing with v_mountedhere in nullfs would bring much more trouble than it can potentially solve: VFS_VGET(), full path lookups, etc. We could add mount option to automatically nullfs-mount nested mounts, but it also feels overcomplicated: unmounting may be difficult, should we track new mounts, etc. Mounting nullfs over nullfs is a very bad idea imo (it it's not forbidden, I'd also suggest not to NFS export nullfs). I think writing a small script to do nested mounts/unmounts that suites your needs would be the best option here.
On Mon, Nov 21, 2011 at 16:23:47 +0200, Gleb Kurtsou wrote: > That is expected behaviour, according to mount_nullfs(8): -snip- Alright. Care to close the PR then? > I think writing a small script to do nested mounts/unmounts that suites > your needs would be the best option here. That's what I've done. Thanks!
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
As I can see in comment #3, the problem seems to be resolved.