From owner-cvs-all Wed Sep 11 11:20:11 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43EE337B400; Wed, 11 Sep 2002 11:19:57 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2028443E3B; Wed, 11 Sep 2002 11:19:56 -0700 (PDT) (envelope-from arr@watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.4/8.12.4) with ESMTP id g8BIJYOn064432; Wed, 11 Sep 2002 14:19:34 -0400 (EDT) (envelope-from arr@watson.org) Received: from localhost (arr@localhost) by fledge.watson.org (8.12.5/8.12.5/Submit) with SMTP id g8BIJY1T064429; Wed, 11 Sep 2002 14:19:34 -0400 (EDT) X-Authentication-Warning: fledge.watson.org: arr owned process doing -bs Date: Wed, 11 Sep 2002 14:19:34 -0400 (EDT) From: "Andrew R. Reiter" To: John Baldwin Cc: "Andrew R. Reiter" , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: RE: cvs commit: src/sys/kern kern_acct.c In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 11 Sep 2002, John Baldwin wrote: : :On 11-Sep-2002 Andrew R. Reiter wrote: :> arr 2002/09/10 21:10:41 PDT :> :> Modified files: :> sys/kern kern_acct.c :> Log: :> - Lock down the accounting code globals with a subsystem mutex. :> :> Reviewed by: jhb, mdodd : :Erm, well, I reviewed an earlier version and had some comments. :) More :comments: : :@@ -323,12 +340,15 @@ : { : struct statfs sb; : :+ mtx_lock(&acct_mtx); :+ : if (savacctp != NULLVP) { : if (savacctp->v_type == VBAD) { : (void) vn_close(savacctp, savacctflags, savacctcred, : NULL); : savacctp = NULLVP; : savacctcred = NOCRED; :+ mtx_unlock(&acct_mtx); : return; : } : (void)VFS_STATFS(savacctp->v_mount, &sb, (struct thread *)0); : :This should probably be changed at the end after the second 'if' to save :savacctp and savacctcred in temp vars, clear the two variables, then :drop the lock. Then do a vn_close() with the temp variables. : :You should probably also drop the lock while you do VFS_STATFS. vref() the :vnode before dropping, then after VFS_STATFS() you can get the lock again :and compare the vp saved in a temp variable to savacctp and just vrele() :the temp vp if they don't match, otherwise proceed with the current code. : Working on a patch now (buildkernel'ing now in fact)... I'll get it to you ASAP. Cheers, Andrew -- Andrew R. Reiter arr@watson.org arr@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message