knfsd: LOOKUP can return an illegal error value
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 6 May 2024 16:30:04 +0000 (12:30 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 6 May 2024 16:47:24 +0000 (12:47 -0400)
commite221c45da3770962418fb30c27d941bbc70d595a
tree32ab3716e7d31c1b93d0788d9eaa5d32c8403574
parent442d27ff09a218b61020ab56387dbc508ad6bfa6
knfsd: LOOKUP can return an illegal error value

The 'NFS error' NFSERR_OPNOTSUPP is not described by any of the official
NFS related RFCs, but appears to have snuck into some older .x files for
NFSv2.
Either way, it is not in RFC1094, RFC1813 or any of the NFSv4 RFCs, so
should not be returned by the knfsd server, and particularly not by the
"LOOKUP" operation.

Instead, let's return NFSERR_STALE, which is more appropriate if the
filesystem encodes the filehandle as FILEID_INVALID.

Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfsfh.c