From owner-p4-projects Fri Jun 14 0:56:11 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 28B8F37B423; Fri, 14 Jun 2002 00:56:05 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 33BC737B40B for ; Fri, 14 Jun 2002 00:56:04 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5E7sHp04595 for perforce@freebsd.org; Fri, 14 Jun 2002 00:54:17 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Fri, 14 Jun 2002 00:54:17 -0700 (PDT) Message-Id: <200206140754.g5E7sHp04595@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 12897 for review To: 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 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. 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, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message