kern/81588: Devices with SI_CHEAPCLONE flag don't seem to go away when they're no longer used in -current

Antoine Brodin antoine.brodin at laposte.net
Sat May 28 06:50:03 PDT 2005


>Number:         81588
>Category:       kern
>Synopsis:       Devices with SI_CHEAPCLONE flag don't seem to go away when they're no longer used in -current
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 28 13:50:01 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Antoine Brodin
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
none
>Environment:
System: FreeBSD barton.dreadbsd.org 6.0-CURRENT FreeBSD 6.0-CURRENT #7: Sat May 28 14:52:05 CEST 2005 root at barton.dreadbsd.org:/usr/obj/usr/src/sys/BARTON i386
>Description:
On freebsd 5, when you use a lot of bpf(4), and you stop using them, and
then you run something like /etc/periodic/weekly/310.locate , the bpf(4)
go away.
On -current, this doesn't seem to work anymore.
>How-To-Repeat:
Use something like this:
#!/usr/bin/env perl
my $i;
my $s;
for ($i = 0; $i < 1000; $i++) {
	$s = "/dev/bpf".$i;
	system "ls $s";
}

and then run /etc/periodic/weekly/310.locate , the devices don't go away.
>Fix:
I don't have a fix, but revision 1.172 of kern/kern_conf.c looks suspect,
especially the lines:
%%%
+	if (dev->si_usecount == 0 &&
+	    (dev->si_flags & SI_CHEAPCLONE) && (dev->si_flags & SI_NAMED))
 	if (dev->si_devsw == NULL && dev->si_refcount == 0) {
 		LIST_REMOVE(dev, si_list);
 		flag = 1;
%%%
The indentation suggests that a line is missing...
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list