Skip to contentSkip to conversation

Supply network namespace to rpcbind.

PATCH In review Rob Landley 6 participants 7 messages Mar 31, 2011 – Apr 6, 2011 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 Supply network namespace to rpcbind.

From: Rob Landley <[email protected]>

The sunrpc code already has some support for network namespaces, but rpcb_create() is still using init_net. Its arguments include a sockaddr and a port, but not a struct net *. Add one, and pass in the value from rpc_xprt when calling it.

---

 net/sunrpc/rpcb_clnt.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
net/sunrpc/rpcb_clnt.c +4 -3
index c652e4c..25bb8f9 100644
@@ -223,10 +223,11 @@ out:
 }
 
 static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
-				    size_t salen, int proto, u32 version)
+				    size_t salen, int proto, struct net *net,
+				    u32 version)
 {
 	struct rpc_create_args args = {
-		.net		= &init_net,
+		.net		= net,
 		.protocol	= proto,
 		.address	= srvaddr,
 		.addrsize	= salen,
@@ -591,7 +592,7 @@ void rpcb_getport_async(struct rpc_task *task)
 		task->tk_pid, __func__, bind_version);
 
 	rpcb_clnt = rpcb_create(clnt->cl_server, sap, salen, xprt->prot,
-				bind_version);
+				xprt->xprt_net, bind_version);
 	if (IS_ERR(rpcb_clnt)) {
 		status = PTR_ERR(rpcb_clnt);
 		dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n",

A message that is not in the archive (sent off-list or not yet received): [email protected]

Acked-by Serge Hallyn
#2 lore raw
Quoted 8 lines · Rob Landley

From: Rob Landley <[email protected]>

The sunrpc code already has some support for network namespaces, but rpcb_create() is still using init_net. Its arguments include a sockaddr and a port, but not a struct net *. Add one, and pass in the value from rpc_xprt when calling it.

Quoted 36 lines

---

 net/sunrpc/rpcb_clnt.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
net/sunrpc/rpcb_clnt.c +4 -3
index c652e4c..25bb8f9 100644
@@ -223,10 +223,11 @@ out:
 }
 
 static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
-				    size_t salen, int proto, u32 version)
+				    size_t salen, int proto, struct net *net,
+				    u32 version)
 {
 	struct rpc_create_args args = {
-		.net		= &init_net,
+		.net		= net,
 		.protocol	= proto,
 		.address	= srvaddr,
 		.addrsize	= salen,
@@ -591,7 +592,7 @@ void rpcb_getport_async(struct rpc_task *task)
 		task->tk_pid, __func__, bind_version);
 
 	rpcb_clnt = rpcb_create(clnt->cl_server, sap, salen, xprt->prot,
-				bind_version);
+				xprt->xprt_net, bind_version);
 	if (IS_ERR(rpcb_clnt)) {
 		status = PTR_ERR(rpcb_clnt);
 		dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n",

_______________________________________________
Containers mailing list Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers

#3 lore raw
In reply to a message not in the archive
Quoted 8 lines · Rob Landley

From: Rob Landley <[email protected]>

The sunrpc code already has some support for network namespaces, but rpcb_create() is still using init_net. Its arguments include a sockaddr and a port, but not a struct net *. Add one, and pass in the value from rpc_xprt when calling it.

BTW, it seems conflicts with my rpc_pipefs patchset. I'll rebase my patchset, if your patches will be merged first.

Quoted 36 lines

---

 net/sunrpc/rpcb_clnt.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
net/sunrpc/rpcb_clnt.c +4 -3
index c652e4c..25bb8f9 100644
@@ -223,10 +223,11 @@ out:
 }
 
 static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
-				    size_t salen, int proto, u32 version)
+				    size_t salen, int proto, struct net *net,
+				    u32 version)
 {
 	struct rpc_create_args args = {
-		.net		= &init_net,
+		.net		= net,
 		.protocol	= proto,
 		.address	= srvaddr,
 		.addrsize	= salen,
@@ -591,7 +592,7 @@ void rpcb_getport_async(struct rpc_task *task)
 		task->tk_pid, __func__, bind_version);
 
 	rpcb_clnt = rpcb_create(clnt->cl_server, sap, salen, xprt->prot,
-				bind_version);
+				xprt->xprt_net, bind_version);
 	if (IS_ERR(rpcb_clnt)) {
 		status = PTR_ERR(rpcb_clnt);
 		dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n",

_______________________________________________
Containers mailing list Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers

Signature · 1 line
 Kirill A. Shutemov
Acked-by Serge Hallyn on v1 2/3
#4 lore raw
In reply to Rob Landley
Quoted 8 lines · Rob Landley

From: Rob Landley <[email protected]>

The sunrpc code already has some support for network namespaces, but rpcb_create() is still using init_net. Its arguments include a sockaddr and a port, but not a struct net *. Add one, and pass in the value from rpc_xprt when calling it.

Quoted 36 lines

---

 net/sunrpc/rpcb_clnt.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
net/sunrpc/rpcb_clnt.c +4 -3
index c652e4c..25bb8f9 100644
@@ -223,10 +223,11 @@ out:
 }
 
 static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
-				    size_t salen, int proto, u32 version)
+				    size_t salen, int proto, struct net *net,
+				    u32 version)
 {
 	struct rpc_create_args args = {
-		.net		= &init_net,
+		.net		= net,
 		.protocol	= proto,
 		.address	= srvaddr,
 		.addrsize	= salen,
@@ -591,7 +592,7 @@ void rpcb_getport_async(struct rpc_task *task)
 		task->tk_pid, __func__, bind_version);
 
 	rpcb_clnt = rpcb_create(clnt->cl_server, sap, salen, xprt->prot,
-				bind_version);
+				xprt->xprt_net, bind_version);
 	if (IS_ERR(rpcb_clnt)) {
 		status = PTR_ERR(rpcb_clnt);
 		dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n",

_______________________________________________
Containers mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers

Acked-by on v1 2/3
#5 lore raw
In reply to Rob Landley
Quoted 8 lines · Rob Landley

From: Rob Landley <[email protected]>

The sunrpc code already has some support for network namespaces, but rpcb_create() is still using init_net. Its arguments include a sockaddr and a port, but not a struct net *. Add one, and pass in the value from rpc_xprt when calling it.

BTW, it seems conflicts with my rpc_pipefs patchset. I'll rebase my patchset, if your patches will be merged first.

Quoted 36 lines

---

 net/sunrpc/rpcb_clnt.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
net/sunrpc/rpcb_clnt.c +4 -3
index c652e4c..25bb8f9 100644
@@ -223,10 +223,11 @@ out:
 }
 
 static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
-				    size_t salen, int proto, u32 version)
+				    size_t salen, int proto, struct net *net,
+				    u32 version)
 {
 	struct rpc_create_args args = {
-		.net		= &init_net,
+		.net		= net,
 		.protocol	= proto,
 		.address	= srvaddr,
 		.addrsize	= salen,
@@ -591,7 +592,7 @@ void rpcb_getport_async(struct rpc_task *task)
 		task->tk_pid, __func__, bind_version);
 
 	rpcb_clnt = rpcb_create(clnt->cl_server, sap, salen, xprt->prot,
-				bind_version);
+				xprt->xprt_net, bind_version);
 	if (IS_ERR(rpcb_clnt)) {
 		status = PTR_ERR(rpcb_clnt);
 		dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n",

_______________________________________________
Containers mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers

Signature · 1 line
 Kirill A. Shutemov

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw
Quoted 8 lines · Kirill A. Shutemov
Quoted 7 lines · Rob Landley

From: Rob Landley <[email protected]>

The sunrpc code already has some support for network namespaces, but rpcb_create() is still using init_net. Its arguments include a sockaddr and a port, but not a struct net *. Add one, and pass in the value from rpc_xprt when calling it.

Quoted 6 lines
Quoted 1 line

BTW, it seems conflicts with my rpc_pipefs patchset. I'll rebase my patchset, if your patches will be merged first.

And vice versa, lemme know which order you want them in.

Thanks,

Rob

#8 lore raw
In reply to Kirill A. Shutemov
Quoted 8 lines · Kirill A. Shutemov
Quoted 7 lines · Rob Landley

From: Rob Landley <[email protected]>

The sunrpc code already has some support for network namespaces, but rpcb_create() is still using init_net. Its arguments include a sockaddr and a port, but not a struct net *. Add one, and pass in the value from rpc_xprt when calling it.

Quoted 6 lines
Quoted 1 line

BTW, it seems conflicts with my rpc_pipefs patchset. I'll rebase my patchset, if your patches will be merged first.

And vice versa, lemme know which order you want them in.

Thanks,

Rob