On Tue, 2019-04-02 at 20:36 -0400, J. Bruce Fields wrote: > On Tue, Apr 02, 2019 at 04:14:42PM -0700, Trond Myklebust wrote: > > The current knfsd implementation is unable to support containers > > that > > want to run different combinations of NFS versions. This is because > > of > > the way we define which versions are supported: by directly editing > > the > > global version table in 'nfsd_program'. > > The following patch set modifies the method used to define version > > information by moving some of the server RPC request initialisation > > down into knfsd itself, allowing it to manage the version-specific > > initialisation. > > Sounds fine, though I'm curious what the motivation is. > > I assume the current behavior is that setting versions from any > container sets them globally (rather than erroring out or something)- > -so > is there any way some can detect whether they've got the new behavior > other than trying it and seeing what the result is in another > container? > The main motivation is to allow knfsd to work in a container, just like it would in a VM. We have an application where we want to export two different sets of filesystems on the same host, but we want to export the first set of filesystems as NFSv3 only, and the second as NFSv3+NFSv4.x. We could potentially do this by extending the export file syntax, but why do that when you can achieve the same result just by fixing containers to work as expected? > --b. > > > Note that we might want to consider a few follow ups to this > > patchset > > to get rid of some of the version-specific flags (e.g. vs_hidden) > > that > > currently need to be managed in the generic SUNRPC server code on > > behalf > > of just one or two RPC programs. These flags can easily by replaced > > by > > custom RPC request initialisers. > > > > Trond Myklebust (6): > > SUNRPC/nfs: Fix return value for nfs4_callback_compound() > > SUNRPC: Add a callback to initialise server requests > > SUNRPC: Clean up generic dispatcher code > > SUNRPC: Allow further customisation of RPC program registration > > nfsd: Add custom rpcbind callbacks for knfsd > > nfsd: Allow containers to set supported nfs versions > > > > fs/lockd/svc.c | 4 +- > > fs/nfs/callback.c | 2 + > > fs/nfs/callback_xdr.c | 2 +- > > fs/nfsd/netns.h | 8 + > > fs/nfsd/nfs4proc.c | 3 +- > > fs/nfsd/nfsctl.c | 25 +-- > > fs/nfsd/nfsd.h | 8 +- > > fs/nfsd/nfssvc.c | 251 +++++++++++++++++++++++++----- > > include/linux/sunrpc/svc.h | 33 ++++ > > net/sunrpc/svc.c | 310 ++++++++++++++++++++++++--------- > > ---- > > 10 files changed, 480 insertions(+), 166 deletions(-) > > > > -- > > 2.20.1 > > -- Trond Myklebust Linux NFS client maintainer, Hammerspace trond.myklebust@xxxxxxxxxxxxxxx