Bug 20933

Summary: ATAPI ZIP drive allows mounted disks to be ejected
Product: Base System Reporter: dcschooley <dcschooley>
Component: kernAssignee: Søren Schmidt <sos>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description dcschooley 2000-08-30 03:20:02 UTC
As implemented in the current atapi-fd driver code, an ATAPI ZIP drive allows mounted disks to be ejected. This can cause an unrecoverable I/O error if the disk is reinserted, which requires the machine to be rebooted.

The existing code uses the correct ATA calls to lock the drive, but the function is only called if count_dev() returns 1. During my testing, count_dev() only returned 0 for the ZIP drive, but it did return 1 for the CDROM.

Fix: The following patch to sys/dev/ata/atapi-fd.c fixes the problem by eliminating the call to count_dev(). The count_dev() function call appears to be unnecessary.
How-To-Repeat: 1. Mount a ufs formatted zip disk.
2. Eject the disk.
3. Reinsert the disk and attempt to unmount it.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-08-30 08:55:37 UTC
Responsible Changed
From-To: freebsd-bugs->sos

Over to the ATA maintainer.
Comment 2 Søren Schmidt freebsd_committer freebsd_triage 2001-04-02 20:47:40 UTC
State Changed
From-To: open->closed

This works on my -current system now...