aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/callback.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/callback.c')
-rw-r--r--fs/nfs/callback.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index 7933e2e99dbc..a070109fa6c7 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -106,7 +106,6 @@ static void nfs_callback_svc(struct svc_rqst *rqstp)
106int nfs_callback_up(void) 106int nfs_callback_up(void)
107{ 107{
108 struct svc_serv *serv; 108 struct svc_serv *serv;
109 struct svc_sock *svsk;
110 int ret = 0; 109 int ret = 0;
111 110
112 lock_kernel(); 111 lock_kernel();
@@ -119,17 +118,14 @@ int nfs_callback_up(void)
119 ret = -ENOMEM; 118 ret = -ENOMEM;
120 if (!serv) 119 if (!serv)
121 goto out_err; 120 goto out_err;
122 /* FIXME: We don't want to register this socket with the portmapper */ 121
123 ret = svc_makesock(serv, IPPROTO_TCP, nfs_callback_set_tcpport); 122 ret = svc_makesock(serv, IPPROTO_TCP, nfs_callback_set_tcpport,
124 if (ret < 0) 123 SVC_SOCK_ANONYMOUS);
124 if (ret <= 0)
125 goto out_destroy; 125 goto out_destroy;
126 if (!list_empty(&serv->sv_permsocks)) { 126 nfs_callback_tcpport = ret;
127 svsk = list_entry(serv->sv_permsocks.next, 127 dprintk("Callback port = 0x%x\n", nfs_callback_tcpport);
128 struct svc_sock, sk_list); 128
129 nfs_callback_tcpport = ntohs(inet_sk(svsk->sk_sk)->sport);
130 dprintk ("Callback port = 0x%x\n", nfs_callback_tcpport);
131 } else
132 BUG();
133 ret = svc_create_thread(nfs_callback_svc, serv); 129 ret = svc_create_thread(nfs_callback_svc, serv);
134 if (ret < 0) 130 if (ret < 0)
135 goto out_destroy; 131 goto out_destroy;
@@ -140,6 +136,8 @@ out:
140 unlock_kernel(); 136 unlock_kernel();
141 return ret; 137 return ret;
142out_destroy: 138out_destroy:
139 dprintk("Couldn't create callback socket or server thread; err = %d\n",
140 ret);
143 svc_destroy(serv); 141 svc_destroy(serv);
144out_err: 142out_err:
145 nfs_callback_info.users--; 143 nfs_callback_info.users--;