NFS: pass NFS client owner network namespace to RPC client creation routine
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Tue, 10 Jan 2012 12:12:54 +0000 (16:12 +0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 31 Jan 2012 23:20:27 +0000 (18:20 -0500)
This patch replaces static "init_net" with nfs_client->net pointer in RPC
client creation calls.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/client.c
fs/nfs/internal.h
fs/nfs/mount_clnt.c
fs/nfs/super.c

index ca016fe4460262fbb728a3c3412040f8bd01bd54..64815b72540985ba75e119f56a80219a3b01f800 100644 (file)
@@ -647,7 +647,7 @@ static int nfs_create_rpc_client(struct nfs_client *clp,
 {
        struct rpc_clnt         *clnt = NULL;
        struct rpc_create_args args = {
-               .net            = &init_net,
+               .net            = clp->net,
                .protocol       = clp->cl_proto,
                .address        = (struct sockaddr *)&clp->cl_addr,
                .addrsize       = clp->cl_addrlen,
index 02fb2001a283f7dcec89dfc9b39812863753186e..d602188f889f57da831b2d72b56c96828bb62f37 100644 (file)
@@ -138,6 +138,7 @@ struct nfs_mount_request {
        int                     noresvport;
        unsigned int            *auth_flav_len;
        rpc_authflavor_t        *auth_flavs;
+       struct net              *net;
 };
 
 extern int nfs_mount(struct nfs_mount_request *info);
index d4c2d6b7507e791044df2837c1d0803699a2a518..4fbe3a8e5e6b53089f24997c4e04947bd9f7033a 100644 (file)
@@ -153,7 +153,7 @@ int nfs_mount(struct nfs_mount_request *info)
                .rpc_resp       = &result,
        };
        struct rpc_create_args args = {
-               .net            = &init_net,
+               .net            = info->net,
                .protocol       = info->protocol,
                .address        = info->sap,
                .addrsize       = info->salen,
@@ -225,7 +225,7 @@ void nfs_umount(const struct nfs_mount_request *info)
                .to_retries = 2,
        };
        struct rpc_create_args args = {
-               .net            = &init_net,
+               .net            = info->net,
                .protocol       = IPPROTO_UDP,
                .address        = info->sap,
                .addrsize       = info->salen,
index 73aa75649bf8ec3f6d85f048eaa905171593dbe1..e45feb0fee59f46d97a097098fb4162d7e77f1ae 100644 (file)
@@ -1625,6 +1625,7 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args,
                .noresvport     = args->flags & NFS_MOUNT_NORESVPORT,
                .auth_flav_len  = &server_authlist_len,
                .auth_flavs     = server_authlist,
+               .net            = args->net,
        };
        int status;