Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jan 2007 09:20:22 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Hans Petter Selasky <hselasky@freebsd.org>
Cc:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   Re: PERFORCE change 113101 for review
Message-ID:  <200701180920.22453.jhb@freebsd.org>
In-Reply-To: <200701181008.l0IA810Z031551@repoman.freebsd.org>
References:  <200701181008.l0IA810Z031551@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 18 January 2007 05:08, Hans Petter Selasky wrote:
> http://perforce.freebsd.org/chv.cgi?CH=113101
> 
> Change 113101 by hselasky@hselasky_mini_itx on 2007/01/18 10:07:13
> 
> 	If the number of devices changed during list traversal, set
> 	"count" to the lowest value.

There shouldn't be a need for this.  Currently this stuff is protected
by Giant, but at some point in the future it will all be covered with
an sx lock which will basically single-thread most of new-bus including
attach/detach, etc.

> Affected files ...
> 
> .. //depot/projects/usb/src/sys/kern/subr_bus.c#4 edit
> 
> Differences ...
> 
> ==== //depot/projects/usb/src/sys/kern/subr_bus.c#4 (text+ko) ====
> 
> @@ -1876,13 +1876,16 @@
>  	TAILQ_FOREACH(child, &dev->children, link) {
>  		if (n < count) {
>  			list[n] = child;
> -			n++;
>  		}
> +		n++;
>  	}
>  
>  	if (n != count) {
>  		printf("device_get_children: Number of devices changed "
>  		       "from %d to %d!\n", count, n);
> +		if (n < count) {
> +			count = n;
> +		}
>  	}
>  
>  	*devlistp = list;
> 

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701180920.22453.jhb>