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 469c931cca95..cbba4a935786 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c | |||
@@ -272,7 +272,6 @@ int nfsd_create_serv(void) | |||
272 | } | 272 | } |
273 | 273 | ||
274 | nfsd_serv = svc_create_pooled(&nfsd_program, nfsd_max_blksize, | 274 | nfsd_serv = svc_create_pooled(&nfsd_program, nfsd_max_blksize, |
275 | AF_INET, | ||
276 | nfsd_last_thread, nfsd, THIS_MODULE); | 275 | nfsd_last_thread, nfsd, THIS_MODULE); |
277 | if (nfsd_serv == NULL) | 276 | if (nfsd_serv == NULL) |
278 | err = -ENOMEM; | 277 | err = -ENOMEM; |
@@ -289,7 +288,7 @@ static int nfsd_init_socks(int port) | |||
289 | if (!list_empty(&nfsd_serv->sv_permsocks)) | 288 | if (!list_empty(&nfsd_serv->sv_permsocks)) |
290 | return 0; | 289 | return 0; |
291 | 290 | ||
292 | error = svc_create_xprt(nfsd_serv, "udp", port, | 291 | error = svc_create_xprt(nfsd_serv, "udp", PF_INET, port, |
293 | SVC_SOCK_DEFAULTS); | 292 | SVC_SOCK_DEFAULTS); |
294 | if (error < 0) | 293 | if (error < 0) |
295 | return error; | 294 | return error; |
@@ -298,7 +297,7 @@ static int nfsd_init_socks(int port) | |||
298 | if (error < 0) | 297 | if (error < 0) |
299 | return error; | 298 | return error; |
300 | 299 | ||
301 | error = svc_create_xprt(nfsd_serv, "tcp", port, | 300 | error = svc_create_xprt(nfsd_serv, "tcp", PF_INET, port, |
302 | SVC_SOCK_DEFAULTS); | 301 | SVC_SOCK_DEFAULTS); |
303 | if (error < 0) | 302 | if (error < 0) |
304 | return error; | 303 | return error; |
@@ -429,7 +428,6 @@ static int | |||
429 | nfsd(void *vrqstp) | 428 | nfsd(void *vrqstp) |
430 | { | 429 | { |
431 | struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp; | 430 | struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp; |
432 | struct fs_struct *fsp; | ||
433 | int err, preverr = 0; | 431 | int err, preverr = 0; |
434 | 432 | ||
435 | /* Lock module and set up kernel thread */ | 433 | /* Lock module and set up kernel thread */ |
@@ -438,13 +436,11 @@ nfsd(void *vrqstp) | |||
438 | /* At this point, the thread shares current->fs | 436 | /* At this point, the thread shares current->fs |
439 | * with the init process. We need to create files with a | 437 | * with the init process. We need to create files with a |
440 | * umask of 0 instead of init's umask. */ | 438 | * umask of 0 instead of init's umask. */ |
441 | fsp = copy_fs_struct(current->fs); | 439 | if (unshare_fs_struct() < 0) { |
442 | if (!fsp) { | ||
443 | printk("Unable to start nfsd thread: out of memory\n"); | 440 | printk("Unable to start nfsd thread: out of memory\n"); |
444 | goto out; | 441 | goto out; |
445 | } | 442 | } |
446 | exit_fs(current); | 443 | |
447 | current->fs = fsp; | ||
448 | current->fs->umask = 0; | 444 | current->fs->umask = 0; |
449 | 445 | ||
450 | /* | 446 | /* |