From owner-freebsd-current@FreeBSD.ORG Fri Feb 6 04:10:43 2004 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 82BEB16A4CE for ; Fri, 6 Feb 2004 04:10:43 -0800 (PST) Received: from milla.ask33.net (milla.ask33.net [217.197.166.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id E339443D1D for ; Fri, 6 Feb 2004 04:10:41 -0800 (PST) (envelope-from nick@milla.ask33.net) Received: by milla.ask33.net (Postfix, from userid 1001) id 05B873ABB5D; Fri, 6 Feb 2004 13:12:45 +0100 (CET) Date: Fri, 6 Feb 2004 13:12:44 +0100 From: Pawel Jakub Dawidek To: Poul-Henning Kamp Message-ID: <20040206121244.GN14639@garage.freebsd.pl> References: <39982.1075975367@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="o+ZCuNqY+dEAKBWl" Content-Disposition: inline In-Reply-To: <39982.1075975367@critter.freebsd.dk> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 4.8-RELEASE-p13 i386 X-URL: http://garage.freebsd.pl User-Agent: Mutt/1.5.1i cc: current@freebsd.org Subject: Re: HEADSUP: disk_*(9) API change mega-patch 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: Fri, 06 Feb 2004 12:10:43 -0000 --o+ZCuNqY+dEAKBWl Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 05, 2004 at 11:02:47AM +0100, Poul-Henning Kamp wrote: +> This is a mostly mechanical and largely untested patch, so please test +> carefully if you have the necessary hardware. +>=20 +> Kernel patch: +> http://phk.freebsd.dk/patch/disk.patch +>=20 +> Man-page update: +> http://phk.freebsd.dk/patch/disk_man.patch +>=20 +> Patch version: 2004-02-05.1 +>=20 +> This patch changes the disk_*(9) API so that ownership of the "struct +> disk" is moved from the device drivers to GEOM. This removes a lot +> of trouble from the disk_destroy(9) handling, which should be robust +> with this patch. +>=20 +> After this change the API works as follows: +>=20 +> allocated struct disk with disk_alloc(), store pointer in softc. +> populate fields, including d_unit and d_flags which were +> previous arguments to disk_create(). +> call disk_create() with the pointer. +>=20 +> call disk_destroy() to signal that the device has disappeared. +> NB: do not access struct disk in the driver anymore! +> return any outstanding requests with suitable error. +>=20 +> At the same time: eliminate unused arguments from disk_create(9) +>=20 +> Reverse sense of DISKFLAG_NOGIANT, to DISKFLAG_NEEDSGIANT. +>=20 +> Two weeks review It panics my system when I'm booting it with USB bar inserted or when I insert it after boot: Memory modified after free 0xc4174300(124) val=3Ddeadc0dd @ 0xc4174334 panic: Most recently used by devbuf --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --o+ZCuNqY+dEAKBWl Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQFAI4S8ForvXbEpPzQRAol7AJ9Oce9Q5QclTAo3Yx1uoQww0V7mDACfThRQ 39+rq0w9w5k4metPznGIMAs= =80TY -----END PGP SIGNATURE----- --o+ZCuNqY+dEAKBWl--