diff options
Diffstat (limited to 'fs/nfsd/nfssvc.c')
-rw-r--r-- | fs/nfsd/nfssvc.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 07e4f5d7baa8..7c09852be713 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c | |||
@@ -229,7 +229,6 @@ int nfsd_create_serv(void) | |||
229 | 229 | ||
230 | atomic_set(&nfsd_busy, 0); | 230 | atomic_set(&nfsd_busy, 0); |
231 | nfsd_serv = svc_create_pooled(&nfsd_program, nfsd_max_blksize, | 231 | nfsd_serv = svc_create_pooled(&nfsd_program, nfsd_max_blksize, |
232 | AF_INET, | ||
233 | nfsd_last_thread, nfsd, THIS_MODULE); | 232 | nfsd_last_thread, nfsd, THIS_MODULE); |
234 | if (nfsd_serv == NULL) | 233 | if (nfsd_serv == NULL) |
235 | err = -ENOMEM; | 234 | err = -ENOMEM; |
@@ -244,7 +243,7 @@ static int nfsd_init_socks(int port) | |||
244 | if (!list_empty(&nfsd_serv->sv_permsocks)) | 243 | if (!list_empty(&nfsd_serv->sv_permsocks)) |
245 | return 0; | 244 | return 0; |
246 | 245 | ||
247 | error = svc_create_xprt(nfsd_serv, "udp", port, | 246 | error = svc_create_xprt(nfsd_serv, "udp", PF_INET, port, |
248 | SVC_SOCK_DEFAULTS); | 247 | SVC_SOCK_DEFAULTS); |
249 | if (error < 0) | 248 | if (error < 0) |
250 | return error; | 249 | return error; |
@@ -253,7 +252,7 @@ static int nfsd_init_socks(int port) | |||
253 | if (error < 0) | 252 | if (error < 0) |
254 | return error; | 253 | return error; |
255 | 254 | ||
256 | error = svc_create_xprt(nfsd_serv, "tcp", port, | 255 | error = svc_create_xprt(nfsd_serv, "tcp", PF_INET, port, |
257 | SVC_SOCK_DEFAULTS); | 256 | SVC_SOCK_DEFAULTS); |
258 | if (error < 0) | 257 | if (error < 0) |
259 | return error; | 258 | return error; |
@@ -404,7 +403,6 @@ static int | |||
404 | nfsd(void *vrqstp) | 403 | nfsd(void *vrqstp) |
405 | { | 404 | { |
406 | struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp; | 405 | struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp; |
407 | struct fs_struct *fsp; | ||
408 | int err, preverr = 0; | 406 | int err, preverr = 0; |
409 | 407 | ||
410 | /* Lock module and set up kernel thread */ | 408 | /* Lock module and set up kernel thread */ |
@@ -413,13 +411,11 @@ nfsd(void *vrqstp) | |||
413 | /* At this point, the thread shares current->fs | 411 | /* At this point, the thread shares current->fs |
414 | * with the init process. We need to create files with a | 412 | * with the init process. We need to create files with a |
415 | * umask of 0 instead of init's umask. */ | 413 | * umask of 0 instead of init's umask. */ |
416 | fsp = copy_fs_struct(current->fs); | 414 | if (unshare_fs_struct() < 0) { |
417 | if (!fsp) { | ||
418 | printk("Unable to start nfsd thread: out of memory\n"); | 415 | printk("Unable to start nfsd thread: out of memory\n"); |
419 | goto out; | 416 | goto out; |
420 | } | 417 | } |
421 | exit_fs(current); | 418 | |
422 | current->fs = fsp; | ||
423 | current->fs->umask = 0; | 419 | current->fs->umask = 0; |
424 | 420 | ||
425 | /* | 421 | /* |