Make ZFSPathInvalidException take a path like its siblings
The class took only a message while every other path exception in the
file takes the path first. It now takes the path and an optional reason
and builds the message from both, so callers keep using e.message and
no longer repeat the path in their own text. Both raise sites pass the
path and a short reason.
pool.snapshot.create now catches it and raises a ValidationError instead
of leaking the raw exception when every dataset is excluded.
NAS-143800 / 26.0.0-RC.1 / Decouple snapshot versions from S3 versions (by anodos325) (#19751)
Recent changes in licensing setup made it so that the versions field
requires license in order to be modified. This commit decouples
ZFS-snapshot based versioning from the S3 protocol versioning feature so
that community / non-licensed S3 consumers can still choose to surface
previous versions of objects that are contained in ZFS snapshots to S3
clients.
Original PR: https://github.com/truenas/middleware/pull/19748
Co-authored-by: Andrew Walker <andrew.walker at truenas.com>
NAS-143800 / 26.0.0 / Decouple snapshot versions from S3 versions (by anodos325) (#19750)
Recent changes in licensing setup made it so that the versions field
requires license in order to be modified. This commit decouples
ZFS-snapshot based versioning from the S3 protocol versioning feature so
that community / non-licensed S3 consumers can still choose to surface
previous versions of objects that are contained in ZFS snapshots to S3
clients.
Original PR: https://github.com/truenas/middleware/pull/19748
Co-authored-by: Andrew Walker <andrew.walker at truenas.com>
[Clang] Reject overflow behavior types on _Atomic (#222179)
atomic read-modify-write operations aren't instrumented for overflow. `counter++` on an `_Atomic` object lowers to a single `atomicrmw`, and this is true for plain atomic types under `-fsanitize=signed-integer-overflow` too.
That's a problem for `__ob_trap`, which is supposed to be checked no matter what the global flags say:
```c
typedef int __ob_trap trapping_int;
_Atomic trapping_int counter;
int x = counter + 1; // checked
counter++; // not checked
```
A guarantee that only holds for some expressions is worse than none, so reject the combination outriht. Let's also reject `__ob_wrap` too so the rule doesn't depend on the behavior kind... wrap has minimal use here anyways.
Applying an OBT specifier over an atomic type was already an error, though it unhelpfully reported `_Atomic(int)` as a non-integer type even though it is. Applying `_Atomic` over an existing OBT was accepted, which is where the unchecked read-modify-write came from... this was a bug that is now fixed because we are no longer trying to apply OBT on top of `_Atomic`. This is all made more clear by better diagnostics too :)
We can relax this later if someone needs it. I think instrumenting checked atomic rmws would mean lowering to a cmpxchg/CAS loop.
Assisted-by: claude
Signed-off-by: Justin Stitt <justinstitt at google.com>
NAS-143800 / 27.0.0-BETA.1 / Decouple snapshot versions from S3 versions (#19748)
Recent changes in licensing setup made it so that the versions field
requires license in order to be modified. This commit decouples
ZFS-snapshot based versioning from the S3 protocol versioning feature so
that community / non-licensed S3 consumers can still choose to surface
previous versions of objects that are contained in ZFS snapshots to S3
clients.
[Clang][ABI] Classify floating-point matrix types as homogeneous aggregates (#222429)
The `ABIInfo::isHomogeneousAggregate()` function did not have explicit
handling for `ConstantMatrixType` and so, by default, these types were
rejected as potential homogeneous aggregates.
This change adds handling for `ConstantMatrixType` and classifies such
matrix types depending on whether they otherwise meet the criteria.
Fixes: https://github.com/llvm/llvm-project/issues/222417
Assisted-by: Cursor / Grok 4.6
Reland "[AMDGPU] PromoteAlloca: flatten homogeneous structs to vectors" (#221058)
This relands #217055
The original commit revealed a latent issue in eliminateFrameIndex in
SIRegisterInfo where SCC can be clobbered before reading it on
gfx900/gfx90a. This change itself has no known issues.
[CIR][CodeGen] Implement target-features checking(CodeGenUtils!) (#223056)
This DOES move checking functions out of CodeGen and into CodeGenUtils
so both can use it.
This is a diagnostic for builtins/etc that is built in to classic
codegen. We have to implement it, because otherwise autoconfig thinks
that we support AVX without a flag, and thus causes us to fail builds
later on that now expect __AVX__/etc to be defined without enabling
them.
[mlir][emitc] Add a ConvertToEmitCPatternInterface for the math dialect (#223666)
MathToEmitC wasn't registered for `--convert-to-emitc`. This registers
an interface matching the other *ToEmitC interfaces.
NAS-143799 / 26.0.0 / Catch `ZFSPathInvalidException` (by themylogin) (#19749)
`create_snapshots_impl` raises an uncaught `ZFSPathInvalidException`
when exclude removes every candidate dataset.
Original PR: https://github.com/truenas/middleware/pull/19744
---------
Co-authored-by: themylogin <themylogin at gmail.com>
Co-authored-by: Caleb St. John <30729806+yocalebo at users.noreply.github.com>
[KnownFPClass] Add sign preserving deductions to `atan2(y, x)` (#223176)
`atan2(y, x)` should return the same sign as `y` (up to the denormal
mode):
- If `y >= +0.0`, then `atan2(y, x) >= +0.0`
- If `y <= -0.0`, then `atan2(y, x) <= -0.0`
AI Disclosure:
I used ChatGPT Codex (5.6 sol) to help write the tests.
[KnownFPClass] Propagate non-`sNaN` for `fadd`/`fsub`, `fmul`, `fdiv`, and `fma` (#221876)
`fadd`, `fsub`, `fmul`, `fdiv`, and `fma` can only return `sNaN` if at
least one of their inputs are `sNaN`. This means that we can rule out
`sNaN` from the result if all of the arguments are known to never be
`sNaN`.
`sNaN` propagation for `frem` is handled in this PR:
https://github.com/llvm/llvm-project/pull/219303
[flang][test][NFC] Add OpenMP test for mismatched loop bound types (#221097)
Adds a regression test that lowering succeeds when an OpenMP loop mixes
bound types: the loop trip count comes from an integer(kind=INT64)
module
variable while the lower bound and step are i32 literals, so both are
converted to i64 before being passed through host_eval.
[AMDGPU] Prevent SCC clobber in frame index lowering in scaling path
eliminateFrameIndex has two lowering strategies, but only one has the proper handling for checking SCC-liveness to prevent clobbering. Unify them with a helper function to ensure both paths handle the same
NAS-143402 / 27.0.0-BETA.1 / Stricter user SSH public key validation to match OpenSSH behavior (by themylogin) (#19726)
sshd opens the `authorized_keys` file as the user itself, so every
directory leading to the home directory has to
be traversable by the account.
On top of that `StrictModes` makes sshd refuse to use the file when the
home directory is world-writable or is
owned neither by the user nor by root.
A public key that is stored under any of those conditions silently never
authenticates anyone, so it should be rejected up front.
Original PR: https://github.com/truenas/middleware/pull/19652
Co-authored-by: themylogin <themylogin at gmail.com>
[NVPTX] Honor !atomic.ignore.denormal.mode on atomicrmw fadd
PTX atom.add has a fixed denormal behavior that the program cannot
control: atom.add.f32 flushes denormals on global memory but not on
shared, and atom.add.f16 never flushes. When that disagrees with the
function's denormal mode, the backend expands the atomic into a CAS loop
so the denormal behavior is preserved.
!atomic.ignore.denormal.mode says the denormal behavior of this
particular atomic does not matter, so use the native instruction even
when it disagrees. This is the same thing -nvptx-allow-ftz-atomics does,
except per-instruction instead of per-compilation, which lets a frontend
opt in only the operations it knows about -- notably CUDA's atomicAdd(),
which is defined in terms of atom.add.
Note that -nvptx-allow-ftz-atomics defaults to true, so the new behavior
is only observable with -nvptx-allow-ftz-atomics=false.
Co-authored-by: Artem Belevich <tra at google.com>
[clang][NVPTX] Emit !atomic.ignore.denormal.mode for CUDA atomics
CUDA's atomicAdd() family is defined in terms of PTX atom.add, whose
denormal behavior is fixed by the hardware. Without any annotation the
backend has to assume the function's denormal mode must be honored and
expands these into CAS loops whenever the two disagree. Mark them with
!atomic.ignore.denormal.mode so the native instruction is used.
That covers the __nvvm_atom_*_add_gen_f builtins that atomicAdd(),
atomicAdd_block() and atomicAdd_system() are written in terms of, plus
C11/C++11 atomics under -fatomic-ignore-denormal-mode and the
[[clang::atomic(ignore_denormal_mode)]] attribute, which requires
teaching the NVPTX target about AtomicOptions.
The condition for when the metadata is meaningful is now shared with the
AMDGPU and SPIR-V targets in addAtomicIgnoreDenormalModeMetadata(). It
takes an AllowHalf flag because whether f16 denormals are observable is
target specific: PTX exposes no FTZ control for f16 operations, so
atom.add.f16 never flushes and the opt-in is meaningful there, whereas
[3 lines not shown]
[Flang] Keep -fkeep-inline-functions as an ignored option (#223733)
55221f7 removed the warning check for -fkeep-inline-functions and
-fno-keep-inline-functions from flang-f-opts.f90 after the test started
failing when the option was implemented for Clang in 28efe19.
The options are currently only supported by Clang, so keep
-fkeep-inline-functions and -fno-keep-inline-functions as unsupported
options for Flang and emit the appropriate warnings.
[IR] Generalize !amdgpu.ignore.denormal.mode into !atomic.ignore.denormal.mode (#217585)
The !amdgpu.ignore.denormal.mode metadata tells the backend that an
atomicrmw fadd need not honor the function's denormal mode, so a native
atomic instruction whose denormal behavior is fixed in hardware may be
used instead of a CAS loop. Nothing about that is AMDGPU specific: NVPTX
has exactly the same problem with atom.add, whose FTZ behavior depends
on
the address space and cannot be controlled.
Promote it to a target independent fixed metadata kind,
!atomic.ignore.denormal.mode, and switch the AMDGPU, SPIR-V and OpenMP
producers and consumers over to it. Document it in LangRef, and point
AMDGPUUsage at that description rather than duplicating it.
Existing IR keeps working: AutoUpgrade renames the metadata on atomicrmw
instructions when parsing textual IR and when materializing bitcode. The
upgrade is deliberately scoped to atomicrmw rather than being applied to
every attachment of that name, since that is the only place the metadata
[7 lines not shown]
NAS-143799 / 27.0.0-BETA.1 / Catch `ZFSPathInvalidException` (#19744)
`create_snapshots_impl` raises an uncaught `ZFSPathInvalidException`
when exclude removes every candidate dataset.
---------
Co-authored-by: Caleb St. John <30729806+yocalebo at users.noreply.github.com>