From owner-freebsd-bugs@FreeBSD.ORG Sun Sep 13 21:20:08 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8592A1065672 for ; Sun, 13 Sep 2009 21:20:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5EE598FC1D for ; Sun, 13 Sep 2009 21:20:08 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DLK8wI006060 for ; Sun, 13 Sep 2009 21:20:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n8DLK8DG006059; Sun, 13 Sep 2009 21:20:08 GMT (envelope-from gnats) Resent-Date: Sun, 13 Sep 2009 21:20:08 GMT Resent-Message-Id: <200909132120.n8DLK8DG006059@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Juergen Lock Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E651106566C for ; Sun, 13 Sep 2009 21:19:46 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id D322B8FC14 for ; Sun, 13 Sep 2009 21:19:45 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id C32E61E005A8; Sun, 13 Sep 2009 23:04:38 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id n8DL1GrX024919 for ; Sun, 13 Sep 2009 23:01:16 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id n8DL1GGJ024918; Sun, 13 Sep 2009 23:01:16 +0200 (CEST) (envelope-from nox) Message-Id: <200909132101.n8DL1GGJ024918@triton8.kn-bremen.de> Date: Sun, 13 Sep 2009 23:01:16 +0200 (CEST) From: Juergen Lock To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/138789: cd(4) patch for drives/discs failing the 'read toc' command X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Juergen Lock List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 21:20:08 -0000 >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: