diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-22 15:55:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-22 15:55:50 -0400 |
commit | 7e0338c0de18c50f09aea1fbef45110cf7d64a3c (patch) | |
tree | 30a935c1f6eee7125a9fbb802a33292b1f7268fa /fs/nfsd/nfssvc.c | |
parent | df36b439c5fedefe013d4449cb6a50d15e2f4d70 (diff) | |
parent | 47fcb03fefee2501e79176932a4184fc24d6f8ec (diff) |
Merge branch 'for-2.6.31' of git://fieldses.org/git/linux-nfsd
* 'for-2.6.31' of git://fieldses.org/git/linux-nfsd: (60 commits)
SUNRPC: Fix the TCP server's send buffer accounting
nfsd41: Backchannel: minorversion support for the back channel
nfsd41: Backchannel: cleanup nfs4.0 callback encode routines
nfsd41: Remove ip address collision detection case
nfsd: optimise the starting of zero threads when none are running.
nfsd: don't take nfsd_mutex twice when setting number of threads.
nfsd41: sanity check client drc maxreqs
nfsd41: move channel attributes from nfsd4_session to a nfsd4_channel_attr struct
NFS: kill off complicated macro 'PROC'
sunrpc: potential memory leak in function rdma_read_xdr
nfsd: minor nfsd_vfs_write cleanup
nfsd: Pull write-gathering code out of nfsd_vfs_write
nfsd: track last inode only in use_wgather case
sunrpc: align cache_clean work's timer
nfsd: Use write gathering only with NFSv2
NFSv4: kill off complicated macro 'PROC'
NFSv4: do exact check about attribute specified
knfsd: remove unreported filehandle stats counters
knfsd: fix reply cache memory corruption
knfsd: reply cache cleanups
...
Diffstat (limited to 'fs/nfsd/nfssvc.c')
-rw-r--r-- | fs/nfsd/nfssvc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index cbba4a935786..d4c9884cd54b 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c | |||
@@ -390,12 +390,14 @@ nfsd_svc(unsigned short port, int nrservs) | |||
390 | 390 | ||
391 | mutex_lock(&nfsd_mutex); | 391 | mutex_lock(&nfsd_mutex); |
392 | dprintk("nfsd: creating service\n"); | 392 | dprintk("nfsd: creating service\n"); |
393 | error = -EINVAL; | ||
394 | if (nrservs <= 0) | 393 | if (nrservs <= 0) |
395 | nrservs = 0; | 394 | nrservs = 0; |
396 | if (nrservs > NFSD_MAXSERVS) | 395 | if (nrservs > NFSD_MAXSERVS) |
397 | nrservs = NFSD_MAXSERVS; | 396 | nrservs = NFSD_MAXSERVS; |
398 | 397 | error = 0; | |
398 | if (nrservs == 0 && nfsd_serv == NULL) | ||
399 | goto out; | ||
400 | |||
399 | /* Readahead param cache - will no-op if it already exists */ | 401 | /* Readahead param cache - will no-op if it already exists */ |
400 | error = nfsd_racache_init(2*nrservs); | 402 | error = nfsd_racache_init(2*nrservs); |
401 | if (error<0) | 403 | if (error<0) |
@@ -413,6 +415,12 @@ nfsd_svc(unsigned short port, int nrservs) | |||
413 | goto failure; | 415 | goto failure; |
414 | 416 | ||
415 | error = svc_set_num_threads(nfsd_serv, NULL, nrservs); | 417 | error = svc_set_num_threads(nfsd_serv, NULL, nrservs); |
418 | if (error == 0) | ||
419 | /* We are holding a reference to nfsd_serv which | ||
420 | * we don't want to count in the return value, | ||
421 | * so subtract 1 | ||
422 | */ | ||
423 | error = nfsd_serv->sv_nrthreads - 1; | ||
416 | failure: | 424 | failure: |
417 | svc_destroy(nfsd_serv); /* Release server */ | 425 | svc_destroy(nfsd_serv); /* Release server */ |
418 | out: | 426 | out: |