Re: Deadlock in ZFS @ FreeBSD 15.0-RELEASE-p3 handling of extended attributes?
Rick Macklem <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.file-systems |
|---|---|
| Message-ID | <CAM5tNy7+u6G_9c+G2n8TG8Ky1S7yUkbdD2rSdn-n1yXeBuMNcg@mail.gmail.com> |
On Sun, Feb 15, 2026 at 10:51 AM Peter Eriksson <[email protected]> wrote: > > I would have entered this into the freebsd bugzilla, but that seems to be down right now… It might be better to report this to OpenZFS. See below.. > > Anyway, I’m trying to copy some 30000 ZFS filesystems (home directories) on a new server running FreeBSD 15.0-RELEASE-p3. The server has 10 15TB NVMEe SSD drives configured as mirrors in one big Zpool. The copy is basically a loop over the 30000 directories and the doing a zfs create … ; tar cpf - | (cd /new/home; tar xpf -) > > The first 495 directories copied without problem, but now it seems the bsdtar process writing to the new home directory has deadlocked in: > > > # procstat -kka|egrep bsdtar > > 63997 103752 bsdtar - mi_switch+0xbc sleepq_catch_signals+0x27d sleepq_wait_sig+0x9 _sleep+0x197 uipc_sosend_stream_or_seqpacket+0x475 sousrsend+0x5f dofilewrite+0x81 sys_write+0x127 amd64_syscall+0x126 fast_syscall_common+0xf8 > > 63998 290883 bsdtar - mi_switch+0xbc _sleep+0x19e rms_rlock_fallback+0x90 zfs_lookup+0x74 zfs_deleteextattr_dir+0x38 zfs_setextattr+0x7dc VOP_SETEXTATTR_APV+0x24 extattr_set_vp+0x11d kern_extattr_set_path+0x14e sys_extattr_set_link+0x6b amd64_syscall+0x126 fast_syscall_common+0xf8 > > I’m guessing some kind of problem with the handling of extended attributes… I think the hang has occurred because zfs_enter() has done a ZFS_TEARDOWN_ENTER_READ(), which tries to acquire a read lock on z_teardown_lock. Since this hangs, it suggests that something else is holding a write lock on z_teardown_lock. Looking at the code, I think a call to zfs_suspend_fs() might be what did this. But, that is as far as my limited ZFS knowledge (almost none) goes, so I don't know when/why zfs_suspend_fs() gets called. You could try setting xattr=dir and see if that works better, but that would just be a workaround if it does work better. I've cc'd a couple of people that might know when zfs_suspend_fs() gets called or if there are other/better explanations for this hang? rick > > I created the home directory root like this: > > #!/bin/sh > > PROPS="\ > -o atime=off \ > -o relatime=on \ > -o dnodesize=auto \ > -o compression=zstd \ > -o utf8only=on \ > -o normalization=formC \ > -o xattr=sa \ > -o overlay=off \ > -o aclmode=passthrough \ > -o aclinherit=passthrough-x \ > -o sharenfs=sec=krb5:krb5i:krb5p" > > for ZFS in "$@"; do > zfs create $PROPS "$ZFS" > done > > > - Peter