Fix snapshot automount deadlock during concurrent zfs recv
zfsctl_snapshot_mount() holds z_teardown_lock(R) across
call_usermodehelper(), which spawns a mount process that needs
namespace_sem(W) via move_mount. Reading /proc/self/mountinfo holds
namespace_sem(R) and needs z_teardown_lock(R) via zpl_show_devname.
When zfs_suspend_fs (from zfs recv or zfs rollback) queues
z_teardown_lock(W), the rrwlock blocks new readers, completing the
deadlock cycle.
Fix by releasing z_teardown_lock(R) after gathering the dataset name
and mount path, before any blocking operation. Everything after the
release operates on local string copies or uses its own
synchronization. The parent zfsvfs pointer remains valid because the
caller holds a path reference to the automount trigger dentry.
Releasing the lock allows zfs_suspend_fs to proceed concurrently
with the mount helper, so dmu_objset_hold in zpl_get_tree can
transiently fail with ENOENT during the clone swap. The mount
[8 lines not shown]
Fix options memory leak in zfsctl_snapshot_mount
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Ameer Hamza <ahamza at ixsystems.com>
Closes #18415
[AMDGPU] Emit s_barrier_signal for s.barrier.signal.var when able (#191028)
When the member count is 0 (which causes the barrier's member count to
be re-used from a previous barrier initialization or
s.barrier.signal.var) and the barrier is constant, we can represent
named barrier signaling with the m0-less form. Enable this behavior.
Assisted by Opus 4.6 which drafted the initial implementation.
[mlir][XeGPUToXeVM][XeVMToLLVM] Update the default cache-control values. (#190954)
In XeGPU, user can provide cache control value for only certain levels,
they do not have to provide cache-control value for all levels. However,
XeVM requires that each cache level must have a cache-control value. To
solve this issue, XeGPUToXeVM conversion pass adds default value to
cache-levels that does not have a user-provided cache-control value.
This PR updates this process in the following way:
- If no cache-control hint is provided for any levels, use system
default (USE_DEFAULT).
- If any of the levels has at least one cache-control value, use certain
default value for other levels.
If system default (USE_DEFAULT) is used, no cache-control metadata
annotation is necessary.
net/ucx: Fix mm signal socket binding on FreeBSD
Replace Linux-style UNIX domain socket autobind logic in the mm
signaling path with explicit pathname-based binding on FreeBSD and
remove the socket path during cleanup.
This fixes FreeBSD runtime failures in the mm shared-memory signaling
path.
PR: 293867
Sponsored by: UNIS Labs
MFH: 2026Q2
(cherry picked from commit db6d744b60348636c7a87c3c7fc181afd9b71994)
net/ucx: Fix FreeBSD UCM relocation handling
On FreeBSD, dynamic-section pointers observed through dl_iterate_phdr()
for shared objects need to be rebased by dlpi_addr before dereference.
Also fix the PT_LOAD end range calculation to include the object base
address when tracking the library address span.
This fixes runtime failures in UCM relocation patching on FreeBSD.
PR: 293867
Sponsored by: UNIS Labs
MFH: 2026Q2
(cherry picked from commit 94fc6d9ffebbad5014a7f48ba925b9a39df8478f)
net/ucx: Harden async thread state handling
Avoid dereferencing the global async thread context when startup or
teardown did not complete successfully by returning UCS_ERR_NO_ELEM for
operations that require an active thread and by only publishing thread_p
on successful start.
This prevents invalid access paths during async thread error handling.
PR: 293867
Sponsored by: UNIS Labs
MFH: 2026Q2
(cherry picked from commit 1ef58f980f422e30804818df7dadd3c1da3dace0)
net/ucx: Fix FreeBSD runtime portability issues
Adjust several Linux-specific runtime assumptions in UCX for FreeBSD:
- use FreeBSD-specific network interface handling where Linux sysfs logic
is not available
- avoid Linux-only IPOIB and bridge detection paths
- improve pthread_create() error reporting
- provide FreeBSD fallbacks for memory remapping and affinity helpers
This fixes multiple runtime failures and device discovery issues on FreeBSD.
PR: 293867
Sponsored by: UNIS Labs
MFH: 2026Q2
(cherry picked from commit 601e614318cdfbb381bcb7a9841353720feb53a9)
[libc] Remove yet another batch of header template files (#191067)
This follows up on ae63230c23151c16ba68d5213da8bd5459c03a40 and remove
header templates from more C/POSIX standard headers, where templates
only used to `#include` files with macro definitions. We add this logic
to YAML instead - add entries to the `macros` list that point to the
correct `macro_header` to ensure it would be included.