Bug 56572

Summary: ATAng sees zero sized disk... causes div-by-zero
Product: Base System Reporter: David Gilbert <freebsd-submit>
Component: kernAssignee: Søren Schmidt <sos>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.1-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description David Gilbert 2003-09-07 21:10:12 UTC
The Dell has a two channel IDE controller.  Channel 0 is the hard drive
and channel 1 is the DVD+R drive.  For some reason, ATAng sees a phanotm
ad3 when the DVD+R is inserted (it is not seen when the DVD+R is removed.)
This happens both when the DVD+R is hot-swapped in and when it is in at
boot.

I get a divide-by-zero panic in ad_print in ata-disk.c without the
included patch.  The dmesg now says:

ata1: resetting devices ..
acd0: CDRW <PHILIPS DVD+RW SDVD6004> at ata1-master WDMA2
ad3: FAILURE - total sectors 0

Fix: This fix protects against zero length ata devices ... and should likely
be left in regardless (malicious devices hot-swapped in shouldn't
panic the kernel).

This fix does not address why ATAng is detecting a phantom ad3.
The ATA code previous to ATAng did not detect the phantom drive.
How-To-Repeat: 
Boot with -CURRENT on my laptop.
Comment 1 Simon L. B. Nielsen freebsd_committer freebsd_triage 2003-09-08 14:56:29 UTC
Responsible Changed
From-To: freebsd-bugs->sos

Over to the ATA maintainer.
Comment 2 Søren Schmidt freebsd_committer freebsd_triage 2003-09-08 14:57:46 UTC
State Changed
From-To: open->feedback

Could you try to upgrade to the latest current (> 14:00 CET sept 8) 
and see if that fixes the problem by not finding ghost disks ?
Comment 3 Søren Schmidt freebsd_committer freebsd_triage 2003-10-25 20:25:42 UTC
State Changed
From-To: feedback->closed

Feedback timeout (and the proplem is belived to be fixed)