Date: Fri, 14 Jun 2002 12:34:17 -0400 (EDT) From: John Baldwin <jhb@FreeBSD.org> To: Robert Watson <rwatson@FreeBSD.org> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: RE: PERFORCE change 12897 for review Message-ID: <XFMail.20020614122806.jhb@FreeBSD.org> In-Reply-To: <200206140754.g5E7sHp04595@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org> <>< 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020614122806.jhb>