From owner-p4-projects@FreeBSD.ORG Tue Feb 7 23:43:49 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 14A6116A423; Tue, 7 Feb 2006 23:43:49 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C8A8616A420 for ; Tue, 7 Feb 2006 23:43:48 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D40443D46 for ; Tue, 7 Feb 2006 23:43:48 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k17NhmTD024326 for ; Tue, 7 Feb 2006 23:43:48 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k17Nhmqv024323 for perforce@freebsd.org; Tue, 7 Feb 2006 23:43:48 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 7 Feb 2006 23:43:48 GMT Message-Id: <200602072343.k17Nhmqv024323@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 91350 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2006 23:43:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=91350 Change 91350 by rwatson@rwatson_zoo on 2006/02/07 23:42:58 Acquire vnode lock around VOP_GETATTR(), as required by VFS locking protocol. We might simply want to acquire the vnode lock early in the record write routine, and hold it throughout, as it's also acquired later as part of vn_rdwr(). Found by: kris (bugmagnet) Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit.c#12 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit.c#12 (text+ko) ==== @@ -284,7 +284,9 @@ if (ret) goto out; + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); ret = VOP_GETATTR(vp, &vattr, cred, td); + VOP_UNLOCK(vp, 0, td); if (ret) goto out;