aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-07-24 16:36:35 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-07-24 16:47:04 -0400
commit55b592933b7d0091d515ef1663334470a343ec98 (patch)
tree9d73d710561406a2097440e065bd5a9aad5e4591 /fs/nfs
parent1771c5774ba0b8ec35c3337fe9246f2f0f42b11b (diff)
NFSv4: Fix nfs4_init_uniform_client_string for net namespaces
Commit 6f2ea7f2a (NFS: Add nfs4_unique_id boot parameter) introduces a boot parameter that allows client administrators to set a string identifier for use by the EXCHANGE_ID and SETCLIENTID arguments in order to make them more globally unique. Unfortunately, that uniquifier is no longer globally unique in the presence of net namespaces, since each container expects to be able to set up their own lease when mounting a new NFSv4/4.1 partition. The fix is to add back in the container-specific hostname in addition to the unique id. Cc: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4proc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index c2fc5dd0a03c..0e64cccda0ac 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4662,10 +4662,14 @@ static unsigned int
4662nfs4_init_uniform_client_string(const struct nfs_client *clp, 4662nfs4_init_uniform_client_string(const struct nfs_client *clp,
4663 char *buf, size_t len) 4663 char *buf, size_t len)
4664{ 4664{
4665 char *nodename = clp->cl_rpcclient->cl_nodename; 4665 const char *nodename = clp->cl_rpcclient->cl_nodename;
4666 4666
4667 if (nfs4_client_id_uniquifier[0] != '\0') 4667 if (nfs4_client_id_uniquifier[0] != '\0')
4668 nodename = nfs4_client_id_uniquifier; 4668 return scnprintf(buf, len, "Linux NFSv%u.%u %s/%s",
4669 clp->rpc_ops->version,
4670 clp->cl_minorversion,
4671 nfs4_client_id_uniquifier,
4672 nodename);
4669 return scnprintf(buf, len, "Linux NFSv%u.%u %s", 4673 return scnprintf(buf, len, "Linux NFSv%u.%u %s",
4670 clp->rpc_ops->version, clp->cl_minorversion, 4674 clp->rpc_ops->version, clp->cl_minorversion,
4671 nodename); 4675 nodename);