On Mon, Jul 29, 2024 at 11:47:23AM +1000, NeilBrown wrote: > Rather than using ad hoc values for internal errors (30000, 11000, ...) > use 'enum' to sequentially allocated 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@xxxxxxx> > --- > fs/nfsd/nfsd.h | 23 ++++++++++++++++++----- > include/linux/nfs4.h | 17 ++++++++++------- > 2 files changed, 28 insertions(+), 12 deletions(-) > > diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h > index 8f4f239d9f8a..593c34fd325a 100644 > --- a/fs/nfsd/nfsd.h > +++ b/fs/nfsd/nfsd.h > @@ -326,17 +326,30 @@ void nfsd_lockd_shutdown(void); > #define nfserr_xattr2big cpu_to_be32(NFS4ERR_XATTR2BIG) > #define nfserr_noxattr cpu_to_be32(NFS4ERR_NOXATTR) > > -/* error codes for internal use */ > +/* Error codes for internal use. We use enum to choose numbers that are Nit: normal kernel style would be: /* * Error codes for internal use. We use enum to choose numbers that are Otherwise looks good: Reviewed-by: Christoph Hellwig <hch@xxxxxx>