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/nfs4idmap.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/nfs4idmap.c')
-rw-r--r-- | fs/nfsd/nfs4idmap.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index ef22179c49ad..996bd88b75ba 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c | |||
@@ -464,11 +464,18 @@ nametoid_update(struct ent *new, struct ent *old) | |||
464 | * Exported API | 464 | * Exported API |
465 | */ | 465 | */ |
466 | 466 | ||
467 | void | 467 | int |
468 | nfsd_idmap_init(void) | 468 | nfsd_idmap_init(void) |
469 | { | 469 | { |
470 | cache_register(&idtoname_cache); | 470 | int rv; |
471 | cache_register(&nametoid_cache); | 471 | |
472 | rv = cache_register(&idtoname_cache); | ||
473 | if (rv) | ||
474 | return rv; | ||
475 | rv = cache_register(&nametoid_cache); | ||
476 | if (rv) | ||
477 | cache_unregister(&idtoname_cache); | ||
478 | return rv; | ||
472 | } | 479 | } |
473 | 480 | ||
474 | void | 481 | void |