From owner-freebsd-current@FreeBSD.ORG Sun Dec 7 11:13:51 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B570C16A4CE for ; Sun, 7 Dec 2003 11:13:51 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FE7D43F93 for ; Sun, 7 Dec 2003 11:13:50 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.10/8.12.10) with ESMTP id hB7JDgV8026335; Sun, 7 Dec 2003 20:13:43 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: ticso@cicely.de From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 07 Dec 2003 18:40:00 +0100." <20031207173959.GE42518@cicely12.cicely.de> Date: Sun, 07 Dec 2003 20:13:42 +0100 Message-ID: <26334.1070824422@critter.freebsd.dk> cc: freebsd-current@freebsd.org Subject: Re: major number leak with modules? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2003 19:13:51 -0000 In message <20031207173959.GE42518@cicely12.cicely.de>, Bernd Walter writes: >The situation was the following during driver development. >It's an USB driver and kldload'ed. >A plugged in device got major 247 for the nodes it created. >On unplugging the nodes were destroyed. >kldunloading the driver and kldloading the next revision created >nodes with major 246 for new devices. > >Do we have a leak with major numbers or is the old major number free >after last destroy_dev and assigning algorithm just took the next. Yes, repeatedly loading/unloading will leak majors. I have some ref-counting code to solve this problem. Warners axe-swinging in the old ISA drivers made it easier, but some necessary but uncommitted patches to the sound code from cg@ are still at road-block. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.