From ed@hoeg.nl  Mon Nov 19 19:34:37 2007
Return-Path: <ed@hoeg.nl>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB1F516A418
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 19 Nov 2007 19:34:37 +0000 (UTC)
	(envelope-from ed@hoeg.nl)
Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211])
	by mx1.freebsd.org (Postfix) with ESMTP id 798D713C45B
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 19 Nov 2007 19:34:37 +0000 (UTC)
	(envelope-from ed@hoeg.nl)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id C09A81CCC6; Mon, 19 Nov 2007 20:34:35 +0100 (CET)
Message-Id: <20071119193435.C09A81CCC6@palm.hoeg.nl>
Date: Mon, 19 Nov 2007 20:34:35 +0100 (CET)
From: Ed Schouten <ed@fxq.nl>
Reply-To: Ed Schouten <ed@fxq.nl>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Geom/ATA: Panic when running `cdcontrol eject' on MacBook
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         118134
>Category:       kern
>Synopsis:       [geom] geom/ATA: Panic when running `cdcontrol eject' on MacBook
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-geom
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 19 19:40:01 UTC 2007
>Closed-Date:    Tue Nov 20 14:54:45 UTC 2007
>Last-Modified:  Tue Nov 20 14:54:45 UTC 2007
>Originator:     Ed Schouten
>Release:        FreeBSD 6.3-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD mekker.fxq.nl 8.0-CURRENT FreeBSD 8.0-CURRENT #1: Mon Nov 19 20:18:07 CET 2007 root@mekker.fxq.nl:/usr/obj/usr/src/sys/MEKKER  amd64
>Description:
I am one of the lucky owners of a brand new Apple MacBook, the ones that
were released by the end of October.

Because Apples don't have eject buttons on the CD-drive, I have to punch
in `cdcontrol eject' to remove a CD from the CD-ROM drive. For some
reason, this causes a panic, right after the drive spits out the CD.
>How-To-Repeat:
$ cdcontrol eject

The following trace will pop up:

panic: Geom provider ACD::acd0 failed closing ->access()
cpuid = 0
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2a
panic() at panic+0x17a
g_access() at g_access+0x2ff
g_dev_close() at g_dev_close+0xbf
devfs_close() at devfs_close+0x2dd
vn_close() at vn_close+0xb6
vn_closefile() at vn_closefile+0x82
fdrop() at fdrop+0xdd
closef() at closef+0x29
fdfree() at fdfree+0x10f
exit1() at exit1+0x2d5
sys_exit() at sys_exit+0xe
syscall() at syscall+0x1ba
Xfast_syscall() at Xfast_syscall+0xab
--- syscall (1, FreeBSD ELF64, sys_exit), rip = 0x80091e26c, rsp = 0x7fffffffeda8, rbp = 0x7fffffffee10 ---

Trace with kgdb:

#0  doadump () at pcpu.h:194
#1  0xffffffff8017f10c in db_fncall (dummy1=Variable "dummy1" is not available.
) at /usr/src/sys/ddb/db_command.c:486
#2  0xffffffff8017f62c in db_command_loop () at /usr/src/sys/ddb/db_command.c:401
#3  0xffffffff8018108f in db_trap (type=Variable "type" is not available.
) at /usr/src/sys/ddb/db_main.c:222
#4  0xffffffff802c8c95 in kdb_trap (type=3, code=0, tf=0xffffffffaf0b6520) at /usr/src/sys/kern/subr_kdb.c:502
#5  0xffffffff803f0e1a in trap (frame=0xffffffffaf0b6520) at /usr/src/sys/amd64/amd64/trap.c:472
#6  0xffffffff803d698e in calltrap () at /usr/src/sys/amd64/amd64/exception.S:169
#7  0xffffffff802c8e61 in kdb_enter (msg=0xffffffff80820fe0 "") at cpufunc.h:63
#8  0xffffffff802a1833 in panic (fmt=Variable "fmt" is not available.
) at /usr/src/sys/kern/kern_shutdown.c:547
#9  0xffffffff8025211f in g_access (cp=0xffffffff80581800, dcr=-1, dcw=0, dce=53103872) at /usr/src/sys/geom/geom_subr.c:749
#10 0xffffffff8024b4ff in g_dev_close (dev=0xffffff0003321200, flags=Variable "flags" is not available.
) at /usr/src/sys/geom/geom_dev.c:217
#11 0xffffffff8023af2d in devfs_close (ap=0xffffffffaf0b6840) at /usr/src/sys/fs/devfs/devfs_vnops.c:369
#12 0xffffffff803241b6 in vn_close (vp=0xffffff00033b0000, flags=1, file_cred=0xffffff00010bad00, td=0xffffff0003393350) at vnode_if.h:228
#13 0xffffffff803242b2 in vn_closefile (fp=0xffffff00033a1168, td=0xffffff0003393350) at /usr/src/sys/kern/vfs_vnops.c:868
#14 0xffffffff8027727d in fdrop (fp=0xffffff00033a1168, td=0xffffff0003393350) at file.h:297
#15 0xffffffff802784b9 in closef (fp=0xffffff00033a1168, td=0xffffff0003393350) at /usr/src/sys/kern/kern_descrip.c:1958
#16 0xffffffff802791af in fdfree (td=0xffffff0003393350) at /usr/src/sys/kern/kern_descrip.c:1668
#17 0xffffffff80281f95 in exit1 (td=0xffffff0003393350, rv=0) at /usr/src/sys/kern/kern_exit.c:271
#18 0xffffffff80282dfe in sys_exit (td=Variable "td" is not available.
) at /usr/src/sys/kern/kern_exit.c:98
#19 0xffffffff803f075a in syscall (frame=0xffffffffaf0b6c70) at /usr/src/sys/amd64/amd64/trap.c:825
#20 0xffffffff803d6b9b in Xfast_syscall () at /usr/src/sys/amd64/amd64/exception.S:290
#21 0x000000080091e26c in ?? ()

>Fix:
Don't use the CD-ROM drive. :-(
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-geom 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Nov 19 22:09:43 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118134 

From: Ed Schouten <ed@fxq.nl>
To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org
Cc:  
Subject: Re: kern/118134: Geom/ATA: Panic when running `cdcontrol eject' on
	MacBook
Date: Tue, 20 Nov 2007 12:55:18 +0100

 --+IojnoBMdP/qo3gc
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 Hello,
 
 It seems that after sos@'s commit to atapi-cd.c, 17 hours ago, this
 panic has been fixed. I guess this PR can be closed now.
 
 --=20
  Ed Schouten <ed@fxq.nl>
  WWW: http://g-rave.nl/
 
 --+IojnoBMdP/qo3gc
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.7 (FreeBSD)
 
 iD8DBQFHQssm52SDGA2eCwURApX0AJ4izrmzBnOaVcaA/yQG/GpsJDD4KwCcCHjK
 qyWgtBCO2idmU81bWjwJANI=
 =CFve
 -----END PGP SIGNATURE-----
 
 --+IojnoBMdP/qo3gc--
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Tue Nov 20 14:53:55 UTC 2007 
State-Changed-Why:  
The most recent commit to atapi-cd.c fixes this problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118134 
>Unformatted:
