android_kernel_xiaomi_sm8350/fs/nfsd
J. Bruce Fields 2d3bb25209 knfsd: nfsd: make all exp_finding functions return -errno's on err
Currently exp_find(), exp_get_by_name(), and friends, return an export on
success, and on failure return:

	errors -EAGAIN (drop this request pending an upcall) or
		-ETIMEDOUT (an upcall has timed out), or
	return NULL, which can mean either that there was a memory allocation
		failure, or that an export was not found, or that a passed-in
		export lacks an auth_domain.

Many callers seem to assume that NULL means that an export was not found,
which may lead to bugs in the case of a memory allocation failure.

Modify these functions to distinguish between the two NULL cases by returning
either -ENOENT or -ENOMEM.  They now never return NULL.  We get to simplify
some code in the process.

We return -ENOENT in the case of a missing auth_domain.  This case should
probably be removed (or converted to a bug) after confirming that it can never
happen.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17 10:23:07 -07:00
..
auth.c
export.c knfsd: nfsd: make all exp_finding functions return -errno's on err 2007-07-17 10:23:07 -07:00
lockd.c knfsd: lockd: nfsd4: use same grace period for lockd and nfsd4 2007-07-17 10:23:07 -07:00
Makefile
nfs2acl.c
nfs3acl.c
nfs3proc.c
nfs3xdr.c
nfs4acl.c knfsd: nfsd4: fix handling of acl errrors 2007-07-17 10:23:07 -07:00
nfs4callback.c knfsd: nfsd4: fix enc_stateid_sz for nfsd callbacks 2007-07-17 10:23:07 -07:00
nfs4idmap.c
nfs4proc.c
nfs4recover.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
nfs4state.c knfsd: nfsd4: don't delegate files that have had conflicts 2007-07-17 10:23:07 -07:00
nfs4xdr.c
nfscache.c
nfsctl.c knfsd: nfsd: remove unused header interface.h 2007-07-17 10:23:07 -07:00
nfsfh.c knfsd: nfsd: make all exp_finding functions return -errno's on err 2007-07-17 10:23:07 -07:00
nfsproc.c
nfssvc.c Freezer: make kernel threads nonfreezable by default 2007-07-17 10:23:02 -07:00
nfsxdr.c
stats.c
vfs.c knfsd: nfsd: make all exp_finding functions return -errno's on err 2007-07-17 10:23:07 -07:00