]> Pileus Git - ~andy/linux/commitdiff
NFS: search for client session id in proper network namespace
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Thu, 26 Jan 2012 11:11:49 +0000 (15:11 +0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 6 Feb 2012 23:48:04 +0000 (18:48 -0500)
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>
fs/nfs/callback.h
fs/nfs/callback_proc.c
fs/nfs/callback_xdr.c
fs/nfs/client.c
fs/nfs/internal.h

index c89d3b9e483c463cb1b9232e4b97520a7b7e1eaf..197e0d3754c276c8648285e17830248eda2f8a44 100644 (file)
@@ -39,6 +39,7 @@ struct cb_process_state {
        __be32                  drc_status;
        struct nfs_client       *clp;
        int                     slotid;
+       struct net              *net;
 };
 
 struct cb_compound_hdr_arg {
index 0e6e63f55db4ae9eaa503883ccae4feb3d2a5df6..f71978d107d0a6f2c29f65f334a5f8f557eb72ad 100644 (file)
@@ -461,7 +461,7 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args,
        int i;
        __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)
                goto out;
 
index e14af46bd2c6c6cd40a06c5bdb4ac0a493eecf19..2e372240d028eb3379d0d68b40ea8fcd97a0ca5b 100644 (file)
@@ -861,6 +861,7 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *r
                .drc_status = 0,
                .clp = NULL,
                .slotid = -1,
+               .net = rqstp->rq_xprt->xpt_net,
        };
        unsigned int nops = 0;
 
index 9e11d29888308e619cf58eaa58b9874731065720..2328dcbf6c0b374f5325d59d472ebe490bded506 100644 (file)
@@ -1232,11 +1232,11 @@ nfs4_find_client_ident(struct net *net, int cb_ident)
  * Returns NULL if no such 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 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);
        list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) {
index b38b73347af59eb4ae58170ddfa8db9b9438b58e..0c3648a947d15a062b110057c3e64d875a0efb0e 100644 (file)
@@ -152,7 +152,8 @@ extern void nfs_cleanup_cb_ident_idr(struct net *);
 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_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(
                                        const struct nfs_parsed_mount_data *,
                                        struct nfs_fh *);