Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 May 2005 15:46:55 +0200 (CEST)
From:      Antoine Brodin <antoine.brodin@laposte.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/81588: Devices with SI_CHEAPCLONE flag don't seem to go away when they're no longer used in -current
Message-ID:  <200505281346.j4SDkt5F004933@barton.dreadbsd.org>
Resent-Message-ID: <200505281350.j4SDo2oa032573@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



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