[Bug 248286] ZFS deadlock when rename the volumes

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Jul 27 00:00:12 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248286

            Bug ID: 248286
           Summary: ZFS deadlock when rename the volumes
           Product: Base System
           Version: 12.1-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs at FreeBSD.org
          Reporter: fbsd-bugzilla at aj.admwt.jp

I use bhyve very heavily, and when I ran zfs rename to clean up the VM's disk
image (ZFS Volume), the ZFS deadlocked inside the kernel. The procedure to
recreate it is as follows.

==========================
$ gpart add -s 20g -t freebsd-zfs -a 4k -l zdead1 ada0
ada0p9 added

$ zpool create -O compression=lz4 -m none zbad ada0p9

$ zfs list -r zbad
NAME   USED  AVAIL  REFER  MOUNTPOINT
zbad   334K  18.9G    23K  none

$ xz -dc ~minmin/tmp/zfs/zfs-deadlock-volume.zfs.xz | zfs receive zbad/vm

$ zfs list -r zbad
NAME                USED  AVAIL  REFER  MOUNTPOINT
zbad               2.84G  16.1G    23K  none
zbad/vm            2.83G  16.1G    23K  none
zbad/vm/debian10    975M  16.1G   961M  -
zbad/vm/freebsd32   977M  16.1G   977M  -
zbad/vm/idmdeb10    947M  16.1G  1.55G  -

$ zfs create zbad/vmn

$ zfs list -r zbad
NAME                USED  AVAIL  REFER  MOUNTPOINT
zbad               2.84G  16.1G    23K  none
zbad/vm            2.83G  16.1G    23K  none
zbad/vm/debian10    975M  16.1G   961M  -
zbad/vm/freebsd32   977M  16.1G   977M  -
zbad/vm/idmdeb10    947M  16.1G  1.55G  -
zbad/vmn             23K  16.1G    23K  none

$ cat /var/tmp/zfs/deadlock
pool=zbad
zfs rename ${pool}/vm/idmdeb10  ${pool}/vmn/idmdeb10
zfs rename ${pool}/vm/freebsd32 ${pool}/vmn/freebsd32

$ sh -x /var/tmp/zfs/deadlock
+ pool=zbad
+ zfs rename zbad/vm/idmdeb10 zbad/vmn/idmdeb10
+ zfs rename zbad/vm/freebsd32 zbad/vmn/freebsd32
==========================

The second rename operation is not finished.

When sleep is placed between rename operations, deadlock does not occur and the
operation ends normally.

"debian10" and "freebsd32" are bhyve disk images and "idmdeb10" is a ZFS volume
cloned from "debian10".

I ran the same test on multiple systems and all of them had deadlocks.

If you need it for the replication test, I can provide you with the
"zfs-deadlock-volume.zfs.xz" image (about 1.5GB) that I used for the test.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list