Subject: kern/769: mismatch between DEBUG and DIAGNOSTIC over vfs_bufstats()
To: None <gnats-admin@NetBSD.ORG>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: netbsd-bugs
Date: 01/30/1995 01:35:02
>Number:         769
>Category:       kern
>Synopsis:       mismatch between DEBUG and DIAGNOSTIC over vfs_bufstats()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 30 01:35:01 1995
>Originator:     Jonathan Stone
>Organization:
"	representing myself"
>Release:        1995-01-29
>Environment:
	pmax, NetBSD-current, pmax, no libraries
System: NetBSD Reno.Stanford.EDU 1.0A NetBSD 1.0A (CURRENT) #73: Sun Jan 29 23:59:35 PST 1995 jonathan@Reno.Stanford.EDU:/greyhawk/n1/src/NetBSD/src/sys/arch/pmax/compile/CURRENT pmax


>Description:
	kern/vfs_bio.c:vfs_bufstats() is wrapped in #ifdef DIAGNOSTIC/#endif,
	so it is only defined when a kernel is configured with the
	DIAGNOSTIC option. Yet, as the comment above vfs_bufstat clearly
	states, vfs_bufstat() may be called from within sync() if
	"syncprt" has been set with sysctl.  The "syncprt" sysctl,
	and the conditional call to vfs_bufstat(), are  present
	if (and only if)  DEBUG is defined.
 	Clearly, vfs_bufstat() should be selected by if DEBUG is defined.

>How-To-Repeat:
	Build a kernel with DEBUG defined but not DIAGNOSTIC.
	_vfs_bufstat will not be resolved and the kernel won't link.

>Fix:
	Change the DIAGNOSTIC in vfs_bio.c:line 779 to DEBUG .
	Or, if appropriate, #if defined(DEBUG) || defined(DIAGNOSTIC).

	Or don't build kernels without DIAGNOSTIC. Which is a pain, if one
	is trying to get performance measurements.
>Audit-Trail:
>Unformatted: