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/nfsd/nfs4state.c | |
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/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 17 |
1 files changed, 12 insertions, 5 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 |