mirror_zfs/module/os/freebsd/zfs
Mark Johnston ded851b2e0
Fix several bugs in the FreeBSD rename VOP implementation
- To avoid a use-after-free, zfsvfs->z_log needs to be loaded after the
  teardown lock is acquired with ZFS_ENTER().
- Avoid leaking vnode locks in zfs_rename_relock() and zfs_rename_()
  when the ZFS_ENTER() macros forces an early return.

Refactor the rename implementation so that ZFS_ENTER() can be used
safely.  As a bonus, this lets us use the ZFS_VERIFY_ZP() macro instead
of open-coding its implementation.

Reported-by: Peter Holm <pho@FreeBSD.org>
Tested-by: Peter Holm <pho@FreeBSD.org>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Sponsored-by: The FreeBSD Foundation
Closes #12717
2021-11-19 15:26:39 -07:00
..
abd_os.c Really zero the zero page 2021-09-17 10:17:18 -07:00
arc_os.c Remove b_pabd/b_rabd allocation from arc_hdr_alloc() 2021-08-17 10:15:54 -06:00
crypto_os.c FreeBSD: Retry OCF ENOMEM errors. 2021-05-24 14:42:45 -06:00
dmu_os.c Remove FreeBSD's local copy of the dmu_buf_hold_array() function 2021-10-13 11:01:01 -07:00
hkdf.c Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
kmod_core.c zfs: add missed dependency of zfs module on zlib 2021-08-13 13:42:45 -07:00
spa_os.c FreeBSD: Clean up ASSERT/VERIFY use in module 2021-04-30 16:36:10 -07:00
sysctl_os.c Restore FreeBSD sysctl processing for arc.min and arc.max 2021-08-16 09:35:19 -06:00
vdev_file.c FreeBSD: Clean up ASSERT/VERIFY use in module 2021-04-30 16:36:10 -07:00
vdev_geom.c Update checkstyle workflow env to ubuntu-20.04 2021-11-02 14:02:57 -06:00
vdev_label_os.c FreeBSD: Clean up ASSERT/VERIFY use in module 2021-04-30 16:36:10 -07:00
zfs_acl.c Use fallthrough macro 2021-09-14 10:17:54 -06:00
zfs_ctldir.c Prune /*NOTREACHED*/ 2021-07-26 12:07:26 -07:00
zfs_debug.c Annotated dprintf as printf-like 2021-06-22 21:53:45 -07:00
zfs_dir.c Clean up use of zfs_log_create in zfs_dir 2021-05-07 15:13:10 -07:00
zfs_file_os.c FreeBSD: Catch up with recent VFS changes 2021-10-25 09:46:28 -07:00
zfs_ioctl_compat.c FreeBSD: Fix legacy compat for platform IOCs 2020-09-30 13:25:50 -07:00
zfs_ioctl_os.c libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat 2021-06-08 07:36:43 -06:00
zfs_racct.c Restore FreeBSD resource usage accounting 2021-02-19 22:34:33 -08:00
zfs_vfsops.c Annotated dprintf as printf-like 2021-06-22 21:53:45 -07:00
zfs_vnops_os.c Fix several bugs in the FreeBSD rename VOP implementation 2021-11-19 15:26:39 -07:00
zfs_znode.c FreeBSD: Implement hole-punching support 2021-08-30 13:33:30 -07:00
zio_crypt.c Remove NOTE(CONSTCOND) and note.h 2021-07-26 12:07:53 -07:00
zvol_os.c FreeBSD: Ignore make_dev_s() errors 2021-07-22 10:22:14 -06:00