mirror_zfs/module
rmacklem 1412bdc6c2
zfs_vnops_os.c: Move a vput() to after zfs_setattr_dir()
Without this patch, the following crash can occur when
a file system is configured with "xattr=dir".

VNASSERT failed: locked not true at
 /posix-acl/freebsd-rdma/sys/kern/vfs_subr.c:5786 (assert_vop_locked)
    hold count flags ()
    flags ()
    lock type zfs: UNLOCKED
panic: zfs_dirent_lookup: vnode is not locked but should be
cpuid = 3
time = 1770520763
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b
vpanic() at vpanic+0x136/frame 0xfffffe00914c8270
panic() at panic+0x43/frame 0xfffffe00914c82d0
assert_vop_locked() at assert_vop_locked+0x78
zfs_dirent_lookup() at zfs_dirent_lookup+0x41
zfs_setattr_dir() at zfs_setattr_dir+0x123
zfs_setattr() at zfs_setattr+0x1389
zfs_freebsd_setattr() at zfs_freebsd_setattr+0x56b
VOP_SETATTR_APV() at VOP_SETATTR_APV+0x5d
setfown() at setfown+0xb1
kern_fchownat() at kern_fchownat+0x192

This patch fixes the problem by moving the vput() call for
attrzp to after the zfs_setattr_dir() call that takes it as
an argument.

Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rick Macklem <rmacklem@uoguelph.ca>
Closes: #18188
2026-02-10 09:29:37 -05:00
..
avl Prefer VERIFY0P(n) over VERIFY(n == NULL) 2025-08-07 11:41:37 -07:00
icp icp: emit .note.GNU-stack section for all ELF targets 2026-01-08 09:21:12 -08:00
lua SPDX: license tags: MIT 2025-03-13 17:56:54 -07:00
nvpair nvpair: chase FreeBSD xdrproc_t definition 2026-01-28 21:41:33 -05:00
os zfs_vnops_os.c: Move a vput() to after zfs_setattr_dir() 2026-02-10 09:29:37 -05:00
zcommon Add snapshots_changed_nsecs dataset property 2026-01-06 09:36:20 -08:00
zfs Allow rewrite skip cloned and snapshotted blocks 2026-02-09 10:17:56 -08:00
zstd Zstd: Document update policy 2026-01-20 13:41:24 -08:00
.gitignore FreeBSD: Ignore symlink to i386 includes 2022-08-02 16:34:23 -07:00
Kbuild.in Zstd: Integrate v1.5.7 into the ZFS build system 2026-01-20 13:41:06 -08:00
Makefile.bsd Zstd: Integrate v1.5.7 into the ZFS build system 2026-01-20 13:41:06 -08:00
Makefile.in Fix --enable-invariants on FreeBSD 2026-01-14 14:54:12 -08:00