kern/175897: operations on readonly zpool hang

John Hein jhein at symmetricom.com
Wed Feb 6 20:10:01 UTC 2013


>Number:         175897
>Category:       kern
>Synopsis:       operations on readonly zpool hang
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 06 20:10:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     John Hein
>Release:        
>Organization:
>Environment:

recent 8-stable, 9-stable; noticed on both i386 & amd64


>Description:

On 9-stable & 8-stable, zfs/zpool operations hang when trying to work on a
readonly pool.  I've tried 'zfs set mountpoint' and 'zfs scrub' (the latter
accidentally during overnight run of periodic with
daily_scrub_zfs_enable=yes).

See also https://forums.freebsd.org/showthread.php?t=35505&highlight=readonly+zpool
which mentions a panic.  I didn't get a panic (yet).

Use case when this was noticed: replace old pool with new, setting the new
pool to have the old pool's mountpoint (to avoid changing all nfs clients).

I think zfs should refuse the operation if readonly is a problem.  What I really
wanted was for the data to be readonly, but not the zfs metadata (i.e.,
"_mostly_ readonly").  But I can see how disallowing metadata ops on a
readonly pool makes sense.


>How-To-Repeat:

cd /tmp
dd if=/dev/zero bs=1m count=100 > ! z0
dd if=/dev/zero bs=1m count=100 > ! z1
sudo mdconfig -f z0
sudo mdconfig -f z1
sudo zpool create -m /tmp/ztmp ztmp mirror /dev/md0 /dev/md1
sudo zpool export ztmp
sudo zpool import -o readonly=on ztmp
sudo zfs set mountpoint=/tmp/ztmpnew ztmp
 ... hangs here

In another window...

% ps -ww -ax -o pid,ppid,%cpu,%mem,vsz,rss,wchan,stat,lstart,time,command | egrep 'zfs|PID'
  PID  PPID %CPU %MEM    VSZ   RSS WCHAN    STAT STARTED                      TIME COMMAND
45377     0  0.0  0.0      0    32 l2arc_fe DL   Wed Feb  6 12:38:30 2013  0:00.01 [zfskern]
45674     1  0.0  0.3  44460  3256 select   I    Wed Feb  6 12:40:54 2013  0:00.01 sudo zfs set mountpoint=/tmp/z\
tmpnew ztmp
45687 45674  0.0  0.3  33488  3064 tx->tx_s D    Wed Feb  6 12:40:54 2013  0:00.00 zfs set mountpoint=/tmp/ztmpne\
w ztmp


% sudo procstat -k 45674 45687
  PID    TID COMM             TDNAME           KSTACK
45674 100106 sudo             -                mi_switch sleepq_catch_signals sleepq_wait_sig _cv_wait_sig seltdw\
ait kern_select sys_select amd64_syscall Xfast_syscall
45687 100098 zfs              -                mi_switch sleepq_wait _cv_wait txg_wait_synced dsl_sync_task_group\
_wait dsl_sync_task_do dsl_props_set zfs_set_prop_nvlist zfs_ioc_set_prop zfsdev_ioctl devfs_ioctl_f kern_ioctl s\
ys_ioctl amd64_syscall Xfast_syscall


>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list