NetBSD Problem Report #132
From gnats Fri Feb 18 10:55:23 1994
Received: from localhost (shipley@localhost) by sun-lamp.cs.berkeley.edu (8.6.5/8.6.5) id KAA17052; Fri, 18 Feb 1994 10:55:23 -0800
Message-Id: <199402181855.KAA17052@sun-lamp.cs.berkeley.edu>
Date: Fri, 18 Feb 1994 10:55:23 -0800
From: Peter Shipley <shipley>
Reply-To: shipley
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: Bug in sys/scsi/cd.c
X-Send-Pr-Version: 3.2
>Number: 132
>Category: kern
>Synopsis: system will crash at boot if there is not CD rom in drive
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: gnats-admin
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Feb 18 11:05:04 +0000 1994
>Closed-Date: Thu Apr 21 01:12:17 +0000 1994
>Last-Modified: Thu Jan 02 18:10:55 +0000 2014
>Originator: Peter Shipley
>Release:
>Organization:
" "
>Environment:
i486/33 Netbsd-current 2/14/93
i386/20 Netbsd-current 2/14/93
System: NetBSD loca1host.dis.org 0.9a LOCA1HOST#19 i386
>Description:
system will panic with a divide by zero error
If I have a Sun CD rom connected to the SCSI Bus
and a line in fstab to mount it (at boot).
>How-To-Repeat:
attach a sun CD rom the a system, add a line to fstab to mount
and reboot
>Fix:
*** cd.orig Fri Jan 21 00:23:54 1994
--- cd.c Fri Jan 21 00:38:19 1994
***************
*** 205,213 ****
printf("started ");
/*******************************************************\
* Load the physical device parameters *
\*******************************************************/
! cd_get_parms(unit, 0);
if(scsi_debug & TRACEOPENS)
printf("Params loaded ");
/*******************************************************\
* Load the partition info if not already loaded *
--- 205,215 ----
printf("started ");
/*******************************************************\
* Load the physical device parameters *
\*******************************************************/
! if( cd_get_parms(unit, 0)) {
! return(ENXIO);
! }
if(scsi_debug & TRACEOPENS)
printf("Params loaded ");
/*******************************************************\
* Load the partition info if not already loaded *
***************
*** 1035,1044 ****
blksize += rdcap.length_2 << 16;
blksize += rdcap.length_3 << 24;
}
if(cd_debug)printf("cd%d: %d %d byte blocks\n",unit,size,blksize);
! cd_data[unit]->params.disksize = size;
! cd_data[unit]->params.blksize = blksize;
return(size);
}
/*******************************************************\
--- 1037,1056 ----
blksize += rdcap.length_2 << 16;
blksize += rdcap.length_3 << 24;
}
if(cd_debug)printf("cd%d: %d %d byte blocks\n",unit,size,blksize);
!
! if (size < 100) {
! cd_data[unit]->params.disksize = 400000;
! } else {
! cd_data[unit]->params.disksize = size;
! }
!
! if (blksize < 512) {
! cd_data[unit]->params.blksize = 2048;
! } else {
! cd_data[unit]->params.blksize = blksize;
! }
return(size);
}
/*******************************************************\
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: mycroft
State-Changed-When: Wed Apr 20 18:12:17 PDT 1994
State-Changed-Why:
The new version does not have this bug.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.