From yvan.vanhullebus@netasq.com  Thu Oct  4 09:18:51 2007
Return-Path: <yvan.vanhullebus@netasq.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 061D316A41A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  4 Oct 2007 09:18:51 +0000 (UTC)
	(envelope-from yvan.vanhullebus@netasq.com)
Received: from netasq.netasq.com (netasq.netasq.com [213.30.137.178])
	by mx1.freebsd.org (Postfix) with ESMTP id BBD8913C459
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  4 Oct 2007 09:18:50 +0000 (UTC)
	(envelope-from yvan.vanhullebus@netasq.com)
Received: from darkstar.netasq.com (unknown [10.0.0.126])
	by netasq.netasq.com (Postfix) with ESMTP id 02D4E6F06B
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  4 Oct 2007 11:18:49 +0200 (CEST)
Received: by darkstar.netasq.com (Postfix, from userid 1001)
	id D222FF74F8; Thu,  4 Oct 2007 11:18:48 +0200 (CEST)
Message-Id: <20071004091848.D222FF74F8@darkstar.netasq.com>
Date: Thu,  4 Oct 2007 11:18:48 +0200 (CEST)
From: VANHULLEBUS Yvan <vanhu@netasq.com>
Reply-To: VANHULLEBUS Yvan <vanhu@netasq.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Typo in a kassert in GEOM
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         116896
>Category:       kern
>Synopsis:       [geom] [patch] Typo in a kassert in GEOM
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-geom
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 04 09:20:02 GMT 2007
>Closed-Date:    Tue Jul 07 11:12:49 UTC 2009
>Last-Modified:  Tue Jul 07 11:12:49 UTC 2009
>Originator:     VANHULLEBUS Yvan
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
NETASQ
>Environment:
System: FreeBSD darkstar.netasq.com 6.2-STABLE FreeBSD 6.2-STABLE #0: Mon Jan 22 14:18:45 CET 2007 root@darkstar.netasq.com:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:

I'm not sure if this could be a real problem, but there is a small typo
in a KASSERT: 
in geom/geom_subr.c, function g_destroy_provider(), pp->acw is checked twice
but pp->ace is not checked.

This seems like the obvious fix. Please apply or close.
>How-To-Repeat:


>Fix:
Index: geom/geom_subr.c
===================================================================
RCS file: /home/ncvs/src/sys/geom/geom_subr.c,v
retrieving revision 1.91
diff -b -u -p -r1.91 geom_subr.c
--- geom/geom_subr.c	5 May 2007 16:33:44 -0000	1.91
+++ geom/geom_subr.c	4 Oct 2007 09:14:13 -0000
@@ -554,7 +554,7 @@ g_destroy_provider(struct g_provider *pp
 	    ("g_destroy_provider but attached"));
 	KASSERT (pp->acr == 0, ("g_destroy_provider with acr"));
 	KASSERT (pp->acw == 0, ("g_destroy_provider with acw"));
-	KASSERT (pp->acw == 0, ("g_destroy_provider with ace"));
+	KASSERT (pp->ace == 0, ("g_destroy_provider with ace"));
 	g_cancel_event(pp);
 	LIST_REMOVE(pp, provider);
 	gp = pp->geom;

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->pjd 
Responsible-Changed-By: kmacy 
Responsible-Changed-When: Fri Nov 16 03:00:59 UTC 2007 
Responsible-Changed-Why:  

Trivial enough to just assign to most active developer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116896 
State-Changed-From-To: open->patched 
State-Changed-By: gavin 
State-Changed-When: Mon May 19 12:42:12 UTC 2008 
State-Changed-Why:  
pjd committed this change in src/sys/geom/geom_subr.c r1.95 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116896 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/116896: commit references a PR
Date: Tue, 20 May 2008 11:44:06 +0000 (UTC)

 pjd         2008-05-20 11:43:56 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/geom             geom_subr.c 
   Log:
   Force commit to note, that the typo in KASSERT() was:
   
   PR:             kern/116896
   Reported by:    VANHULLEBUS Yvan <vanhu@netasq.com>
   
   Revision  Changes    Path
   1.96      +0 -0      src/sys/geom/geom_subr.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
Responsible-Changed-From-To: pjd->freebsd-geom 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu May 28 22:10:40 UTC 2009 
Responsible-Changed-Why:  
pjd is not actively working on GEOM at the moment. 

Apparently this fix still needs to be MFCed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116896 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/116896: commit references a PR
Date: Fri, 29 May 2009 19:37:26 +0000 (UTC)

 Author: lulf
 Date: Fri May 29 19:37:17 2009
 New Revision: 193053
 URL: http://svn.freebsd.org/changeset/base/193053
 
 Log:
   MFC r179097:
   - Assert that we don't send new provider event for a provider which has
     G_PF_WITHER flag set.
   - Fix typo in assertion condition (sorry, but I forgot who report that).
   
   MFC r179151:
   Force commit to note, that the typo in KASSERT() was:
   
   PR:             kern/116896
   Reported by:    VANHULLEBUS Yvan <vanhu@netasq.com>
 
 Modified:
   stable/7/sys/   (props changed)
   stable/7/sys/contrib/pf/   (props changed)
   stable/7/sys/dev/ath/ath_hal/   (props changed)
   stable/7/sys/dev/cxgb/   (props changed)
   stable/7/sys/geom/geom_subr.c
 
 Modified: stable/7/sys/geom/geom_subr.c
 ==============================================================================
 --- stable/7/sys/geom/geom_subr.c	Fri May 29 19:27:52 2009	(r193052)
 +++ stable/7/sys/geom/geom_subr.c	Fri May 29 19:37:17 2009	(r193053)
 @@ -531,6 +531,8 @@ g_new_provider_event(void *arg, int flag
  		return;
  	pp = arg;
  	G_VALID_PROVIDER(pp);
 +	KASSERT(!(pp->flags & G_PF_WITHER),
 +	    ("g_new_provider_event but withered"));
  	LIST_FOREACH(mp, &g_classes, class) {
  		if (mp->taste == NULL)
  			continue;
 @@ -620,7 +622,7 @@ g_destroy_provider(struct g_provider *pp
  	    ("g_destroy_provider but attached"));
  	KASSERT (pp->acr == 0, ("g_destroy_provider with acr"));
  	KASSERT (pp->acw == 0, ("g_destroy_provider with acw"));
 -	KASSERT (pp->acw == 0, ("g_destroy_provider with ace"));
 +	KASSERT (pp->ace == 0, ("g_destroy_provider with ace"));
  	g_cancel_event(pp);
  	LIST_REMOVE(pp, provider);
  	gp = pp->geom;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: ivoras 
State-Changed-When: Tue Jul 7 11:12:29 UTC 2009 
State-Changed-Why:  
Patched and MFC-ed 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116896 
>Unformatted:
