Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Jul 2011 08:05:21 +0000 (UTC)
From:      Zack Kirsch <zack@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r224079 - head/sys/fs/nfs
Message-ID:  <201107160805.p6G85L8j016289@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zack
Date: Sat Jul 16 08:05:21 2011
New Revision: 224079
URL: http://svn.freebsd.org/changeset/base/224079

Log:
  Change loadattr and fillattr to ask the file system for the pathconf variable.
  
  Small modification where VOP_PATHCONF was being called directly.
  
  Reviewed by:    rmacklem
  Approved by:    zml (mentor)
  MFC after:      2 weeks

Modified:
  head/sys/fs/nfs/nfs_commonport.c
  head/sys/fs/nfs/nfs_commonsubs.c

Modified: head/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonport.c	Sat Jul 16 08:05:17 2011	(r224078)
+++ head/sys/fs/nfs/nfs_commonport.c	Sat Jul 16 08:05:21 2011	(r224079)
@@ -549,7 +549,7 @@ nfs_supportsnfsv4acls(struct vnode *vp)
 
 	if (nfsrv_useacl == 0)
 		return (0);
-	error = VOP_PATHCONF(vp, _PC_ACL_NFS4, &retval);
+	error = nfsvno_pathconf(vp, _PC_ACL_NFS4, &retval, NULL, NULL);
 	if (error == 0 && retval != 0)
 		return (1);
 	return (0);

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonsubs.c	Sat Jul 16 08:05:17 2011	(r224078)
+++ head/sys/fs/nfs/nfs_commonsubs.c	Sat Jul 16 08:05:21 2011	(r224079)
@@ -774,6 +774,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd
 	struct dqblk dqb;
 	uid_t savuid;
 #endif
+	register_t chownres;
 
 	if (compare) {
 		retnotsup = 0;
@@ -1106,8 +1107,12 @@ nfsv4_loadattr(struct nfsrv_descript *nd
 			NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
 			if (compare) {
 				if (!(*retcmpp)) {
-				    if (*tl != newnfs_true)
-					*retcmpp = NFSERR_NOTSAME;
+					error = nfsvno_pathconf(vp,
+					    _PC_CHOWN_RESTRICTED, &chownres,
+					    nd->nd_cred, p);
+					if (*tl != (chownres != 0 ?
+					    newnfs_true : newnfs_false))
+						*retcmpp = NFSERR_NOTSAME;
 				}
 			} else if (pc != NULL) {
 				pc->pc_chownrestricted =
@@ -1951,6 +1956,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd
 	struct dqblk dqb;
 	uid_t savuid;
 #endif
+	register_t chownres;
 
 	/*
 	 * First, set the bits that can be filled and get fsinfo.
@@ -2130,7 +2136,9 @@ nfsv4_fillattr(struct nfsrv_descript *nd
 			break;
 		case NFSATTRBIT_CHOWNRESTRICTED:
 			NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED);
-			*tl = newnfs_true;
+			error = nfsvno_pathconf(vp, _PC_CHOWN_RESTRICTED,
+			    &chownres, nd->nd_cred, p);
+			*tl = (chownres ? newnfs_true : newnfs_false);
 			retnum += NFSX_UNSIGNED;
 			break;
 		case NFSATTRBIT_FILEHANDLE:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107160805.p6G85L8j016289>