Bug 46000

Summary: Fix reading of mixed-mode CD's in ATAPI CDROM drives
Product: Base System Reporter: Daniel O'Connor <doconnor>
Component: kernAssignee: Søren Schmidt <sos>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Daniel O'Connor 2002-12-05 00:40:01 UTC
The ATAPI CD code picks the block size of the first track as the default when
trying to mount a CD, this breaks when you have a mixed mode CD and the first
track is audio (Tries to read a data track with a block size of 2352 bytes)

Fix: Obtained from Chris Faulhaber <jedgar@fxp.org>
See message ID 20021015010307.GA39347@peitho.fxp.org on -stable.



http://www.gsoft.com.au/~doconnor/atapi-cd-mixed.patch--NeQG0eUHEiLVvFhzVuyEmWswnFwapTscQMEBn1oSghGL9cJT
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

Index: sys/dev/ata/atapi-cd.c
===================================================================
RCS file: /usr/CVS-Repository/src/sys/dev/ata/atapi-cd.c,v
retrieving revision 1.48.2.17
diff -u -r1.48.2.17 atapi-cd.c
--- sys/dev/ata/atapi-cd.c      31 Jul 2002 11:19:25 -0000      1.48.2.17
+++ sys/dev/ata/atapi-cd.c      5 Dec 2002 00:29:40 -0000
@@ -1263,7 +1263,7 @@
     }
     cdp->toc.hdr.len = ntohs(cdp->toc.hdr.len);
 
-    cdp->block_size = (cdp->toc.tab[0].control & 4) ? 2048 : 2352;
+    cdp->block_size = 2048;
     acd_set_ioparm(cdp);
     bzero(ccb, sizeof(ccb));
     ccb[0] = ATAPI_READ_CAPACITY;
How-To-Repeat: mount_cd9660 /dev/acd0c /mnt
Comment 1 Johan Karlsson freebsd_committer freebsd_triage 2002-12-19 18:54:37 UTC
Responsible Changed
From-To: freebsd-bugs->sos

Over to ATA maintainer.
Comment 2 Søren Schmidt freebsd_committer freebsd_triage 2003-02-20 20:31:46 UTC
State Changed
From-To: open->closed

Use the /dev/acdXtN devices to access individual tracks and the 
block sixe will be correct.