]> git.dujemihanovic.xyz Git - linux.git/commit
nfsd: be more systematic about selecting error codes for internal use.
authorNeilBrown <neilb@suse.de>
Mon, 29 Jul 2024 01:47:23 +0000 (11:47 +1000)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 20 Sep 2024 23:31:03 +0000 (19:31 -0400)
commit36ffa3d0de54c1cf516ea32a5ec556f5c9874795
tree4e7c5a85b99c9364566e4ce0e270b215c7eda348
parent1459ad57673b8019fbfcfddc345c99630d29e716
nfsd: be more systematic about selecting error codes for internal use.

Rather than using ad hoc values for internal errors (30000, 11000, ...)
use 'enum' to sequentially allocate numbers starting from the first
known available number - now visible as NFS4ERR_FIRST_FREE.

The goal is values that are distinct from all be32 error codes.  To get
those we must first select integers that are not already used, then
convert them with cpu_to_be32().

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfsd.h
include/linux/nfs4.h