diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2012-05-21 22:46:16 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-22 16:45:48 -0400 |
commit | acdeb69d9c5934a678a732b4e24770326bf9471e (patch) | |
tree | 818b6b385ecddc5bf2c7da2641ec55704b940b3b /fs/nfs/nfs4proc.c | |
parent | 4bf590e08f6db3395c181618a4c14f1c39b7c4af (diff) |
NFS: EXCHANGE_ID should save the server major and minor ID
Save the server major and minor ID results from EXCHANGE_ID, as they
are needed for detecting server trunking.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 9e9334a172cf..0d46fe449f0b 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -5109,11 +5109,18 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred) | |||
5109 | clp->cl_rpcclient->cl_nodename, | 5109 | clp->cl_rpcclient->cl_nodename, |
5110 | clp->cl_rpcclient->cl_auth->au_flavor); | 5110 | clp->cl_rpcclient->cl_auth->au_flavor); |
5111 | 5111 | ||
5112 | res.server_owner = kzalloc(sizeof(struct nfs41_server_owner), | ||
5113 | GFP_KERNEL); | ||
5114 | if (unlikely(res.server_owner == NULL)) { | ||
5115 | status = -ENOMEM; | ||
5116 | goto out; | ||
5117 | } | ||
5118 | |||
5112 | res.server_scope = kzalloc(sizeof(struct nfs41_server_scope), | 5119 | res.server_scope = kzalloc(sizeof(struct nfs41_server_scope), |
5113 | GFP_KERNEL); | 5120 | GFP_KERNEL); |
5114 | if (unlikely(res.server_scope == NULL)) { | 5121 | if (unlikely(res.server_scope == NULL)) { |
5115 | status = -ENOMEM; | 5122 | status = -ENOMEM; |
5116 | goto out; | 5123 | goto out_server_owner; |
5117 | } | 5124 | } |
5118 | 5125 | ||
5119 | res.impl_id = kzalloc(sizeof(struct nfs41_impl_id), GFP_KERNEL); | 5126 | res.impl_id = kzalloc(sizeof(struct nfs41_impl_id), GFP_KERNEL); |
@@ -5127,6 +5134,12 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred) | |||
5127 | status = nfs4_check_cl_exchange_flags(clp->cl_exchange_flags); | 5134 | status = nfs4_check_cl_exchange_flags(clp->cl_exchange_flags); |
5128 | 5135 | ||
5129 | if (status == 0) { | 5136 | if (status == 0) { |
5137 | kfree(clp->cl_serverowner); | ||
5138 | clp->cl_serverowner = res.server_owner; | ||
5139 | res.server_owner = NULL; | ||
5140 | } | ||
5141 | |||
5142 | if (status == 0) { | ||
5130 | /* use the most recent implementation id */ | 5143 | /* use the most recent implementation id */ |
5131 | kfree(clp->cl_implid); | 5144 | kfree(clp->cl_implid); |
5132 | clp->cl_implid = res.impl_id; | 5145 | clp->cl_implid = res.impl_id; |
@@ -5150,6 +5163,8 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred) | |||
5150 | } | 5163 | } |
5151 | } | 5164 | } |
5152 | 5165 | ||
5166 | out_server_owner: | ||
5167 | kfree(res.server_owner); | ||
5153 | out_server_scope: | 5168 | out_server_scope: |
5154 | kfree(res.server_scope); | 5169 | kfree(res.server_scope); |
5155 | out: | 5170 | out: |