Commit 26808d3f authored by J. Bruce Fields's avatar J. Bruce Fields

nfsd: cleanup nfsd module initialization cleanup

Handle the failure case here with something closer to the standard
kernel style.

Doesn't really matter for now, but I'd like to add a few more failure
cases, and then this'll help.
Acked-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent 46b25895
...@@ -694,16 +694,18 @@ static int __init init_nfsd(void) ...@@ -694,16 +694,18 @@ static int __init init_nfsd(void)
entry->proc_fops = &exports_operations; entry->proc_fops = &exports_operations;
} }
retval = register_filesystem(&nfsd_fs_type); retval = register_filesystem(&nfsd_fs_type);
if (retval) { if (retval)
nfsd_idmap_shutdown(); goto out_free_all;
nfsd_export_shutdown(); return 0;
nfsd_cache_shutdown(); out_free_all:
remove_proc_entry("fs/nfs/exports", NULL); nfsd_idmap_shutdown();
remove_proc_entry("fs/nfs", NULL); nfsd_export_shutdown();
nfsd_stat_shutdown(); nfsd_cache_shutdown();
nfsd_lockd_shutdown(); remove_proc_entry("fs/nfs/exports", NULL);
nfsd4_free_slabs(); remove_proc_entry("fs/nfs", NULL);
} nfsd_stat_shutdown();
nfsd_lockd_shutdown();
nfsd4_free_slabs();
return retval; return retval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment