Commit c7add9a9 authored by Stanislav Kinsbursky's avatar Stanislav Kinsbursky Committed by Trond Myklebust

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: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent bc224f53
...@@ -39,6 +39,7 @@ struct cb_process_state { ...@@ -39,6 +39,7 @@ struct cb_process_state {
__be32 drc_status; __be32 drc_status;
struct nfs_client *clp; struct nfs_client *clp;
int slotid; int slotid;
struct net *net;
}; };
struct cb_compound_hdr_arg { struct cb_compound_hdr_arg {
......
...@@ -461,7 +461,7 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args, ...@@ -461,7 +461,7 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args,
int i; int i;
__be32 status = htonl(NFS4ERR_BADSESSION); __be32 status = htonl(NFS4ERR_BADSESSION);
clp = nfs4_find_client_sessionid(args->csa_addr, &args->csa_sessionid); clp = nfs4_find_client_sessionid(cps->net, args->csa_addr, &args->csa_sessionid);
if (clp == NULL) if (clp == NULL)
goto out; goto out;
......
...@@ -861,6 +861,7 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *r ...@@ -861,6 +861,7 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *r
.drc_status = 0, .drc_status = 0,
.clp = NULL, .clp = NULL,
.slotid = -1, .slotid = -1,
.net = rqstp->rq_xprt->xpt_net,
}; };
unsigned int nops = 0; unsigned int nops = 0;
......
...@@ -1232,11 +1232,11 @@ nfs4_find_client_ident(struct net *net, int cb_ident) ...@@ -1232,11 +1232,11 @@ nfs4_find_client_ident(struct net *net, int cb_ident)
* Returns NULL if no such client * Returns NULL if no such client
*/ */
struct nfs_client * struct nfs_client *
nfs4_find_client_sessionid(const struct sockaddr *addr, nfs4_find_client_sessionid(struct net *net, const struct sockaddr *addr,
struct nfs4_sessionid *sid) struct nfs4_sessionid *sid)
{ {
struct nfs_client *clp; struct nfs_client *clp;
struct nfs_net *nn = net_generic(&init_net, nfs_net_id); struct nfs_net *nn = net_generic(net, nfs_net_id);
spin_lock(&nn->nfs_client_lock); spin_lock(&nn->nfs_client_lock);
list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) { list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) {
......
...@@ -152,7 +152,8 @@ extern void nfs_cleanup_cb_ident_idr(struct net *); ...@@ -152,7 +152,8 @@ extern void nfs_cleanup_cb_ident_idr(struct net *);
extern void nfs_put_client(struct nfs_client *); extern void nfs_put_client(struct nfs_client *);
extern struct nfs_client *nfs4_find_client_ident(struct net *, int); extern struct nfs_client *nfs4_find_client_ident(struct net *, int);
extern struct nfs_client * extern struct nfs_client *
nfs4_find_client_sessionid(const struct sockaddr *, struct nfs4_sessionid *); nfs4_find_client_sessionid(struct net *, const struct sockaddr *,
struct nfs4_sessionid *);
extern struct nfs_server *nfs_create_server( extern struct nfs_server *nfs_create_server(
const struct nfs_parsed_mount_data *, const struct nfs_parsed_mount_data *,
struct nfs_fh *); struct nfs_fh *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment