aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/lockd/svc.c2
-rw-r--r--fs/nfsd/nfsctl.c4
-rw-r--r--include/linux/sunrpc/svc_xprt.h3
-rw-r--r--net/sunrpc/svc_xprt.c6
4 files changed, 10 insertions, 5 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index c061b9aa7ddb..ff379ff7761f 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -193,7 +193,7 @@ static int create_lockd_listener(struct svc_serv *serv, const char *name,
193{ 193{
194 struct svc_xprt *xprt; 194 struct svc_xprt *xprt;
195 195
196 xprt = svc_find_xprt(serv, name, family, 0); 196 xprt = svc_find_xprt(serv, name, &init_net, family, 0);
197 if (xprt == NULL) 197 if (xprt == NULL)
198 return svc_create_xprt(serv, name, &init_net, family, port, 198 return svc_create_xprt(serv, name, &init_net, family, port,
199 SVC_SOCK_DEFAULTS); 199 SVC_SOCK_DEFAULTS);
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 330352d379b6..64c24af8d7ea 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -722,7 +722,7 @@ static ssize_t __write_ports_addxprt(char *buf)
722 nfsd_serv->sv_nrthreads--; 722 nfsd_serv->sv_nrthreads--;
723 return 0; 723 return 0;
724out_close: 724out_close:
725 xprt = svc_find_xprt(nfsd_serv, transport, PF_INET, port); 725 xprt = svc_find_xprt(nfsd_serv, transport, &init_net, PF_INET, port);
726 if (xprt != NULL) { 726 if (xprt != NULL) {
727 svc_close_xprt(xprt); 727 svc_close_xprt(xprt);
728 svc_xprt_put(xprt); 728 svc_xprt_put(xprt);
@@ -748,7 +748,7 @@ static ssize_t __write_ports_delxprt(char *buf)
748 if (port < 1 || port > USHRT_MAX || nfsd_serv == NULL) 748 if (port < 1 || port > USHRT_MAX || nfsd_serv == NULL)
749 return -EINVAL; 749 return -EINVAL;
750 750
751 xprt = svc_find_xprt(nfsd_serv, transport, AF_UNSPEC, port); 751 xprt = svc_find_xprt(nfsd_serv, transport, &init_net, AF_UNSPEC, port);
752 if (xprt == NULL) 752 if (xprt == NULL)
753 return -ENOTCONN; 753 return -ENOTCONN;
754 754
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index dfa900948af7..b3f64b12f141 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -121,7 +121,8 @@ void svc_close_xprt(struct svc_xprt *xprt);
121int svc_port_is_privileged(struct sockaddr *sin); 121int svc_port_is_privileged(struct sockaddr *sin);
122int svc_print_xprts(char *buf, int maxlen); 122int svc_print_xprts(char *buf, int maxlen);
123struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, 123struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name,
124 const sa_family_t af, const unsigned short port); 124 struct net *net, const sa_family_t af,
125 const unsigned short port);
125int svc_xprt_names(struct svc_serv *serv, char *buf, const int buflen); 126int svc_xprt_names(struct svc_serv *serv, char *buf, const int buflen);
126 127
127static inline void svc_xprt_get(struct svc_xprt *xprt) 128static inline void svc_xprt_get(struct svc_xprt *xprt)
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 74cb0d8e9ca1..de1e1a8b526b 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -1089,6 +1089,7 @@ static struct svc_deferred_req *svc_deferred_dequeue(struct svc_xprt *xprt)
1089 * svc_find_xprt - find an RPC transport instance 1089 * svc_find_xprt - find an RPC transport instance
1090 * @serv: pointer to svc_serv to search 1090 * @serv: pointer to svc_serv to search
1091 * @xcl_name: C string containing transport's class name 1091 * @xcl_name: C string containing transport's class name
1092 * @net: owner net pointer
1092 * @af: Address family of transport's local address 1093 * @af: Address family of transport's local address
1093 * @port: transport's IP port number 1094 * @port: transport's IP port number
1094 * 1095 *
@@ -1101,7 +1102,8 @@ static struct svc_deferred_req *svc_deferred_dequeue(struct svc_xprt *xprt)
1101 * service's list that has a matching class name. 1102 * service's list that has a matching class name.
1102 */ 1103 */
1103struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, 1104struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name,
1104 const sa_family_t af, const unsigned short port) 1105 struct net *net, const sa_family_t af,
1106 const unsigned short port)
1105{ 1107{
1106 struct svc_xprt *xprt; 1108 struct svc_xprt *xprt;
1107 struct svc_xprt *found = NULL; 1109 struct svc_xprt *found = NULL;
@@ -1112,6 +1114,8 @@ struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name,
1112 1114
1113 spin_lock_bh(&serv->sv_lock); 1115 spin_lock_bh(&serv->sv_lock);
1114 list_for_each_entry(xprt, &serv->sv_permsocks, xpt_list) { 1116 list_for_each_entry(xprt, &serv->sv_permsocks, xpt_list) {
1117 if (xprt->xpt_net != net)
1118 continue;
1115 if (strcmp(xprt->xpt_class->xcl_name, xcl_name)) 1119 if (strcmp(xprt->xpt_class->xcl_name, xcl_name))
1116 continue; 1120 continue;
1117 if (af != AF_UNSPEC && af != xprt->xpt_local.ss_family) 1121 if (af != AF_UNSPEC && af != xprt->xpt_local.ss_family)