From nobody@FreeBSD.org  Sun May 29 18:52:02 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 E1181106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 29 May 2011 18:52:01 +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 C7C138FC1B
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 29 May 2011 18:52:01 +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 p4TIq04V046093
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 29 May 2011 18:52:00 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p4TIq0jH046092;
	Sun, 29 May 2011 18:52:00 GMT
	(envelope-from nobody)
Message-Id: <201105291852.p4TIq0jH046092@red.freebsd.org>
Date: Sun, 29 May 2011 18:52:00 GMT
From: "Ilya A. Arkhipov" <micro@heavennet.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [bug] trouble with: mdconfig force delete && zfs stripe
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         157399
>Category:       kern
>Synopsis:       [zfs] trouble with: mdconfig force delete && zfs stripe
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-fs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 29 19:00:20 UTC 2011
>Closed-Date:    
>Last-Modified:  Mon May 30 11:30:15 UTC 2011
>Originator:     Ilya A. Arkhipov
>Release:        FreeBSD 9.0-CURRENT
>Organization:
>Environment:
FreeBSD micro 9.0-CURRENT FreeBSD 9.0-CURRENT #2: Fri Mar 18 07:11:37 UTC 2011     root@micro:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
On VirtualBox with freebsd head system install on ufs:
testbsd# uname -a
FreeBSD testbsd 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Wed Apr 27 00:19:50 MSD 2011     root@testbsd:/usr/obj/usr/src/sys/GENERIC  i386

testbsd# mdconfig -a -t malloc -s 100M 
md0

testbsd# mdconfig -a -t malloc -s 100M
md1

testbsd# zpool create testpools md0 md1

testbsd# zfs list
NAME        USED  AVAIL  REFER  MOUNTPOINT
testpool    100K  62,9M    31K  /testpool
testpools    97K   159M    31K  /testpools

testbsd# dd if=/dev/random of=/testpools/myfile.dat bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes transferred in 8.402073 secs (12479968 bytes/sec)

testbsd# ll /testpools
total 102479
-rw-r--r--  1 root  wheel  104857600 13 &#1084;&#1072;&#1081; 10:33 myfile.dat

testbsd# zfs list
NAME        USED  AVAIL  REFER  MOUNTPOINT
testpool    100K  62,9M    31K  /testpool
testpools   101M  58,2M   100M  /testpools

testbsd# mdconfig -d -u 0 -o force
not responding... 

http://imm.io/5BLl -- screen vb(not responding)
hard reboot

micro[10:47:20]> ssh micro@192.168.3.116
Password:
Last login: Fri May 13 10:46:03 2011
FreeBSD 9.0-CURRENT (GENERIC) #0: Wed Apr 27 00:19:50 MSD 2011

%zpool status testpools
  pool: testpools
 state: UNAVAIL
status: One or more devices could not be opened.  There are insufficient
    replicas for the pool to continue functioning.
action: Attach the missing device and online it using 'zpool online'.
   see: http://www.sun.com/msg/ZFS-8000-3C
 scan: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    testpools   UNAVAIL      0     0     0  insufficient replicas
      md0       UNAVAIL      0     0     0  cannot open
      md1       UNAVAIL      0     0     0  cannot open

%su -
Password:

testbsd# zpool destroy testpools
testbsd#

On virtual box after "mdconfig -d -u 0 -o force" i have freezee.. &&
system not responding.

#########Laptop##########
system install on pool z
root[16:24:45]> zpool destroy tester
load: 1.78  cmd: zpool 45206 [zfs] 192.77r 0.00u 0.01s 0% 2248k

root[16:31:27]> zpool status tester
  pool: tester
 state: UNAVAIL
status: One or more devices are faulted in response to IO failures.
action: Make sure the affected devices are connected, then run 'zpool clear'.
   see: http://www.sun.com/msg/ZFS-8000-HC
 scan: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    tester      UNAVAIL      0     0     0  insufficient replicas
      md0       ONLINE       0     0     0
      md2       UNAVAIL      0     0     0  corrupted data

errors: No known data errors

root[16:39:35]> mdconfig -l
md0 

root[16:39:44]> mdconfig -d -u 0 -o force
mdconfig: ioctl(/dev/mdctl): No such file or directory

root[16:41:20]> procstat -kk 45206
  PID    TID COMM             TDNAME           KSTACK                       
45206 100990 zpool            initial thread   mi_switch+0x21d sleepq_switch+0x123 sleepq_wait+0x4d __lockmgr_args+0x793 vop_stdlock+0x39 VOP_LOCK1_APV+0x9b _vn_lock+0x47 vflush+0x200 zfs_umount+0x9f dounmount+0x2dc unmount+0x28e syscallenter+0x1aa syscall+0x4c Xfast_syscall+0xdd

On my system "mdconfig -o force" normal work but.. after "zpool destoy <pool>" have freeze

micro[11:36:48]> sysctl vfs.zfs. | grep version
vfs.zfs.version.zpl: 5
vfs.zfs.version.spa: 28
vfs.zfs.version.acl: 1

Vb have zfsv28 too.
##########################
>How-To-Repeat:
testbsd# mdconfig -a -t malloc -s 100M 
md0
testbsd# mdconfig -a -t malloc -s 100M
md1
testbsd# zpool create testpools md0 md1
testbsd# dd if=/dev/random of=/testpools/myfile.dat bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes transferred in 9.230674 secs (11359690 bytes/sec)
testbsd# mdconfig -d -u 0 -o force
if all right try "zpool destoy <pool>"

>Fix:
Sorry i don't know.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun May 29 23:37:56 UTC 2011 
Responsible-Changed-Why:  
reclassify. 

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

From: "Vladislav V. Prodan" <universite@ukr.net>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/157399: [zfs] trouble with: mdconfig force delete && zfs
 stripe
Date: Mon, 30 May 2011 14:28:38 +0300

 Error occurs in 8.2-CURRENT, ZFS v15
 
 [3:27]vm1:root->/root# mdconfig -a -t malloc -s 100M
 md0
 [3:28]vm1:root->/root# mdconfig -a -t malloc -s 100M
 md1
 [3:28]vm1:root->/root# zpool create testpools md0 md1
 [3:28]vm1:root->/root# dd if=/dev/random of=/testpools/myfile.dat bs=1M 
 count=100
 100+0 records in
 100+0 records out
 104857600 bytes transferred in 1.610346 secs (65114947 bytes/sec)
 [3:28]vm1:root->/root# mdconfig -d -u 0 -o force
 [3:28]vm1:root->/root# zpool status
    pool: tank
   state: ONLINE
   scrub: none requested
 config:
 
          NAME             STATE     READ WRITE CKSUM
          tank             ONLINE       0     0     0
            gpt/disk-ada0  ONLINE       0     0     0
 
 errors: No known data errors
 
    pool: test-tank
   state: ONLINE
   scrub: none requested
 config:
 
          NAME           STATE     READ WRITE CKSUM
          test-tank      ONLINE       0     0     0
            raidz2       ONLINE       0     0     0
              gpt/disk0  ONLINE       0     0     0
              gpt/disk1  ONLINE       0     0     0
              gpt/disk2  ONLINE       0     0     0
              gpt/disk3  ONLINE       0     0     0
              gpt/disk4  ONLINE       0     0     0
              gpt/disk5  ONLINE       0     0     0
 
 errors: No known data errors
 
    pool: testpools
   state: ONLINE
   scrub: none requested
 config:
 
          NAME        STATE     READ WRITE CKSUM
          testpools   ONLINE       0     0     0
            md0       ONLINE       0     0     0
            md1       ONLINE       0     0     0
 
 errors: No known data errors
 [3:29]vm1:root->/root# mdconfig -d -u 0 -o force
 mdconfig: ioctl(/dev/mdctl): No such file or directory
 [3:29]vm1:root->/root# mdconfig -d -u 0 -o force
 mdconfig: ioctl(/dev/mdctl): No such file or directory
 [3:29]vm1:root->/root# mdconfig -d -u 1 -o force
 [3:29]vm1:root->/root# zpool status
    pool: tank
   state: ONLINE
   scrub: none requested
 config:
 
          NAME             STATE     READ WRITE CKSUM
          tank             ONLINE       0     0     0
            gpt/disk-ada0  ONLINE       0     0     0
 
 errors: No known data errors
 
    pool: test-tank
   state: ONLINE
   scrub: none requested
 config:
 
          NAME           STATE     READ WRITE CKSUM
          test-tank      ONLINE       0     0     0
            raidz2       ONLINE       0     0     0
              gpt/disk0  ONLINE       0     0     0
              gpt/disk1  ONLINE       0     0     0
              gpt/disk2  ONLINE       0     0     0
              gpt/disk3  ONLINE       0     0     0
              gpt/disk4  ONLINE       0     0     0
              gpt/disk5  ONLINE       0     0     0
 
 errors: No known data errors
 
    pool: testpools
   state: UNAVAIL
   scrub: none requested
 config:
 
          NAME        STATE     READ WRITE CKSUM
          testpools   UNAVAIL      0     0     0  insufficient replicas
            md0       REMOVED      0     0     0
            md1       ONLINE       0     0     0
 
 errors: No known data errors
 [3:29]vm1:root->/root# mdconfig -d -u 1 -o force
 mdconfig: ioctl(/dev/mdctl): No such file or directory
 
 not responding...
 
 
 After hard reboot:
 
 [3:34]vm1:root->/root# uname -a
 FreeBSD vm1.local 8.2-STABLE FreeBSD 8.2-STABLE #0: Fri May 27 02:30:57 
 EEST 2011     root@vm1.local:/usr/obj/usr/src/sys/virtualbox.2  amd64
 [3:34]vm1:root->/root# zpool status
    pool: tank
   state: ONLINE
   scrub: none requested
 config:
 
          NAME             STATE     READ WRITE CKSUM
          tank             ONLINE       0     0     0
            gpt/disk-ada0  ONLINE       0     0     0
 
 errors: No known data errors
 
    pool: test-tank
   state: ONLINE
   scrub: none requested
 config:
 
          NAME           STATE     READ WRITE CKSUM
          test-tank      ONLINE       0     0     0
            raidz2       ONLINE       0     0     0
              gpt/disk0  ONLINE       0     0     0
              gpt/disk1  ONLINE       0     0     0
              gpt/disk2  ONLINE       0     0     0
              gpt/disk3  ONLINE       0     0     0
              gpt/disk4  ONLINE       0     0     0
              gpt/disk5  ONLINE       0     0     0
 
 errors: No known data errors
 
    pool: testpools
   state: UNAVAIL
 status: One or more devices could not be opened.  There are insufficient
          replicas for the pool to continue functioning.
 action: Attach the missing device and online it using 'zpool online'.
     see: http://www.sun.com/msg/ZFS-8000-3C
   scrub: none requested
 config:
 
          NAME        STATE     READ WRITE CKSUM
          testpools   UNAVAIL      0     0     0  insufficient replicas
            md0       UNAVAIL      0     0     0  cannot open
            md1       UNAVAIL      0     0     0  cannot open
 
 
 
 
 -- 
 Vladislav V. Prodan
 VVP24-UANIC
 +380[67]4584408
 +380[99]4060508
 vlad11@jabber.ru
>Unformatted:
