From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 14:35:43 2008 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 7108A106567A; Mon, 3 Nov 2008 14:35:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ED3B8FC1A; Mon, 3 Nov 2008 14:35:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3EZh0r068703; Mon, 3 Nov 2008 14:35:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3EZhUC068702; Mon, 3 Nov 2008 14:35:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200811031435.mA3EZhUC068702@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 3 Nov 2008 14:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184593 - in stable/7/sys: . ufs/ufs 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: Mon, 03 Nov 2008 14:35:43 -0000 Author: kib Date: Mon Nov 3 14:35:43 2008 New Revision: 184593 URL: http://svn.freebsd.org/changeset/base/184593 Log: MFC r184408: Provide an explanation for getinoquota() call in the ufs_access vop. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/ufs/ufs/ufs_vnops.c Modified: stable/7/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/7/sys/ufs/ufs/ufs_vnops.c Mon Nov 3 14:23:15 2008 (r184592) +++ stable/7/sys/ufs/ufs/ufs_vnops.c Mon Nov 3 14:35:43 2008 (r184593) @@ -330,7 +330,18 @@ ufs_access(ap) if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); #ifdef QUOTA + /* + * Inode is accounted in the quotas only if struct + * dquot is attached to it. VOP_ACCESS() is called + * from vn_open_cred() and provides a convenient + * point to call getinoquota(). + */ if (VOP_ISLOCKED(vp, ap->a_td) != LK_EXCLUSIVE) { + + /* + * Upgrade vnode lock, since getinoquota() + * requires exclusive lock to modify inode. + */ relocked = 1; vhold(vp); vn_lock(vp, LK_UPGRADE | LK_RETRY, ap->a_td);