From owner-freebsd-bugs@FreeBSD.ORG Wed Jun 14 22:20:29 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18B3D16A492 for ; Wed, 14 Jun 2006 22:20:29 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F64743D49 for ; Wed, 14 Jun 2006 22:20:28 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k5EMKRi9047856 for ; Wed, 14 Jun 2006 22:20:27 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k5EMKRiO047855; Wed, 14 Jun 2006 22:20:27 GMT (envelope-from gnats) Resent-Date: Wed, 14 Jun 2006 22:20:27 GMT Resent-Message-Id: <200606142220.k5EMKRiO047855@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, john hood , cgull@glup.org, ni@sandstorm.net Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B6A416A41A; Wed, 14 Jun 2006 22:18:41 +0000 (UTC) (envelope-from jh@sirocco.sandstorm.net) Received: from sirocco.sandstorm.net (ip-69-33-111-75.bos.megapath.net [69.33.111.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8661043D45; Wed, 14 Jun 2006 22:18:40 +0000 (GMT) (envelope-from jh@sirocco.sandstorm.net) Received: from sirocco.sandstorm.net (localhost [127.0.0.1]) by sirocco.sandstorm.net (8.13.3/8.13.3) with ESMTP id k5EMLqCA063450; Wed, 14 Jun 2006 18:21:52 -0400 (EDT) (envelope-from jh@sirocco.sandstorm.net) Received: (from jh@localhost) by sirocco.sandstorm.net (8.13.3/8.13.3/Submit) id k5EMLnM0063449; Wed, 14 Jun 2006 18:21:49 -0400 (EDT) (envelope-from jh) Message-Id: <200606142221.k5EMLnM0063449@sirocco.sandstorm.net> Date: Wed, 14 Jun 2006 18:21:49 -0400 (EDT) From: john hood To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: ni@sandstorm.net, sos@FreeBSD.org Subject: kern/98962: writing >1 session on ATAPI CDs fails [patch included] X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: john hood , cgull@glup.org, ni@sandstorm.net List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jun 2006 22:20:29 -0000 >Number: 98962 >Category: kern >Synopsis: writing >1 session on ATAPI CDs fails [patch included] >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 14 22:20:27 GMT 2006 >Closed-Date: >Last-Modified: >Originator: john hood >Release: FreeBSD 6.0-RELEASE i386 >Organization: Sandstorm Enterprises >Environment: System: FreeBSD faster.sandstorm.net 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu Nov 3 09:36:13 UTC 2005 root@x64.samsco.home:/usr/obj/usr/src/sys/GENERIC i386 Dell Dimension 2400 with ATAPI CD-RW drive. dmesg.boot follows: Copyright (c) 1992-2005 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 6.0-RELEASE #0: Thu Nov 3 09:36:13 UTC 2005 root@x64.samsco.home:/usr/obj/usr/src/sys/GENERIC Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: Intel(R) Celeron(R) CPU 2.40GHz (2392.95-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0xf29 Stepping = 9 Features=0xbfebfbff Features2=0x4400> real memory = 796344320 (759 MB) avail memory = 770007040 (734 MB) ACPI APIC Table: ioapic0: Changing APIC ID to 1 ioapic0 irqs 0-23 on motherboard npx0: [FAST] npx0: on motherboard npx0: INT 16 interface acpi0: on motherboard acpi0: Power Button (fixed) pci_link0: irq 11 on acpi0 pci_link1: irq 5 on acpi0 pci_link2: irq 9 on acpi0 pci_link3: irq 10 on acpi0 pci_link4: on acpi0 pci_link5: on acpi0 pci_link6: on acpi0 pci_link7: irq 7 on acpi0 Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0 cpu0: on acpi0 acpi_button0: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pci0: at device 2.0 (no driver attached) uhci0: port 0xff80-0xff9f irq 16 at device 29.0 on pci0 uhci0: [GIANT-LOCKED] usb0: on uhci0 usb0: USB revision 1.0 uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered uhci1: port 0xff60-0xff7f irq 19 at device 29.1 on pci0 uhci1: [GIANT-LOCKED] usb1: on uhci1 usb1: USB revision 1.0 uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1: 2 ports with 2 removable, self powered uhci2: port 0xff40-0xff5f irq 18 at device 29.2 on pci0 uhci2: [GIANT-LOCKED] usb2: on uhci2 usb2: USB revision 1.0 uhub2: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub2: 2 ports with 2 removable, self powered ehci0: mem 0xffa80800-0xffa80bff irq 23 at device 29.7 on pci0 ehci0: [GIANT-LOCKED] usb3: EHCI version 1.0 usb3: companion controllers, 2 ports each: usb0 usb1 usb2 usb3: on ehci0 usb3: USB revision 2.0 uhub3: Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1 uhub3: 6 ports with 6 removable, self powered pcib1: at device 30.0 on pci0 pci1: on pcib1 pci1: at device 6.0 (no driver attached) bfe0: mem 0xfe9ee000-0xfe9effff irq 17 at device 9.0 on pci1 miibus0: on bfe0 bmtphy0: on miibus0 bmtphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto bfe0: Ethernet address: 00:0d:56:be:f8:69 isab0: at device 31.0 on pci0 isa0: on isab0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xffa0-0xffaf mem 0xfeb7fc00-0xfeb7ffff irq 18 at device 31.1 on pci0 ata0: on atapci0 ata1: on atapci0 pci0: at device 31.3 (no driver attached) pcm0: port 0xee00-0xeeff,0xedc0-0xedff mem 0xfeb7fa00-0xfeb7fbff,0xfeb7f900-0xfeb7f9ff irq 17 at device 31.5 on pci0 pcm0: [GIANT-LOCKED] pcm0: fdc0: port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0 fdc0: [FAST] atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] psm0: irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: model Generic PS/2 mouse, device ID 0 sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 sio0: type 16550A pmtimer0 on isa0 orm0: at iomem 0xc0000-0xc8fff,0xc9000-0xca7ff,0xca800-0xcbfff on isa0 ppc0: parallel port not found. sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> sio1: configured irq 3 not in bitmap of probed irqs 0 sio1: port may not be enabled vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 ums0: Logitech USB-PS/2 Mouse M-BA47, rev 1.00/1.20, addr 2, iclass 3/1 ums0: 4 buttons and Z dir. Timecounter "TSC" frequency 2392950508 Hz quality 800 Timecounters tick every 1.000 msec ad0: 76319MB at ata0-master UDMA100 acd0: CDRW at ata1-master UDMA33 Trying to mount root from ufs:/dev/ad0s1a Accounting enabled Test media for this report is an "HP CD-RW" 12X, ATIP info as reported by cdrecord is: ATIP info from disk: Indicated writing power: 3 Reference speed: 6 Is not unrestricted Is erasable Disk sub type: High speed Rewritable (CAV) media (1) ATIP start of lead in: -11635 (97:26/65) ATIP start of lead out: 359849 (79:59/74) 1T speed low: 4 1T speed high: 10 2T speed low: 4 2T speed high: 0 (reserved val 6) power mult factor: 1 5 recommended erase/write power: 3 A1 values: 24 1A BC A2 values: 26 B2 26 Disk type: Phase change Manuf. index: 3 Manufacturer: CMC Magnetics Corporation >Description: Writing the second session on a multi-session CD-R or CD-RW with burncd fails. Edited script session follows: Script started on Wed Jun 14 17:02:04 2006 root@faster# burncd blank blanking CD - 98 % done root@faster# mkisofs -r -o /tmp/iso1 /etc/profile Total translation table size: 0 Total rockridge attributes bytes: 248 Total directory bytes: 0 Path table size(bytes): 10 Max brk space used 91c4 176 extents written (0 MB) root@faster# burncd -m data /tmp/iso1 fixate next writeable LBA 0 writing from file /tmp/iso1 size 352 KB written this track 352 KB (100%) total 352 KB fixating CD, please wait.. root@faster# burncd msinfo burncd: ioctl(CDIOREADTOCHEADER): Input/output error root@faster# cdcontrol ej # this stale-TOC bug is already fixed root@faster# cdcontrol cl root@faster# burncd msinfo 0,11700 root@faster# mkisofs -r -C 0,11700 -M /dev/acd0 -o /tmp/iso2 /etc/printcap Rock Ridge signatures found Total translation table size: 0 Total rockridge attributes bytes: 329 Total directory bytes: 0 Path table size(bytes): 10 Max brk space used a1c4 11877 extents written (23 MB) root@faster# burncd -m data /tmp/iso2 fixate next writeable LBA 11700 writing from file /tmp/iso2 size 354 KB Input/output error fixating CD, please wait.. root@faster# echo $? 0 root@faster# cdcontrol ej root@faster# cdcontrol cl root@faster# mount /cdrom root@faster# ls /cdrom profile root@faster# umount /cdrom root@faster# burncd msinfo 0,11700 root@faster# exit Script done on Wed Jun 14 17:10:17 2006 ktrace shows burncd getting EIO on its first write to /dev/acd0. >How-To-Repeat: See above script. >Fix: If a CD has a TOC, the acd driver reports the CD's current size to GEOM, and GEOM later prevents writes beyond the last session on the media. Writing the first session works because the driver sets the disk size to (u_int32_t)-1, which gets cast to an int64 for GEOM, becoming 0xffffffff. This patch sets the media size for GEOM to a large positive number, but only when the device is opened writable. Index: dev/ata/atapi-cd.c =================================================================== RCS file: /sand/CVSROOT/ni/src/freebsd/sys6.0/dev/ata/atapi-cd.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- dev/ata/atapi-cd.c 14 Jun 2006 20:30:33 -0000 1.1 +++ dev/ata/atapi-cd.c 14 Jun 2006 20:32:35 -0000 1.2 @@ -731,6 +731,8 @@ else { pp->sectorsize = cdp->block_size; pp->mediasize = cdp->disk_size; + if (dw + pp->acw != 0) + pp->mediasize = INT32_MAX; /* Pick a number. */ } pp->mediasize *= pp->sectorsize; >Release-Note: >Audit-Trail: >Unformatted: