From nobody@FreeBSD.org  Mon Aug  8 07:43:08 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 783211065673
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  8 Aug 2011 07:43:08 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 68EDA8FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  8 Aug 2011 07:43:08 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p787h8Vq007901
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 8 Aug 2011 07:43:08 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p787h843007895;
	Mon, 8 Aug 2011 07:43:08 GMT
	(envelope-from nobody)
Message-Id: <201108080743.p787h843007895@red.freebsd.org>
Date: Mon, 8 Aug 2011 07:43:08 GMT
From: Christian Oaksford <coaksford@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: gmirror unload 
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         159595
>Category:       kern
>Synopsis:       [geom] [panic] panic on gmirror unload in vbox [regression]
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-geom
>State:          feedback
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 08 07:50:11 UTC 2011
>Closed-Date:    
>Last-Modified:  Mon Nov 28 15:12:38 UTC 2011
>Originator:     Christian Oaksford
>Release:        9.0-BETA1
>Organization:
>Environment:
FreeBSD fbsdvm 9.0-BETA1 FreeBSD 9.0-BETA1 #0: Thu Jul 28 17:15:31 UTC 2011     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
Testing in VirtualBox 4.1.0 because I do not have hardware to dedicate
to testing this.

If you "gmirror unload" while you have an active mirror on 9.0-BETA1,
it causes a panic. On 8.2-RC2, it tells you the device is busy. This
seems to be the better behavior. gstripe does not show this behavior
that gmirror does.


From the VM on which this works:

fbsd-vm# uname -a
FreeBSD fbsd-vm.rchist.net 8.2-RC2 FreeBSD 8.2-RC2 #0: Wed Jan 12 17:02:35 UTC 2011     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
fbsd-vm# gmirror label data ad4 ad6
fbsd-vm# gmirror load
GEOM_MIRROR: Device mirror/data launched (2/2).
fbsd-vm# gmirror unload
gmirror: Could not unload module: Device busy.


From the VM on which this breaks:

fbsdvm# uname -a
FreeBSD fbsdvm 9.0-BETA1 FreeBSD 9.0-BETA1 #0: Thu Jul 28 17:15:31 UTC 2011     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
fbsdvm# gmirror label data ada1 ada2
fbsdvm# gmirror load
GEOM_MIRROR: Device mirror/data launched (2/2).
fbsdvm# gmirror unload
System call kldunload returning with one of the following locks held:
exclusive sx kernel linker (kernel linker) r = 0 (0xffffffff81119a80) locked @ /usr/src/sys/kern/kern_linker.c:1082
panic: witness_warn
cpuid = 0
KDB enter: panic
[ thread pid 1058 tid 100071 ]
Stopped at      kdb_enter+0x3b: movq    $0,0x912272(%rip)
db>

>How-To-Repeat:
"gmirror label" two disks. Then "gmirror load" to get the mirror in
operation, then "gmirror unload", on 9.0-BETA1.
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-geom 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Aug 14 10:25:59 UTC 2011 
Responsible-Changed-Why:  
reclassiy. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=159595 
State-Changed-From-To: open->feedback 
State-Changed-By: jh 
State-Changed-When: Mon Nov 28 15:11:53 UTC 2011 
State-Changed-Why:  
Do you still see this after r224546? 
(http://svnweb.freebsd.org/base?view=revision&revision=224546) 

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