aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2014-11-26 17:27:43 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-11-26 17:34:14 -0500
commit1702562db4bf6d43f60c2263ac7bec1f58d49c33 (patch)
treeb971f0d7a20451ed3560389c15971019376445c7 /fs/nfs
parent624bd5b7b683c978c6d5f4e9f6142cfb3470983d (diff)
parentc2ef47b7f518f5eae5ffed11b8ac754fb263d398 (diff)
Merge tag 'nfs-cel-for-3.19' of git://git.linux-nfs.org/projects/anna/nfs-rdma into linux-next
Pull pull additional NFS client changes for 3.19 from Anna Schumaker: "NFS: Generic client side changes from Chuck These patches fixes for iostats and SETCLIENTID in addition to cleaning up the nfs4_init_callback() function. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>" * tag 'nfs-cel-for-3.19' of git://git.linux-nfs.org/projects/anna/nfs-rdma: NFS: Clean up nfs4_init_callback() NFS: SETCLIENTID XDR buffer sizes are incorrect SUNRPC: serialize iostats updates
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4client.c31
-rw-r--r--fs/nfs/nfs4xdr.c10
2 files changed, 20 insertions, 21 deletions
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 5f07a0ed9188..03311259b0c4 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -241,28 +241,25 @@ void nfs4_free_client(struct nfs_client *clp)
241 */ 241 */
242static int nfs4_init_callback(struct nfs_client *clp) 242static int nfs4_init_callback(struct nfs_client *clp)
243{ 243{
244 struct rpc_xprt *xprt;
244 int error; 245 int error;
245 246
246 if (clp->rpc_ops->version == 4) { 247 xprt = rcu_dereference_raw(clp->cl_rpcclient->cl_xprt);
247 struct rpc_xprt *xprt;
248 248
249 xprt = rcu_dereference_raw(clp->cl_rpcclient->cl_xprt); 249 if (nfs4_has_session(clp)) {
250 250 error = xprt_setup_backchannel(xprt, NFS41_BC_MIN_CALLBACKS);
251 if (nfs4_has_session(clp)) { 251 if (error < 0)
252 error = xprt_setup_backchannel(xprt,
253 NFS41_BC_MIN_CALLBACKS);
254 if (error < 0)
255 return error;
256 }
257
258 error = nfs_callback_up(clp->cl_mvops->minor_version, xprt);
259 if (error < 0) {
260 dprintk("%s: failed to start callback. Error = %d\n",
261 __func__, error);
262 return error; 252 return error;
263 }
264 __set_bit(NFS_CS_CALLBACK, &clp->cl_res_state);
265 } 253 }
254
255 error = nfs_callback_up(clp->cl_mvops->minor_version, xprt);
256 if (error < 0) {
257 dprintk("%s: failed to start callback. Error = %d\n",
258 __func__, error);
259 return error;
260 }
261 __set_bit(NFS_CS_CALLBACK, &clp->cl_res_state);
262
266 return 0; 263 return 0;
267} 264}
268 265
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 03d0fa62a06e..cb4376b78ed9 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -141,13 +141,15 @@ static int nfs4_stat_to_errno(int);
141 XDR_QUADLEN(NFS4_VERIFIER_SIZE) + \ 141 XDR_QUADLEN(NFS4_VERIFIER_SIZE) + \
142 XDR_QUADLEN(NFS4_SETCLIENTID_NAMELEN) + \ 142 XDR_QUADLEN(NFS4_SETCLIENTID_NAMELEN) + \
143 1 /* sc_prog */ + \ 143 1 /* sc_prog */ + \
144 XDR_QUADLEN(RPCBIND_MAXNETIDLEN) + \ 144 1 + XDR_QUADLEN(RPCBIND_MAXNETIDLEN) + \
145 XDR_QUADLEN(RPCBIND_MAXUADDRLEN) + \ 145 1 + XDR_QUADLEN(RPCBIND_MAXUADDRLEN) + \
146 1) /* sc_cb_ident */ 146 1) /* sc_cb_ident */
147#define decode_setclientid_maxsz \ 147#define decode_setclientid_maxsz \
148 (op_decode_hdr_maxsz + \ 148 (op_decode_hdr_maxsz + \
149 2 + \ 149 2 /* clientid */ + \
150 1024) /* large value for CLID_INUSE */ 150 XDR_QUADLEN(NFS4_VERIFIER_SIZE) + \
151 1 + XDR_QUADLEN(RPCBIND_MAXNETIDLEN) + \
152 1 + XDR_QUADLEN(RPCBIND_MAXUADDRLEN))
151#define encode_setclientid_confirm_maxsz \ 153#define encode_setclientid_confirm_maxsz \
152 (op_encode_hdr_maxsz + \ 154 (op_encode_hdr_maxsz + \
153 3 + (NFS4_VERIFIER_SIZE >> 2)) 155 3 + (NFS4_VERIFIER_SIZE >> 2))