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. 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. --- v2: Fix compile issues when CONFIG_NFSD_V2_ACL and CONFIG_NFSD_V3_ACL are undefined. Don't move the svc_reserve() call in svc_process_common(), since that can trigger 'RPC request reserved xxx but used yyy' issues. 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 | 255 +++++++++++++++++++++++++------ include/linux/sunrpc/svc.h | 33 ++++ net/sunrpc/svc.c | 298 ++++++++++++++++++++++++------------- 10 files changed, 478 insertions(+), 160 deletions(-) -- 2.20.1