Linux NFS development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <cel@kernel.org>, NeilBrown <neil@brown.name>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/2] NFS: Import NFS3ERR definitions
Date: Fri, 28 Aug 2026 10:42:14 -0400	[thread overview]
Message-ID: <7639e1ceb512af5011889c590ee411d283a9a7e0.camel@kernel.org> (raw)
In-Reply-To: <20260826194444.148243-1-cel@kernel.org>

On Wed, 2026-08-26 at 15:44 -0400, Chuck Lever wrote:
> enum nfs_stat in uapi/linux/nfs.h collects the on-the-wire status
> codes for every NFS version under version-agnostic NFSERR_* names.
> The in-kernel NFS client and server reference these names
> internally, which drags uapi/linux/nfs.h into many translation
> units that need nothing else from that header.
> 
> xdrgen conversion will provide spec-based definitions of the NFS
> status enum constants. Replacing the existing internal references
> with version-specific names requires a version-specific spelling
> for each code that NFSD uses.
> 
> linux/nfs4.h already supplies the NFSv4 codes, but NFSv3 has no
> counterpart header, and not every NFSv3 code has an NFS4ERR_*
> spelling: NFSERR_NOT_SYNC (10002) and NFSERR_REMOTE (71) have no
> NFSv4 equivalent at all, and NFSERR_JUKEBOX (10008) appears in
> NFSv4 as NFS4ERR_DELAY.
> 
> Introduce the NFSv3 status codes as NFS3ERR_* in linux/nfs3.h so a
> subsequent patch can respell NFSD's status definitions without
> relying on uapi/linux/nfs.h.
> 
> Signed-off-by: Chuck Lever <cel@kernel.org>
> ---
>  include/linux/nfs3.h | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
> 
> diff --git a/include/linux/nfs3.h b/include/linux/nfs3.h
> index 1d18da0860d5..b6539a75edea 100644
> --- a/include/linux/nfs3.h
> +++ b/include/linux/nfs3.h
> @@ -7,6 +7,41 @@
>  
>  #include <uapi/linux/nfs3.h>
>  
> +/*
> + * NFSv3 error status values.
> + * See RFC 1813 Section 2.5
> + */
> +enum {
> +	NFS3ERR_PERM		= 1,
> +	NFS3ERR_NOENT		= 2,
> +	NFS3ERR_IO		= 5,
> +	NFS3ERR_NXIO		= 6,
> +	NFS3ERR_ACCES		= 13,
> +	NFS3ERR_EXIST		= 17,
> +	NFS3ERR_XDEV		= 18,
> +	NFS3ERR_NODEV		= 19,
> +	NFS3ERR_NOTDIR		= 20,
> +	NFS3ERR_ISDIR		= 21,
> +	NFS3ERR_INVAL		= 22,
> +	NFS3ERR_FBIG		= 27,
> +	NFS3ERR_NOSPC		= 28,
> +	NFS3ERR_ROFS		= 30,
> +	NFS3ERR_MLINK		= 31,
> +	NFS3ERR_NAMETOOLONG	= 63,
> +	NFS3ERR_NOTEMPTY	= 66,
> +	NFS3ERR_DQUOT		= 69,
> +	NFS3ERR_STALE		= 70,
> +	NFS3ERR_REMOTE		= 71,
> +	NFS3ERR_BADHANDLE	= 10001,
> +	NFS3ERR_NOT_SYNC	= 10002,
> +	NFS3ERR_BAD_COOKIE	= 10003,
> +	NFS3ERR_NOTSUPP		= 10004,
> +	NFS3ERR_TOOSMALL	= 10005,
> +	NFS3ERR_SERVERFAULT	= 10006,
> +	NFS3ERR_BADTYPE		= 10007,
> +	NFS3ERR_JUKEBOX		= 10008,
> +};
> +
>  enum nfs3_stable_how {
>  	NFS_UNSTABLE = 0,
>  	NFS_DATA_SYNC = 1,

Reviewed-by: Jeff Layton <jlayton@kernel.org>

      parent reply	other threads:[~2026-08-28 14:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26 19:44 [PATCH 1/2] NFS: Import NFS3ERR definitions Chuck Lever
2026-08-26 19:44 ` [PATCH 2/2] NFSD: Rework be32 nfserr definitions Chuck Lever
2026-08-28 14:42   ` Jeff Layton
2026-08-28 14:42 ` Jeff Layton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7639e1ceb512af5011889c590ee411d283a9a7e0.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=cel@kernel.org \
    --cc=dai.ngo@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox