diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2007-11-08 17:20:34 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-02-01 16:42:05 -0500 |
commit | dbf847ecb6318d3a22c6758fe39696d00f39063a (patch) | |
tree | 2b71e776ca98bc94258f3539bd7f0ea53d2733a8 /fs/nfsd/export.c | |
parent | ffe9386b6e08e7132cb7730025d0ea310e08a182 (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/export.c')
-rw-r--r-- | fs/nfsd/export.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index d29b70a28f2b..cbbc594ef592 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -1637,13 +1637,19 @@ exp_verify_string(char *cp, int max) | |||
1637 | /* | 1637 | /* |
1638 | * Initialize the exports module. | 1638 | * Initialize the exports module. |
1639 | */ | 1639 | */ |
1640 | void | 1640 | int |
1641 | nfsd_export_init(void) | 1641 | nfsd_export_init(void) |
1642 | { | 1642 | { |
1643 | int rv; | ||
1643 | dprintk("nfsd: initializing export module.\n"); | 1644 | dprintk("nfsd: initializing export module.\n"); |
1644 | 1645 | ||
1645 | cache_register(&svc_export_cache); | 1646 | rv = cache_register(&svc_export_cache); |
1646 | cache_register(&svc_expkey_cache); | 1647 | if (rv) |
1648 | return rv; | ||
1649 | rv = cache_register(&svc_expkey_cache); | ||
1650 | if (rv) | ||
1651 | cache_unregister(&svc_export_cache); | ||
1652 | return rv; | ||
1647 | 1653 | ||
1648 | } | 1654 | } |
1649 | 1655 | ||