Bug 60163

Summary: ATA failed to mount data track of CD-EXTRA multisession cd
Product: Base System Reporter: skywizard <skywizard>
Component: kernAssignee: Søren Schmidt <sos>
Status: Closed FIXED    
Severity: Affects Only Me CC: sos
Priority: Normal    
Version: 4.6.2-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description skywizard 2003-12-11 21:40:06 UTC
	Mounting multisession cd will fail with 'invalid argument'.
	This only occur if the very first track of the cd is NOT
	a data track, because the atapi-cd driver rely only on the
	first track to decide which block_size to use. However the cd
	can be mounted successfully through atapi-cam subsystem, or
	using older FreeBSD release (2.2.x).

Fix: 1) enable atapicam support and mount the cd
	using /dev/cd0c (only a workaround).

	2) Apply this patch (perhaps fix)
How-To-Repeat: 	Insert multisession cd (perhaps audio + data, where audio is
	in first session and at the beginning of the track)

	# mount_cd9660 /dev/acd0c /cdrom
	mount_cd9660: /dev/acd0c: Invalid argument
	# mount_cd9660 -s the_exact_sector /dev/acd0c /cdrom
	mount_cd9660: /dev/acd0c: Invalid argument
Comment 1 chi 2004-02-01 22:40:40 UTC
This is Chiharu Shibata.
At Thu Dec 11 13:40:06 PST 2003, you wrote:

>Fix
-snip-
>        2) Apply this patch (perhaps fix)
>    
>    --- sys/dev/ata/atapi-cd.c.orig Thu Dec 11 02:20:33 2003
>    +++ sys/dev/ata/atapi-cd.c      Thu Dec 11 02:26:14 2003
>    @@ -1277,7 +1277,13 @@
>         }
>         cdp->toc.hdr.len = ntohs(cdp->toc.hdr.len);
>     
>    -    cdp->block_size = (cdp->toc.tab[0].control & 4) ? 2048 : 2352;
>    +    cdp->block_size = 2352;
>    +    for (track = 0; track < ntracks; track++) {
>    +       if (cdp->toc.tab[track].control & 4) {
>    +           cdp->block_size = 2048;
>    +           break;
>    +       }
>    +    }
>         acd_set_ioparm(cdp);
>         bzero(ccb, sizeof(ccb));
>         ccb[0] = ATAPI_READ_CAPACITY;

I have already analized this problem, and reached the same conclusion.
Please commit this patch.

In detail, refer the following URL, please.
(Both written in Japanese, sorry).
[FreeBSD-tech-jp 3417] ATAPI CD-ROM patches
        <http://home.jp.freebsd.org/cgi-bin/showmail/FreeBSD-tech-jp/3417>
[FreeBSD-users-jp 74432] ATAPI CD-ROM quirks
        <http://home.jp.freebsd.org/cgi-bin/showmail/FreeBSD-users-jp/74432>
-- 
Chiharu Shibata    chi@bd.mbn.or.jp    <http://www32.ocn.ne.jp/~chi/>
Comment 2 Kris Kennaway freebsd_committer freebsd_triage 2004-02-09 04:53:02 UTC
Responsible Changed
From-To: freebsd-bugs->sos

Assign to maintainer
Comment 3 Søren Schmidt freebsd_committer freebsd_triage 2004-09-06 12:40:13 UTC
State Changed
From-To: open->closed

I do not agree with the patch. 
Anyhow you should open individual tracks via the /dev/acdXtY devices, that way you will get the right blocksize.