Personal tools
You are here: Home Issue tracker Hang while importing a pool with cache devices

#3 — Hang while importing a pool with cache devices

State Resolved
Version: 0.6.0
Area Functionality
Issue type Bug
Severity Important
Submitted by (anonymous)
Submitted on Nov 07, 2009
Responsible Rudd-O
Target release:
Return to tracker
Last modified on May 22, 2010 by Seth Heeren
Trying to import a zpool which has cache devices fails with 'zpool import' hanging indefinitely:

vm:~# zpool create -f vmstg mirror sdb3 sdc3 cache sda
vm:~# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
vmstg 1.33T 81K 1.33T 0% ONLINE -
vm:~# zpool export vmstg
vm:~# zpool import vmstg
^Z
[1]+ Stopped zpool import vmstg
vm:~# bg
[1]+ zpool import vmstg &
vm:~# gdb -p 16200
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Attaching to process 16200

warning: process 16200 is a cloned process
Reading symbols from /usr/sbin/zfs-fuse...done.
Reading symbols from /lib/librt.so.1...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libpthread.so.0...done.
[Thread debugging using libthread_db enabled]
[New Thread 0x2ab664eaad10 (LWP 16178)]
<plenty of other New Thread lines removed>
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /usr/lib/libfuse.so.2...done.
Loaded symbols for /usr/lib/libfuse.so.2
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /lib/libaio.so.1...done.
Loaded symbols for /lib/libaio.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
0x00002ab6640f2d29 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
(gdb) bt
#0 0x00002ab6640f2d29 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1 0x0000000000499851 in cv_wait (cv=0x2aaaace81a98, mp=0x2aaaace81a68) at lib/libsolkerncompat/condvar.c:59
#2 0x000000000047cc63 in zio_wait (zio=0x2aaaace817b0) at lib/libzpool/zio.c:1074
#3 0x00000000004669f8 in vdev_uberblock_load (zio=0x2aaaace817b0, vd=0x2aaaacfe0800, ubbest=0x2ab663d46410) at lib/libzpool/vdev_label.c:806
#4 0x0000000000457f90 in spa_load (spa=0x2ab663d46000, config=<value optimized out>, state=SPA_LOAD_TRYIMPORT, mosconfig=1) at lib/libzpool/spa.c:1269
#5 0x0000000000458923 in spa_tryimport (tryconfig=0x2aaaad634b80) at lib/libzpool/spa.c:2721
#6 0x000000000040cbb4 in zfs_ioc_pool_tryimport (zc=0x2aaaacd45000) at zfs-fuse/zfs_ioctl.c:1091
#7 0x000000000040d0ba in zfsdev_ioctl (dev=<value optimized out>, cmd=<value optimized out>, arg=140737090838656, flag=<value optimized out>, cr=0x0,
    rvalp=<value optimized out>) at zfs-fuse/zfs_ioctl.c:3656
#8 0x0000000000404a06 in listener_loop (arg=<value optimized out>) at zfs-fuse/cmd_listener.c:49
#9 0x00002ab6640eefc7 in start_thread () from /lib/libpthread.so.0
#10 0x00002ab664c265ad in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()
(gdb) detach
Detaching from program: /usr/sbin/zfs-fuse, process 16200
(gdb) q
vm:~# fg
zpool import vmstg
^C
Steps to reproduce:
1. Create a zpool
2. Attach a cache device to it (can also be done during pool creation, doesn't really matter when the cache device is added)
3. Export the pool
4. Try to import the pool - 'zpool import' will hang here
Added by Rudd-O on Nov 20, 2009 05:03 PM
A similar problem was present in OpenSolaris too, fixed in later builds. Let's see if Emmanuel's work comes to fruition and fixes this issue.
Added by (anonymous) on Nov 21, 2009 07:50 AM
can you provide "lsof|grep zpool" ?
Added by Emmanuel Anne on Dec 10, 2009 07:44 AM
Could not reproduce it using my master branch :
athlon64:/mnt/home/dd# zpool create -f vmstg mirror /dev/sda9 /dev/sda10 cache /dev/sda4
athlon64:/mnt/home/dd# ls /vmstg/
athlon64:/mnt/home/dd# zpool export vmstg
athlon64:/mnt/home/dd# zpool import vmstg
no problem

http://rainemu.swishparty.co.uk/[…]/gitweb.cgi?p=zfs;a=summary
Added by Seth Heeren on Jan 04, 2010 04:09 PM
Severity: MediumImportant
Responsible manager: (UNASSIGNED)RuddO
I'm pretty sure this is the same as issue #13 (http://zfs-fuse.net/issues/13)

Can you have a look? The details explain why it is no longer an issue in later versions from Emmanuel, but it _is_ in release 0.6.0

Propose to vote for bug 13 because it describes what needs to be fixed
Added by Seth Heeren on Jan 25, 2010 06:17 PM
Target release: None0.6.1
please retest with

# git clone http://git.zfs-fuse.net/official
# cd official/
# git checkout origin/critical
Added by Seth Heeren on May 22, 2010 01:49 PM
Issue state: unconfirmedresolved
closing due to inactivity