Skip to content

Commit 0dd741b

Browse files
committed
knfsd: LOOKUP can return an illegal error value
JIRA: https://issues.redhat.com/browse/RHEL-53004 commit e221c45 Author: Trond Myklebust <trond.myklebust@hammerspace.com> Date: Mon May 6 12:30:04 2024 -0400 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> Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
1 parent ecf38f8 commit 0dd741b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/nfsd/nfsfh.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry,
572572
_fh_update(fhp, exp, dentry);
573573
if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) {
574574
fh_put(fhp);
575-
return nfserr_opnotsupp;
575+
return nfserr_stale;
576576
}
577577

578578
return 0;
@@ -598,7 +598,7 @@ fh_update(struct svc_fh *fhp)
598598

599599
_fh_update(fhp, fhp->fh_export, dentry);
600600
if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID)
601-
return nfserr_opnotsupp;
601+
return nfserr_stale;
602602
return 0;
603603
out_bad:
604604
printk(KERN_ERR "fh_update: fh not verified!\n");

0 commit comments

Comments
 (0)