From owner-freebsd-current Mon Apr 1 13:20:13 2002 Delivered-To: freebsd-current@freebsd.org Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (Postfix) with ESMTP id DF6B537B405; Mon, 1 Apr 2002 13:20:05 -0800 (PST) Received: (from uucp@localhost) by sax.sax.de (8.9.3/8.9.3) with UUCP id XAA02326; Mon, 1 Apr 2002 23:20:04 +0200 (CEST) Received: (from j@localhost) by uriah.heep.sax.de (8.11.6/8.11.6) id g31LDKt02333; Mon, 1 Apr 2002 23:13:20 +0200 (MET DST) (envelope-from j) Date: Mon, 1 Apr 2002 23:13:20 +0200 (MET DST) Message-Id: <200204012113.g31LDKt02333@uriah.heep.sax.de> Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) Organization: Private BSD site, Dresden X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E References: <20020319025136.O60554@blossom.cjclark.org> In-Reply-To: <20020319025136.O60554@blossom.cjclark.org> From: j@uriah.heep.sax.de (Joerg Wunsch) Subject: Re: disklabel(8) floppy panic X-Original-Newsgroups: local.freebsd.current To: freebsd-current@freebsd.org Cc: "Crist J. Clark" , bde@freebsd.org 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 "Crist J. Clark" wrote: > Have a crash box handy? > > $ disklabel fd0.1440 The patch below should fix that, thanks for the bug report. fdioctl() historically attempted to determine the "raw" partition (`c') of the device in order to read the label. However, the floppy driver never really supported UFS-style partitions anyway. This ended up in selecting the wrong device for reading the label, which was a not-so-fatal error before the last floppy driver rewrite (it actually selected the fdX.1480 device then, which was obviously benign for 3.5" drives). However, now it hits an unitialized device which becomes fatal in readdisklabel() by attempting an indirect call to the strategy routine that hasn't been entered in the struct dev passed down. The call to dkmodpart() entered in rev. 1.64 of fd.c, so i'm Cc'ing Bruce for a comment whether the fix below is indeed TRT. Index: sys/isa/fd.c =================================================================== RCS file: /home/ncvs/src/sys/isa/fd.c,v retrieving revision 1.224 diff -u -r1.224 fd.c --- isa/fd.c 18 Dec 2001 22:16:33 -0000 1.224 +++ isa/fd.c 1 Apr 2002 20:56:22 -0000 @@ -2704,7 +2704,7 @@ fdt = fd->ft; lp->d_secpercyl = fdt->size / fdt->tracks; lp->d_type = DTYPE_FLOPPY; - if (readdisklabel(dkmodpart(dev, RAW_PART), lp) != NULL) + if (readdisklabel(dev, lp) != NULL) error = EINVAL; else *(struct disklabel *)addr = *lp; -- cheers, J"org .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message