Re: [PATCH 2/3] nfsd: be more systematic about selecting error codes for internal use.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux