diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-01-26 06:11:49 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-02-06 18:48:04 -0500 |
commit | c7add9a9720ff5be4715f7a0bb0d9578b2e8534e (patch) | |
tree | 9b87930052ffe27acbdb94ac294ea0f073847189 /fs/nfs | |
parent | bc224f539dcce7805d4bfb68a92f0fe8bb102c22 (diff) |
NFS: search for client session id in proper network namespace
Network namespace is taken from request transport and passed as a part of
cb_process_state structure.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/callback.h | 1 | ||||
-rw-r--r-- | fs/nfs/callback_proc.c | 2 | ||||
-rw-r--r-- | fs/nfs/callback_xdr.c | 1 | ||||
-rw-r--r-- | fs/nfs/client.c | 4 | ||||
-rw-r--r-- | fs/nfs/internal.h | 3 |
5 files changed, 7 insertions, 4 deletions
diff --git a/fs/nfs/callback.h b/fs/nfs/callback.h index c89d3b9e483c..197e0d3754c2 100644 --- a/fs/nfs/callback.h +++ b/fs/nfs/callback.h | |||
@@ -39,6 +39,7 @@ struct cb_process_state { | |||
39 | __be32 drc_status; | 39 | __be32 drc_status; |
40 | struct nfs_client *clp; | 40 | struct nfs_client *clp; |
41 | int slotid; | 41 | int slotid; |
42 | struct net *net; | ||
42 | }; | 43 | }; |
43 | 44 | ||
44 | struct cb_compound_hdr_arg { | 45 | struct cb_compound_hdr_arg { |
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 0e6e63f55db4..f71978d107d0 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c | |||
@@ -461,7 +461,7 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args, | |||
461 | int i; | 461 | int i; |
462 | __be32 status = htonl(NFS4ERR_BADSESSION); | 462 | __be32 status = htonl(NFS4ERR_BADSESSION); |
463 | 463 | ||
464 | clp = nfs4_find_client_sessionid(args->csa_addr, &args->csa_sessionid); | 464 | clp = nfs4_find_client_sessionid(cps->net, args->csa_addr, &args->csa_sessionid); |
465 | if (clp == NULL) | 465 | if (clp == NULL) |
466 | goto out; | 466 | goto out; |
467 | 467 | ||
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index e14af46bd2c6..2e372240d028 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c | |||
@@ -861,6 +861,7 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *r | |||
861 | .drc_status = 0, | 861 | .drc_status = 0, |
862 | .clp = NULL, | 862 | .clp = NULL, |
863 | .slotid = -1, | 863 | .slotid = -1, |
864 | .net = rqstp->rq_xprt->xpt_net, | ||
864 | }; | 865 | }; |
865 | unsigned int nops = 0; | 866 | unsigned int nops = 0; |
866 | 867 | ||
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 9e11d2988830..2328dcbf6c0b 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -1232,11 +1232,11 @@ nfs4_find_client_ident(struct net *net, int cb_ident) | |||
1232 | * Returns NULL if no such client | 1232 | * Returns NULL if no such client |
1233 | */ | 1233 | */ |
1234 | struct nfs_client * | 1234 | struct nfs_client * |
1235 | nfs4_find_client_sessionid(const struct sockaddr *addr, | 1235 | nfs4_find_client_sessionid(struct net *net, const struct sockaddr *addr, |
1236 | struct nfs4_sessionid *sid) | 1236 | struct nfs4_sessionid *sid) |
1237 | { | 1237 | { |
1238 | struct nfs_client *clp; | 1238 | struct nfs_client *clp; |
1239 | struct nfs_net *nn = net_generic(&init_net, nfs_net_id); | 1239 | struct nfs_net *nn = net_generic(net, nfs_net_id); |
1240 | 1240 | ||
1241 | spin_lock(&nn->nfs_client_lock); | 1241 | spin_lock(&nn->nfs_client_lock); |
1242 | list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) { | 1242 | list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) { |
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index b38b73347af5..0c3648a947d1 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -152,7 +152,8 @@ extern void nfs_cleanup_cb_ident_idr(struct net *); | |||
152 | extern void nfs_put_client(struct nfs_client *); | 152 | extern void nfs_put_client(struct nfs_client *); |
153 | extern struct nfs_client *nfs4_find_client_ident(struct net *, int); | 153 | extern struct nfs_client *nfs4_find_client_ident(struct net *, int); |
154 | extern struct nfs_client * | 154 | extern struct nfs_client * |
155 | nfs4_find_client_sessionid(const struct sockaddr *, struct nfs4_sessionid *); | 155 | nfs4_find_client_sessionid(struct net *, const struct sockaddr *, |
156 | struct nfs4_sessionid *); | ||
156 | extern struct nfs_server *nfs_create_server( | 157 | extern struct nfs_server *nfs_create_server( |
157 | const struct nfs_parsed_mount_data *, | 158 | const struct nfs_parsed_mount_data *, |
158 | struct nfs_fh *); | 159 | struct nfs_fh *); |