aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index e7f8d5ff2581..c347705b0161 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1117,8 +1117,6 @@ static int can_open_delegated(struct nfs_delegation *delegation, fmode_t fmode)
1117 return 0; 1117 return 0;
1118 if ((delegation->type & fmode) != fmode) 1118 if ((delegation->type & fmode) != fmode)
1119 return 0; 1119 return 0;
1120 if (test_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags))
1121 return 0;
1122 if (test_bit(NFS_DELEGATION_RETURNING, &delegation->flags)) 1120 if (test_bit(NFS_DELEGATION_RETURNING, &delegation->flags))
1123 return 0; 1121 return 0;
1124 nfs_mark_delegation_referenced(delegation); 1122 nfs_mark_delegation_referenced(delegation);
@@ -4917,11 +4915,14 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
4917} 4915}
4918 4916
4919static unsigned int 4917static unsigned int
4920nfs4_init_nonuniform_client_string(const struct nfs_client *clp, 4918nfs4_init_nonuniform_client_string(struct nfs_client *clp,
4921 char *buf, size_t len) 4919 char *buf, size_t len)
4922{ 4920{
4923 unsigned int result; 4921 unsigned int result;
4924 4922
4923 if (clp->cl_owner_id != NULL)
4924 return strlcpy(buf, clp->cl_owner_id, len);
4925
4925 rcu_read_lock(); 4926 rcu_read_lock();
4926 result = scnprintf(buf, len, "Linux NFSv4.0 %s/%s %s", 4927 result = scnprintf(buf, len, "Linux NFSv4.0 %s/%s %s",
4927 clp->cl_ipaddr, 4928 clp->cl_ipaddr,
@@ -4930,24 +4931,32 @@ nfs4_init_nonuniform_client_string(const struct nfs_client *clp,
4930 rpc_peeraddr2str(clp->cl_rpcclient, 4931 rpc_peeraddr2str(clp->cl_rpcclient,
4931 RPC_DISPLAY_PROTO)); 4932 RPC_DISPLAY_PROTO));
4932 rcu_read_unlock(); 4933 rcu_read_unlock();
4934 clp->cl_owner_id = kstrdup(buf, GFP_KERNEL);
4933 return result; 4935 return result;
4934} 4936}
4935 4937
4936static unsigned int 4938static unsigned int
4937nfs4_init_uniform_client_string(const struct nfs_client *clp, 4939nfs4_init_uniform_client_string(struct nfs_client *clp,
4938 char *buf, size_t len) 4940 char *buf, size_t len)
4939{ 4941{
4940 const char *nodename = clp->cl_rpcclient->cl_nodename; 4942 const char *nodename = clp->cl_rpcclient->cl_nodename;
4943 unsigned int result;
4944
4945 if (clp->cl_owner_id != NULL)
4946 return strlcpy(buf, clp->cl_owner_id, len);
4941 4947
4942 if (nfs4_client_id_uniquifier[0] != '\0') 4948 if (nfs4_client_id_uniquifier[0] != '\0')
4943 return scnprintf(buf, len, "Linux NFSv%u.%u %s/%s", 4949 result = scnprintf(buf, len, "Linux NFSv%u.%u %s/%s",
4944 clp->rpc_ops->version, 4950 clp->rpc_ops->version,
4945 clp->cl_minorversion, 4951 clp->cl_minorversion,
4946 nfs4_client_id_uniquifier, 4952 nfs4_client_id_uniquifier,
4947 nodename); 4953 nodename);
4948 return scnprintf(buf, len, "Linux NFSv%u.%u %s", 4954 else
4955 result = scnprintf(buf, len, "Linux NFSv%u.%u %s",
4949 clp->rpc_ops->version, clp->cl_minorversion, 4956 clp->rpc_ops->version, clp->cl_minorversion,
4950 nodename); 4957 nodename);
4958 clp->cl_owner_id = kstrdup(buf, GFP_KERNEL);
4959 return result;
4951} 4960}
4952 4961
4953/* 4962/*