ifnet: Fix decreasing the vnet interface count
It should be decreased only when the interface has been successfully
removed from the "active" list.
This prevents vnet_if_return() from potential OOB writes to the
allocated memory "pending".
Reviewed by: kp, pouria
Fixes: a779388f8bb3 if: Protect V_ifnet in vnet_if_return()
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D55873
[WebAssembly] Support acquire-release atomics in CodeGen (#184900)
Set the correct memory ordering for relaxed atomics after ISel. This
allows
SelectionDAG to keep the simple generic selection for target-independent
AtomicLoad nodes, but keeps the ordering immediate correct in the MIR.
Notably, the MachineMemOperand still has the original memory ordering
and MIR passes would use that rather than the ordering immedate to make
their code motion decisions (if we had any for Wasm, which we don't).
NAS-140308 / 27.0.0-BETA.1 / Fix typesafe conversion issues in container migration and cpuset validation (#18465)
## Context
Fix typesafe conversion issues introduced in the container plugin. The
NIC attach choices Pydantic model was being checked against dict keys
after model_dump() instead of the actual interface names, which caused
all NIC devices to be skipped during migration. Also fix the volatile
MAC address config lookup to use the device name rather than the parent
interface, and preserve CPU pinning settings when migrating legacy
containers. Additionally guard cpuset validation against underscores
which Python's int() silently accepts as numeric separators.
NAS-140314 / 27.0.0-BETA.1 / Fix statmount import in scripts (#18473)
This commit fixes imports of statmount in some standalone scripts that
are maintained in the middleware repo.
[RISCV] Fold waddau/wsubau to waddu/wsubu when possible (#186635)
If the wide input is zero extended and only one narrow input is
used, we can fold to waddu/wsubu.
NAS-140297 / 27.0.0-BETA.1 / Use truenas_os_pyutils (#18458)
Several functions that were originally provided by middlewared/utils
were moved to the truenas_os_pyutils module so that they can be cleanly
consumed by python modules outside of the middleware repository without
causing odd inter-dependencies. This commit finishes up the moves by
swapping out imports at call sites and removing redundant tests.
(cherry picked from commit 39cb18826fff67d7364ef49554944980cc85abfa)
[X86] Move getMaskNode to avoid unnecessary forward declarations. (#186815)
I've also improved the assertions on the source / bool mask types to
catch bad use cases.
Cleanup pre-work to allow the i512 codegen to eventually use getMaskNode
instead of manual bool mask creations
Apply upstream commit "Change file initialization to use INIT_GDB_FILE macro".
Tom Tromey on Thu, 26 Jun 2025, id 5fe70629ceafc157d896adec7799a8888d51dd6b
NAS-140297 / 27.0.0-BETA.1 / Use truenas_os_pyutils (#18458)
Several functions that were originally provided by middlewared/utils
were moved to the truenas_os_pyutils module so that they can be cleanly
consumed by python modules outside of the middleware repository without
causing odd inter-dependencies. This commit finishes up the moves by
swapping out imports at call sites and removing redundant tests.
NAS-140309 / 26.0.0-BETA.2 / Shift NFS protocol xattr and acl tests to sharing_protocols (by anodos325) (#18467)
This commit cleans up the tests slightly and moves them to the correct
portion of our testing framework.
Original PR: https://github.com/truenas/middleware/pull/18466
Co-authored-by: Andrew Walker <andrew.walker at truenas.com>
[MLIR][Presburger] Add support for Smith normal form (#185328)
FPL already has support for computing Hermite normal form for integer
matrices. Here we add support to computing Smith normal form.
This is a preparation for Barvinok's algorithm. Given a polyhedron $P =
\{ x | Ax + b = 0, Cx + d \leq 0 \}$, we must find a particular solution
$x_0$ of $Ax + b = 0$ in order to project lower-dimensional polyhedra
into full-dimensional ones. This requires the Smith normal form of the
integer matrix $A$.
The implementation here follows the algorithm in
[wikipedia](https://en.wikipedia.org/wiki/Smith_normal_form#Algorithm).