Skip to content

Commit e221c45

Browse files
Trond Myklebustchucklever
authored andcommitted
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>
1 parent 442d27f commit e221c45

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
@@ -573,7 +573,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry,
573573
_fh_update(fhp, exp, dentry);
574574
if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) {
575575
fh_put(fhp);
576-
return nfserr_opnotsupp;
576+
return nfserr_stale;
577577
}
578578

579579
return 0;
@@ -599,7 +599,7 @@ fh_update(struct svc_fh *fhp)
599599

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

0 commit comments

Comments
 (0)