From owner-p4-projects Fri Jun 14 9:34:43 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3EFEA37B431; Fri, 14 Jun 2002 09:34:36 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mail.speakeasy.net (mail15.speakeasy.net [216.254.0.215]) by hub.freebsd.org (Postfix) with ESMTP id 8237537B409 for ; Fri, 14 Jun 2002 09:34:34 -0700 (PDT) Received: (qmail 19703 invoked from network); 14 Jun 2002 16:34:30 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail15.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 14 Jun 2002 16:34:30 -0000 Received: from laptop.baldwin.cx ([206.187.69.204]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g5EGYJb93935; Fri, 14 Jun 2002 12:34:19 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200206140754.g5E7sHp04595@freefall.freebsd.org> Date: Fri, 14 Jun 2002 12:34:17 -0400 (EDT) From: John Baldwin To: Robert Watson Subject: RE: PERFORCE change 12897 for review Cc: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 14-Jun-2002 Robert Watson wrote: > http://people.freebsd.org/~peter/p4db/chv.cgi?CH=12897 > > Change 12897 by rwatson@rwatson_paprika on 2002/06/14 00:53:58 > > Fix botched integ. Actually, except for the first hunk this looks to be all botches. :-/ > Affected files ... > > ... //depot/projects/trustedbsd/mac/sys/kern/subr_witness.c#17 edit > > Differences ... > > ==== //depot/projects/trustedbsd/mac/sys/kern/subr_witness.c#17 (text+ko) ==== > > @@ -380,8 +380,14 @@ > w = lock->lo_witness; > if (w != NULL) { > mtx_lock_spin(&w_mtx); > - MPASS(w->w_refcount > 0); > w->w_refcount--; > + if (w->w_refcount == 0) { > + CTR2(KTR_WITNESS, > + "%s: marking witness %s as dead", __func__, w->w_name); > + w->w_name = "(dead)"; > + w->w_file = "(dead)"; > + w->w_line = 0; > + } > mtx_unlock_spin(&w_mtx); > } > > @@ -444,7 +450,7 @@ > */ > prnt("\nLocks which were never acquired:\n"); > STAILQ_FOREACH(w, &w_all, w_list) { > - if (w->w_file != NULL || w->w_refcount == 0) > + if (w->w_file != NULL) > continue; > prnt("%s\n", w->w_name); > } > @@ -932,8 +938,7 @@ > return (NULL); > mtx_lock_spin(&w_mtx); > STAILQ_FOREACH(w, &w_all, w_list) { > - if (w->w_name == description || (w->w_refcount > 0 && > - strcmp(description, w->w_name) == 0)) { > + if (strcmp(description, w->w_name) == 0) { > w->w_refcount++; > mtx_unlock_spin(&w_mtx); > if (lock_class != w->w_class) > @@ -1145,13 +1150,10 @@ > prnt("%-2d", level); > for (i = 0; i < level; i++) > prnt(" "); > - if (parent->w_refcount > 0) { > - prnt("%s", parent->w_name); > - if (parent->w_file != NULL) > - prnt(" -- last acquired @ %s:%d\n", parent->w_file, > - parent->w_line); > - } else > - prnt("(dead)\n"); > + prnt("%s", parent->w_name); > + if (parent->w_file != NULL) > + prnt(" -- last acquired @ %s:%d\n", parent->w_file, > + parent->w_line); > for (wcl = parent->w_children; wcl != NULL; wcl = wcl->wcl_next) > for (i = 0; i < wcl->wcl_count; i++) > witness_displaydescendants(prnt, -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message