Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Sep 2009 23:01:16 +0200 (CEST)
From:      Juergen Lock <nox@jelal.kn-bremen.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/138789: cd(4) patch for drives/discs failing the 'read toc' command
Message-ID:  <200909132101.n8DL1GGJ024918@triton8.kn-bremen.de>
Resent-Message-ID: <200909132120.n8DLK8DG006059@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         138789
>Category:       kern
>Synopsis:       cd(4) patch for drives/discs failing the 'read toc' command
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 13 21:20:07 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Juergen Lock
>Release:        FreeBSD 8.0-BETA3 amd64
>Organization:
me?  organized??
>Environment:
System: FreeBSD triton8.kn-bremen.de 8.0-BETA3 FreeBSD 8.0-BETA3 #0: Fri Sep 4 20:25:37 CEST 2009 nox@triton8.kn-bremen.de:/usr/obj/data/home/nox/src-r8pb3b/src/sys/TRITON8 amd64


>Description:
	As mentioned earlier on -current, cd(4), unlike acd(4), won't read
	a disc (returns 0 bytes) when the drive returned a proper disc size
	but failed the 'read toc' command.  Observed here with a bluray
	data disc and, as mentioned later in the thread, also by
	Ulrich Spörlein with an external usb/1394 dvd drive and regular
	`pressed' dvd data discs.

	Thread is here:
	http://lists.freebsd.org/pipermail/freebsd-current/2009-August/010316.html

>How-To-Repeat:
	Burn a bluray data disc (mine was ~15GB) using e.g. growisofs from
	/usr/ports/sysutils/dvd+rw-tools and then try to read it via a
	cd(4) device as provided by atapicam(4), ahci(4), or siis(4).
	Verify the same disc/drive on an acd(4) device reads just fine.

>Fix:

Index: sys/cam/scsi/scsi_cd.c
@@ -2868,12 +2868,18 @@
 	}
 
 	softc->flags |= CD_FLAG_VALID_TOC;
+
+bailout:
 	softc->disk->d_maxsize = DFLTPHYS;
 	softc->disk->d_sectorsize = softc->params.blksize;
 	softc->disk->d_mediasize =
 	    (off_t)softc->params.blksize * softc->params.disksize;
 
+/* if
 bailout:
+ * is here read requests will fail when the toc cant be read although
+ * CD_FLAG_VALID_MEDIA is set.
+ */
 
 	/*
 	 * We unconditionally (re)set the blocksize each time the
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909132101.n8DL1GGJ024918>