Date: Wed, 11 Sep 2002 14:19:34 -0400 (EDT) From: "Andrew R. Reiter" <arr@watson.org> To: John Baldwin <jhb@FreeBSD.org> Cc: "Andrew R. Reiter" <arr@FreeBSD.org>, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: RE: cvs commit: src/sys/kern kern_acct.c Message-ID: <Pine.NEB.3.96L.1020911141845.64193A-100000@fledge.watson.org> In-Reply-To: <XFMail.20020911130904.jhb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1020911141845.64193A-100000>
