summaryrefslogtreecommitdiff
path: root/nfsd/xdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'nfsd/xdr.c')
-rw-r--r--nfsd/xdr.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/nfsd/xdr.c b/nfsd/xdr.c
index 5b13b2a5..57ee1fdf 100644
--- a/nfsd/xdr.c
+++ b/nfsd/xdr.c
@@ -139,7 +139,7 @@ encode_statfs (int *p, struct statfs *st)
/* Return an NFS error corresponding to Hurd error ERR. */
int
-nfs_error_trans (error_t err)
+nfs_error_trans (error_t err, int version)
{
switch (err)
{
@@ -153,7 +153,6 @@ nfs_error_trans (error_t err)
return NFSERR_NOENT;
case EIO:
- default:
return NFSERR_IO;
case ENXIO:
@@ -194,6 +193,24 @@ nfs_error_trans (error_t err)
case ESTALE:
return NFSERR_STALE;
+
+ default:
+ if (version == 2)
+ return NFSERR_IO;
+ else switch (err)
+ {
+ case EXDEV:
+ return NFSERR_XDEV;
+
+ case EINVAL:
+ return NFSERR_INVAL;
+
+ case EOPNOTSUPP:
+ return NFSERR_NOTSUPP; /* are we sure here? */
+
+ default:
+ return NFSERR_IO;
+ }
}
}