From sime@data.home.hr  Mon Jan  9 22:12:31 2006
Return-Path: <sime@data.home.hr>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id ADC3416A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  9 Jan 2006 22:12:31 +0000 (GMT)
	(envelope-from sime@data.home.hr)
Received: from data.home.hr (dh77-149.xnet.hr [83.139.77.149])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9E2E043D5A
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  9 Jan 2006 22:12:30 +0000 (GMT)
	(envelope-from sime@data.home.hr)
Received: by data.home.hr (Postfix, from userid 34062)
	id 42FBC5F946; Mon,  9 Jan 2006 23:12:29 +0100 (CET)
Message-Id: <20060109221229.42FBC5F946@data.home.hr>
Date: Mon,  9 Jan 2006 23:12:29 +0100 (CET)
From: Simun Mikecin <sime@logos.hr>
Reply-To: Simun Mikecin <sime@logos.hr>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: panic: writing to UFS/softupdates DVD media using atapicam
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         91572
>Category:       kern
>Synopsis:       [atapicam] [panic] writing to UFS/softupdates DVD media using atapicam
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 09 22:20:02 GMT 2006
>Closed-Date:    
>Last-Modified:  Thu Apr 19 06:40:11 GMT 2007
>Originator:     Simun Mikecin
>Release:        FreeBSD 6.0-STABLE amd64
>Organization:
>Environment:
System: FreeBSD data.home.hr 6.0-STABLE FreeBSD 6.0-STABLE #0: Mon Jan 9 18:11:29 CET 2006 root@data.home.hr:/var/obj/usr/src.6/sys/DATA amd64


	
>Description:
Using virgin DVD+RW media in DVD writer drive with UFS2 filesystem on it.

Tested scenarios:

a) softupdates enabled, using /dev/cd1 (atapicam)
Writing files to mounted filesystem causes panic:
panic: initiate_write_inodeblock_ufs2: already_started

b) softupdates disabled, using /dev/cd1 (atapicam)
No panic occurs, writing to media works as expected.

c) softupdates enabled, using /dev/acd1
No panic occurs, writing to media works as expected.

This problem is probably related to kern/91568, cause in both cases problem
occurs only when softupdates are enabled.

Also worth mentioning: during writing to /dev/cd1 (atapicam) there is a
bunch of messages on the console:
Jan  9 20:02:12 data kernel: g_vfs_done():cd1[WRITE(offset=3691495424, length=131072)]error = 5
Jan  9 20:02:12 data kernel: g_vfs_done():cd1[WRITE(offset=3690577920, length=131072)]error = 5
Jan  9 20:02:31 data kernel: (cd1:ata1:0:0:0): WRITE(10). CDB: 2a 0 0 1b 87 30 0 0 20 0
Jan  9 20:02:31 data kernel: (cd1:ata1:0:0:0): Logical unit not ready, long write in progress

>How-To-Repeat:
Using DVD+RW media and dvd+rw-format from sysutils/dvd+rw-tools:

dvd+rw-format /dev/cd1
newfs_ufs -U /dev/cd1
mount -o noatime /dev/cd1 /mnt/1
cp -pRv /some/files/ /mnt/1/

>Fix:
Don't use atapicam for ATA drives. Not sure how real SCSI drives would behave.
>Release-Note:
>Audit-Trail:
>Unformatted:
