aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfsctl.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2007-11-08 17:20:34 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-02-01 16:42:05 -0500
commitdbf847ecb6318d3a22c6758fe39696d00f39063a (patch)
tree2b71e776ca98bc94258f3539bd7f0ea53d2733a8 /fs/nfsd/nfsctl.c
parentffe9386b6e08e7132cb7730025d0ea310e08a182 (diff)
knfsd: allow cache_register to return error on failure
Newer server features such as nfsv4 and gss depend on proc to work, so a failure to initialize the proc files they need should be treated as fatal. Thanks to Andrew Morton for style fix and compile fix in case where CONFIG_NFSD_V4 is undefined. Cc: Andrew Morton <akpm@linux-foundation.org> 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.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 2b95597aa4a5..4aba92698581 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -707,9 +707,13 @@ static int __init init_nfsd(void)
707 retval = nfsd_reply_cache_init(); 707 retval = nfsd_reply_cache_init();
708 if (retval) 708 if (retval)
709 goto out_free_stat; 709 goto out_free_stat;
710 nfsd_export_init(); /* Exports table */ 710 retval = nfsd_export_init();
711 if (retval)
712 goto out_free_cache;
711 nfsd_lockd_init(); /* lockd->nfsd callbacks */ 713 nfsd_lockd_init(); /* lockd->nfsd callbacks */
712 nfsd_idmap_init(); /* Name to ID mapping */ 714 retval = nfsd_idmap_init();
715 if (retval)
716 goto out_free_lockd;
713 retval = create_proc_exports_entry(); 717 retval = create_proc_exports_entry();
714 if (retval) 718 if (retval)
715 goto out_free_idmap; 719 goto out_free_idmap;
@@ -720,10 +724,12 @@ static int __init init_nfsd(void)
720out_free_all: 724out_free_all:
721 remove_proc_entry("fs/nfs/exports", NULL); 725 remove_proc_entry("fs/nfs/exports", NULL);
722 remove_proc_entry("fs/nfs", NULL); 726 remove_proc_entry("fs/nfs", NULL);
723 nfsd_idmap_shutdown();
724out_free_idmap: 727out_free_idmap:
728 nfsd_idmap_shutdown();
729out_free_lockd:
725 nfsd_lockd_shutdown(); 730 nfsd_lockd_shutdown();
726 nfsd_export_shutdown(); 731 nfsd_export_shutdown();
732out_free_cache:
727 nfsd_reply_cache_shutdown(); 733 nfsd_reply_cache_shutdown();
728out_free_stat: 734out_free_stat:
729 nfsd_stat_shutdown(); 735 nfsd_stat_shutdown();