diff options
author | Rick Macklem <rmacklem@FreeBSD.org> | 2011-05-31 17:43:25 +0000 |
---|---|---|
committer | Rick Macklem <rmacklem@FreeBSD.org> | 2011-05-31 17:43:25 +0000 |
commit | b398d10657d90213c57c3ec9a02c75599d7ff72d (patch) | |
tree | 2061b734294e65df23368d9148464fa40a10550c /sys/fs | |
parent | d42a4eb507e6b02bc610bb3a5014f8fe19772973 (diff) | |
download | src-b398d10657d90213c57c3ec9a02c75599d7ff72d.tar.gz src-b398d10657d90213c57c3ec9a02c75599d7ff72d.zip |
Fix the new NFS client so that it doesn't do an NFSv3
Pathconf RPC for cases where the reply doesn't include
the answer. This fixes a problem reported by avg@ where
the NFSv3 Pathconf RPC would fail when "ls -l" did an
lpathconf(2) for _PC_ACL_NFS4.
Tested by: avg
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=222540
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/nfsclient/nfs_clvnops.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 3ec12ca37a26..984724d93aed 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -3293,7 +3293,13 @@ nfs_pathconf(struct vop_pathconf_args *ap) struct thread *td = curthread; int attrflag, error; - if (NFS_ISV34(vp)) { + if (NFS_ISV4(vp) || (NFS_ISV3(vp) && (ap->a_name == _PC_LINK_MAX || + ap->a_name == _PC_NAME_MAX || ap->a_name == _PC_CHOWN_RESTRICTED || + ap->a_name == _PC_NO_TRUNC))) { + /* + * Since only the above 4 a_names are returned by the NFSv3 + * Pathconf RPC, there is no point in doing it for others. + */ error = nfsrpc_pathconf(vp, &pc, td->td_ucred, td, &nfsva, &attrflag, NULL); if (attrflag != 0) @@ -3302,7 +3308,10 @@ nfs_pathconf(struct vop_pathconf_args *ap) if (error != 0) return (error); } else { - /* For NFSv2, just fake them. */ + /* + * For NFSv2 (or NFSv3 when not one of the above 4 a_names), + * just fake them. + */ pc.pc_linkmax = LINK_MAX; pc.pc_namemax = NFS_MAXNAMLEN; pc.pc_notrunc = 1; |