diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2007-11-09 14:10:56 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-02-01 16:42:04 -0500 |
commit | d5c3428b2cb26d605fddc4878f4fcc03c23df89f (patch) | |
tree | b476ca0b6709b65044f222912f2fdd2efbdcf297 /fs/nfsd/nfsctl.c | |
parent | 26808d3f10b1213bbb6e27d441be40e20ab84611 (diff) |
nfsd: fail module init on reply cache init failure
If the reply cache initialization fails due to a kmalloc failure,
currently we try to soldier on with a reduced (or nonexistant) reply
cache.
Better to just fail immediately: the failure is then much easier to
understand and debug, and it could save us complexity in some later
code. (But actually, it doesn't help currently because the cache is
also turned off in some odd failure cases; we should probably find a
better way to handle those failure cases some day.)
Fix some minor style problems while we're at it, and rename
nfsd_cache_init() to remove the need for a comment describing it.
Acked-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfsctl.c')
-rw-r--r-- | fs/nfsd/nfsctl.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index ecf377944286..2bfda9b8f504 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -683,7 +683,9 @@ static int __init init_nfsd(void) | |||
683 | if (retval) | 683 | if (retval) |
684 | return retval; | 684 | return retval; |
685 | nfsd_stat_init(); /* Statistics */ | 685 | nfsd_stat_init(); /* Statistics */ |
686 | nfsd_cache_init(); /* RPC reply cache */ | 686 | retval = nfsd_reply_cache_init(); |
687 | if (retval) | ||
688 | goto out_free_stat; | ||
687 | nfsd_export_init(); /* Exports table */ | 689 | nfsd_export_init(); /* Exports table */ |
688 | nfsd_lockd_init(); /* lockd->nfsd callbacks */ | 690 | nfsd_lockd_init(); /* lockd->nfsd callbacks */ |
689 | nfsd_idmap_init(); /* Name to ID mapping */ | 691 | nfsd_idmap_init(); /* Name to ID mapping */ |
@@ -700,11 +702,12 @@ static int __init init_nfsd(void) | |||
700 | out_free_all: | 702 | out_free_all: |
701 | nfsd_idmap_shutdown(); | 703 | nfsd_idmap_shutdown(); |
702 | nfsd_export_shutdown(); | 704 | nfsd_export_shutdown(); |
703 | nfsd_cache_shutdown(); | 705 | nfsd_reply_cache_shutdown(); |
704 | remove_proc_entry("fs/nfs/exports", NULL); | 706 | remove_proc_entry("fs/nfs/exports", NULL); |
705 | remove_proc_entry("fs/nfs", NULL); | 707 | remove_proc_entry("fs/nfs", NULL); |
706 | nfsd_stat_shutdown(); | ||
707 | nfsd_lockd_shutdown(); | 708 | nfsd_lockd_shutdown(); |
709 | out_free_stat: | ||
710 | nfsd_stat_shutdown(); | ||
708 | nfsd4_free_slabs(); | 711 | nfsd4_free_slabs(); |
709 | return retval; | 712 | return retval; |
710 | } | 713 | } |
@@ -712,7 +715,7 @@ out_free_all: | |||
712 | static void __exit exit_nfsd(void) | 715 | static void __exit exit_nfsd(void) |
713 | { | 716 | { |
714 | nfsd_export_shutdown(); | 717 | nfsd_export_shutdown(); |
715 | nfsd_cache_shutdown(); | 718 | nfsd_reply_cache_shutdown(); |
716 | remove_proc_entry("fs/nfs/exports", NULL); | 719 | remove_proc_entry("fs/nfs/exports", NULL); |
717 | remove_proc_entry("fs/nfs", NULL); | 720 | remove_proc_entry("fs/nfs", NULL); |
718 | nfsd_stat_shutdown(); | 721 | nfsd_stat_shutdown(); |