Skip to content

Commit 06bea44

Browse files
Trond Myklebustgregkh
authored andcommitted
knfsd: LOOKUP can return an illegal error value
commit e221c45 upstream. 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: [email protected] Signed-off-by: Trond Myklebust <[email protected]> Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent bbce9fb commit 06bea44

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
@@ -569,7 +569,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry,
569569
_fh_update(fhp, exp, dentry);
570570
if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) {
571571
fh_put(fhp);
572-
return nfserr_opnotsupp;
572+
return nfserr_stale;
573573
}
574574

575575
return 0;
@@ -595,7 +595,7 @@ fh_update(struct svc_fh *fhp)
595595

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

0 commit comments

Comments
 (0)