diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-06-04 01:13:09 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-06-04 01:13:09 +0000 |
commit | 61654ba68b4efa7f996ca6c4084d645565ca7eb4 (patch) | |
tree | a8a7a2996835b8d500d01974d6f52651620907eb /sys/fs | |
parent | 3bebe47ce6087693e0daa27b86357959c8bc4d67 (diff) | |
download | FreeBSD-src-61654ba68b4efa7f996ca6c4084d645565ca7eb4.zip FreeBSD-src-61654ba68b4efa7f996ca6c4084d645565ca7eb4.tar.gz |
Modify the new NFS server so that the NFSv3 Pathconf RPC
doesn't return an error when the underlying file system
lacks support for any of the four _PC_xxx values used, by
falling back to default values.
Tested by: avg
MFC after: 2 weeks
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/nfsserver/nfs_nfsdport.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index d62be99..5b96729 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -2592,6 +2592,36 @@ nfsvno_pathconf(struct vnode *vp, int flag, register_t *retf, int error; error = VOP_PATHCONF(vp, flag, retf); + if (error == EOPNOTSUPP || error == EINVAL) { + /* + * Some file systems return EINVAL for name arguments not + * supported and some return EOPNOTSUPP for this case. + * So the NFSv3 Pathconf RPC doesn't fail for these cases, + * just fake them. + */ + switch (flag) { + case _PC_LINK_MAX: + *retf = LINK_MAX; + break; + case _PC_NAME_MAX: + *retf = NAME_MAX; + break; + case _PC_CHOWN_RESTRICTED: + *retf = 1; + break; + case _PC_NO_TRUNC: + *retf = 1; + break; + default: + /* + * Only happens if a _PC_xxx is added to the server, + * but this isn't updated. + */ + *retf = 0; + printf("nfsrvd pathconf flag=%d not supp\n", flag); + }; + error = 0; + } return (error); } |