:> > I don't remember when I started seeing this, but `df' doesn't show
:> > the rootfs from inside jail, but any other mountpoints are visible.
:>
:> Correction: this is NOT specific to jail, but the same goes for chroot'ed
:> environment.
:
:I still got no clue for this, but the getfsstat(2) behavior is
:definitely wrong:
:

I'll fix it. It's the new namecache code. chroot_visible_mnt()
is not aware of the new way filesystems are glued together.

:At first I thought that chroot_visible_mnt() was to be blamed, but
:the behavior doesn't change even if I changed it to always return 1.
:
:Cheers.

Hmm. Yes, you are right. chroot_visible_mnt() is working properly.

The problem is that the real mount point is not visible to the
chroot, because it is above the chroot.

chroot /home/root.jail /bin/csh
df /

/home/root.jail is not a mount point. The mount point for that directory
is /home (on my system) which is 'above' the jail, so cache_fullpath()
traverses from 'above' the jail and never locates the process's root.

We have to fake the root mount description in this case. I'll have to
think about this.