From owner-freebsd-current Sun Feb 10 2:23:34 2002 Delivered-To: freebsd-current@freebsd.org Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by hub.freebsd.org (Postfix) with ESMTP id 63FF937B416; Sun, 10 Feb 2002 02:23:31 -0800 (PST) Received: from aldan.algebra.com (localhost [127.0.0.1]) by aldan.algebra.com (8.11.6/8.11.5) with ESMTP id g1AA8eX08143; Sun, 10 Feb 2002 05:08:41 -0500 (EST) (envelope-from mi@aldan.algebra.com) Message-Id: <200202101008.g1AA8eX08143@aldan.algebra.com> Date: Sun, 10 Feb 2002 05:08:37 -0500 (EST) From: Mikhail Teterin Subject: Re: panic: bdwrite: buffer is not busy To: bde@zeta.org.au Cc: jhb@FreeBSD.ORG, current@FreeBSD.ORG In-Reply-To: <20020210140121.D6710-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 10 Feb, Bruce Evans wrote: > On Sat, 9 Feb 2002, John Baldwin wrote: > >> On 09-Feb-02 Mikhail Teterin wrote: >> > While attempting to ``fdisk fd0.1440''. Or ``fdisk fd0''. Or >> > ``newfs_msdos fd0.1440'' with or without the floppy inside :-\ With >> > todays or Jan 3rd kernel (my previous upgrade). >> >> Only use fdisk on hard disks. Still it shouldn't panic. The bdwrite >> is just extra garbage, the real panic is due to a NULL pointer >> dereference: > > This is a well known bug in the device layer. I reported it on > 2001/12/26 and fixed it locally a little later. See the thread in > -current about "panic during fdisk'ing a md(4) device" for patches. Fdisk I don't really need, but attempting to newfs the floppy caused the same panic :-\ And mounting the already formatted floppy leads to "invalid argument". Could we have this fixed soon, please? The inability to access a floppy is a great setback for my local FreeBSD advocacy efforts :-) -mi >> I'm guessing that devsw() is returning NULL here. You could add a >> KASSERT() to this macro just before the call to d_strategy() along >> the lines of >> >> KASSERT(devsw((bp)->bio_dev) != NULL, ("no devsw for bio")); \ > > Right. From my original bug report: > > ! "fdisk /dev/fd0" now causes a null pointer panic in readdisklabel(). > ! This is because fdioctl() attempts to construct a (slightly > ! wrong) device using dkmodpart(), but dkmodpart() only constructs a > ! half-baked device since it only calls makedev(). The device is > ! missing a devsw so DEV_STRATEGY() in readdisklabel() panics on it. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message