From owner-svn-src-all@FreeBSD.ORG Sat Jul 16 08:05:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 131101065786; Sat, 16 Jul 2011 08:05:22 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E017A8FC0C; Sat, 16 Jul 2011 08:05:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6G85LFs016292; Sat, 16 Jul 2011 08:05:21 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6G85L8j016289; Sat, 16 Jul 2011 08:05:21 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201107160805.p6G85L8j016289@svn.freebsd.org> From: Zack Kirsch Date: Sat, 16 Jul 2011 08:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224079 - head/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jul 2011 08:05:22 -0000 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: