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>
This commit is contained in:
@@ -1637,13 +1637,19 @@ exp_verify_string(char *cp, int max)
|
||||
/*
|
||||
* Initialize the exports module.
|
||||
*/
|
||||
void
|
||||
int
|
||||
nfsd_export_init(void)
|
||||
{
|
||||
int rv;
|
||||
dprintk("nfsd: initializing export module.\n");
|
||||
|
||||
cache_register(&svc_export_cache);
|
||||
cache_register(&svc_expkey_cache);
|
||||
rv = cache_register(&svc_export_cache);
|
||||
if (rv)
|
||||
return rv;
|
||||
rv = cache_register(&svc_expkey_cache);
|
||||
if (rv)
|
||||
cache_unregister(&svc_export_cache);
|
||||
return rv;
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user