aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2011-01-05 21:04:32 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-01-06 14:46:24 -0500
commitc36fca52f5e4594ffd0ff175b328966b0d393184 (patch)
tree6d771744cc49f0edc0d2b6b2f9fe919163002346 /include/linux/sunrpc
parent2c2618c6f29c41a0a966f14f05c8bf45fcabb750 (diff)
NFS refactor nfs_find_client and reference client across callback processing
Fixes a bug where the nfs_client could be freed during callback processing. Refactor nfs_find_client to use minorversion specific means to locate the correct nfs_client structure. In the NFS layer, V4.0 clients are found using the callback_ident field in the CB_COMPOUND header. V4.1 clients are found using the sessionID in the CB_SEQUENCE operation which is also compared against the sessionID associated with the back channel thread after a successful CREATE_SESSION. Each of these methods finds the one an only nfs_client associated with the incoming callback request - so nfs_find_client_next is not needed. In the RPC layer, the pg_authenticate call needs to find the nfs_client. For the v4.0 callback service, the callback identifier has not been decoded so a search by address, version, and minorversion is used. The sessionid for the sessions based callback service has (usually) not been set for the pg_authenticate on a CB_NULL call which can be sent prior to the return of a CREATE_SESSION call, so the sessionid associated with the back channel thread is not used to find the client in pg_authenticate for CB_NULL calls. Pass the referenced nfs_client to each CB_COMPOUND operation being proceesed via the new cb_process_state structure. The reference is held across cb_compound processing. Use the new cb_process_state struct to move the NFS4ERR_RETRY_UNCACHED_REP processing from process_op into nfs4_callback_sequence where it belongs. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/bc_xprt.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h
index 7c91260c44a9..2c60e094fdec 100644
--- a/include/linux/sunrpc/bc_xprt.h
+++ b/include/linux/sunrpc/bc_xprt.h
@@ -47,6 +47,14 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
47 return 1; 47 return 1;
48 return 0; 48 return 0;
49} 49}
50static inline struct nfs4_sessionid *bc_xprt_sid(struct svc_rqst *rqstp)
51{
52 if (svc_is_backchannel(rqstp))
53 return (struct nfs4_sessionid *)
54 rqstp->rq_server->bc_xprt->xpt_bc_sid;
55 return NULL;
56}
57
50#else /* CONFIG_NFS_V4_1 */ 58#else /* CONFIG_NFS_V4_1 */
51static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, 59static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
52 unsigned int min_reqs) 60 unsigned int min_reqs)
@@ -59,6 +67,11 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
59 return 0; 67 return 0;
60} 68}
61 69
70static inline struct nfs4_sessionid *bc_xprt_sid(struct svc_rqst *rqstp)
71{
72 return NULL;
73}
74
62static inline void xprt_free_bc_request(struct rpc_rqst *req) 75static inline void xprt_free_bc_request(struct rpc_rqst *req)
63{ 76{
64} 77}