From owner-freebsd-current Mon Feb 11 19:45:53 2002 Delivered-To: freebsd-current@freebsd.org Received: from newman2.bestweb.net (newman2.bestweb.net [209.94.102.67]) by hub.freebsd.org (Postfix) with ESMTP id BE5FD37B62A; Mon, 11 Feb 2002 18:18:51 -0800 (PST) Received: from okeeffe.bestweb.net (okeefe.bestweb.net [209.94.100.110]) by newman2.bestweb.net (Postfix) with ESMTP id 85D5D231D7; Mon, 11 Feb 2002 21:17:51 -0500 (EST) Received: by okeeffe.bestweb.net (Postfix, from userid 0) id 796E39F38A; Mon, 11 Feb 2002 21:12:35 -0500 (EST) Date: Sun, 10 Feb 2002 14:10:50 +1100 (EST) From: Bruce Evans To: John Baldwin Cc: Mikhail Teterin , Subject: RE: panic: bdwrite: buffer is not busy Message-Id: <20020212021235.796E39F38A@okeeffe.bestweb.net> 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 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. > 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. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message