This patch modifies the nfsd so that it can be run in a
vnet prison. The only outside of kernel change at this
time is a modification to the rc.d/nfsd script, so replacing
the kernel and putting the patched nfsd script in the prison's
etc/rc.d.
It is still very much a "work in progress" at this time.
Possible changes coming are:
- Doing the nfsstats per prison. They are now global to all prisons.
- Moving some of the "vfs.nfsd.*" sysctls into the prisons. These are now all global. Doing "sysctl -a | fgrep vfs,nfsd" will show you what these are. Note that, since minthreads, maxthreads are set on the nfsd command line, they can be adjusted per prison.
- All global mutexes are not in the prisons. This might result in increased lock contention. Most (except one of them) can be moved into the prisons, if needed.
- Nothing cleans up mutexes and kernel malloc'd space when a prison is shut down. I need to work on how to do this.
- Guards against starting it up incorrectly need to be added. This should be straightforward, but I need to know if the nfsuserd will need to be run inside a prison and whether or not NFSv3 support will be added before doing so.
Please post if you see the need to changes.
There is a brief setup document here:
https://people.freebsd.org/~rmacklem/nfsd-vnet-prison-setup.txt