diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2009-09-15 15:56:50 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-09-15 20:49:33 -0400 |
commit | 29ab23cc5d351658d01a4327d55e9106a73fd04f (patch) | |
tree | 8df00000a93e783f4bc152c20a437338a4f57fde /fs | |
parent | 5d351754fcf58d1a604aa7cf95c2805e8a098ad9 (diff) |
nfsd4: allow nfs4 state startup to fail
The failure here is pretty unlikely, but we should handle it anyway.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4state.c | 17 | ||||
-rw-r--r-- | fs/nfsd/nfssvc.c | 4 |
2 files changed, 15 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 46e9ac526872..11db40cb2f2b 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -4004,7 +4004,7 @@ set_max_delegations(void) | |||
4004 | 4004 | ||
4005 | /* initialization to perform when the nfsd service is started: */ | 4005 | /* initialization to perform when the nfsd service is started: */ |
4006 | 4006 | ||
4007 | static void | 4007 | static int |
4008 | __nfs4_state_start(void) | 4008 | __nfs4_state_start(void) |
4009 | { | 4009 | { |
4010 | unsigned long grace_time; | 4010 | unsigned long grace_time; |
@@ -4016,19 +4016,26 @@ __nfs4_state_start(void) | |||
4016 | printk(KERN_INFO "NFSD: starting %ld-second grace period\n", | 4016 | printk(KERN_INFO "NFSD: starting %ld-second grace period\n", |
4017 | grace_time/HZ); | 4017 | grace_time/HZ); |
4018 | laundry_wq = create_singlethread_workqueue("nfsd4"); | 4018 | laundry_wq = create_singlethread_workqueue("nfsd4"); |
4019 | if (laundry_wq == NULL) | ||
4020 | return -ENOMEM; | ||
4019 | queue_delayed_work(laundry_wq, &laundromat_work, grace_time); | 4021 | queue_delayed_work(laundry_wq, &laundromat_work, grace_time); |
4020 | set_max_delegations(); | 4022 | set_max_delegations(); |
4023 | return 0; | ||
4021 | } | 4024 | } |
4022 | 4025 | ||
4023 | void | 4026 | int |
4024 | nfs4_state_start(void) | 4027 | nfs4_state_start(void) |
4025 | { | 4028 | { |
4029 | int ret; | ||
4030 | |||
4026 | if (nfs4_init) | 4031 | if (nfs4_init) |
4027 | return; | 4032 | return 0; |
4028 | nfsd4_load_reboot_recovery_data(); | 4033 | nfsd4_load_reboot_recovery_data(); |
4029 | __nfs4_state_start(); | 4034 | ret = __nfs4_state_start(); |
4035 | if (ret) | ||
4036 | return ret; | ||
4030 | nfs4_init = 1; | 4037 | nfs4_init = 1; |
4031 | return; | 4038 | return 0; |
4032 | } | 4039 | } |
4033 | 4040 | ||
4034 | time_t | 4041 | time_t |
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 4472449c0937..fcc001088261 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c | |||
@@ -411,7 +411,9 @@ nfsd_svc(unsigned short port, int nrservs) | |||
411 | error = nfsd_racache_init(2*nrservs); | 411 | error = nfsd_racache_init(2*nrservs); |
412 | if (error<0) | 412 | if (error<0) |
413 | goto out; | 413 | goto out; |
414 | nfs4_state_start(); | 414 | error = nfs4_state_start(); |
415 | if (error) | ||
416 | goto out; | ||
415 | 417 | ||
416 | nfsd_reset_versions(); | 418 | nfsd_reset_versions(); |
417 | 419 | ||