[clang-format] Add anonymous namespace indentation option (#244933)
Add IndentAnonymousNamespaces to control whether clang-format indents
the contents of anonymous namespaces.
When disabled, anonymous namespaces do not add an indentation level,
while named namespaces continue to follow NamespaceIndentation.
Fixes #221584
---------
Signed-off-by: Arnab Sarkar <arnab at 28arnab.com>
[aarch64][win] Fix large-model stack probe unwind info (#247376)
Account for every instruction emitted by `MOVaddrEXT` when describing a
large-code-model `__chkstk` call. Set the page and page-offset
relocation modifiers so the generated assembly also assembles. Cover
direct object emission and the assembly round trip.
Assisted-by: GPT-6.2 Sol
[aarch64][win] Describe x15 preservation around stack probes (#247378)
Preserving a live x15 around `__chkstk` emits two instructions that do
not change the unwind state. Add a `.seh_nop` for each so the prologue
length matches its unwind recipe.
Assisted-by: GPT-6.2 Sol
Allow unmounting after zfs_resume_fs() fails
If zfs_resume_fs() fails after a rollback or receive, the filesystem
is meant to stay mounted but unusable until it's unmounted. Instead:
- On Linux, it can't be unmounted, so its pool can't be exported:
- Reading /proc/self/mounts fails with EIO, for every process,
since zpl_show_devname() can't enter the filesystem. umount(8),
"zfs unmount" and "zpool export" all read it.
- Unmounting waits forever for z_all_znodes to drain.
zfs_suspend_fs() took an extra reference on every inode, and
only the success path of zfs_resume_fs() drops it.
- Writing back a dirty page leaves it locked, as zfs_putpage()
returns without unlocking it when it can't enter the filesystem.
Unmounting then hangs when it locks the page.
- On debug builds, unmounting fails an assertion in
zfs_unlinked_drain_stop_wait() that the filesystem isn't
unmounted yet.
- On FreeBSD, the rollback or receive hangs. zfs_resume_fs() calls
[16 lines not shown]
unit/namecheck: cover the anymirror and anyraid pool names
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Christos Longros <longros at FreeBSD.org>
Closes #19897
[MSF] Consolidate checks for IsGrowable in the MSFBuilder into growFreeBlocks (#247308)
Follow-up to #233563, now that we have a single function that grows the
builder, this is the correct place to check and enforce `IsGrowable`.
Assisted-by: GPT-6.2 Sol
dmu_send: free the resume nvlist when setup_resume_points() fails
dmu_send_impl() allocates the nvl that carries the resume points
early, but the error path after setup_resume_points() jumps to out
without freeing it. The raw-send error path right below frees nvl
before taking the same goto, so this path is just missing the same
call. The leak is reached whenever a resumed or book-resumed send
fails there, e.g. from an invalid resume token.
Reviewed-by: Matthew Ahrens <matt at mahrens.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: HeonJe Lee <lhjnano at gmail.com>
Closes #19941
libzfs: free the deleted nvlist on error paths in recv_incremental
recv_incremental_replication() allocates the deleted nvlist before
gathering the local dataset list, but two error paths leave it behind:
the gather_nvlist() failure path returns immediately and the recursive
destroy/rename case -1 path frees the other two structures and
returns without it. Normal completion frees it at the end of the
function, so add the same free to both paths.
Reviewed-by: Matthew Ahrens <matt at mahrens.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: HeonJe Lee <lhjnano at gmail.com>
Closes #19950
ZTS: make deadman_sync wait for the deadman events
deadman_sync delays every write by 10s, sleeps 10s after writing the
file, clears the delay, and expects at least 3 deadman events. The
deadman starts checking 5s into the txg sync, once a second, and posts
an event when a write has been outstanding for more than 5s, so the
sleep leaves about 4 or 5 checks that can post.
c979ead156 ("ZTS: avoid rate limiting consecutive deadman checks", by
ooonea) stopped the rate limiter dropping checks that land just under
a second apart, the cause of the FreeBSD "2 found" failures. A stalled
VM can still miss the checks inside the fixed window: a Linux CI runner
counted 0 after its "sleep 10" took 16s.
Keep the delay in place until at least 3 deadman events for the pool
have been posted, for up to 30s: while it is in place every write the
sync issues takes 10s, so the txg stays hung for as long as the test
waits. Three events normally take about 13s, so the bound still fails
a deadman that checks far less often than once a second. Then clear
[4 lines not shown]
ZTS: wait for dRAID unspare after clearing a device
wait_resilvered can accept the previous sequential rebuild after
clearing the original device. The verification scrub can then start
before the pending healing resilver and compare the restored device with
its spare.
Wait for the first distributed spare to become available before running
the verification scrub. Keep the existing 300-second bound and checks.
Assisted-by: OpenAI Codex
Reviewed-by: Matthew Ahrens <matt at mahrens.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Giuseppe Piscitelli <ooonea at gmail.com>
Closes #19888
Fix some integration tests with more than 3 disks in DISKS
If the DISKS variable contains more than 3 elements, the
zpool_remove_003_pos and zpool_add_002_pos test will both fail because
they will assign the DISK2 variable a value like "vtbd3 vtbd4 vtbd5",
complete with spaces, leading to an invalid "zpool remove" or "zpool
add" command line. Fix the tests by correctly assigning the variable.
Apply the same fix to the zpool_destroy directory too, even though it
doesn't currently cause any failures there.
Reviewed-by: Matthew Ahrens <matt at mahrens.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alan Somers <asomers at gmail.com>
Sponsored-by: ConnectWise
Closes #19880
[lldb] Don't erase another section's entry in SetSectionLoadAddress (#245829)
SetSectionLoadAddress removes a moved section's entry at its old load
address from m_addr_to_sect. Since #193560 it erases whatever entry is
at that address. If another section was loaded at that address after the
moved section, the entry is that other section's, and erasing it leaves
that section with no entry: addresses in its range no longer resolve,
although GetSectionLoadAddress still returns its load address. The
linear scan that #193560 replaced only ever erased an entry of the moved
section.
Erase the old entry only if it still maps to the moved section.
Add unit tests for SectionLoadList, which had none: moving a section,
moving it onto an address another section holds, a section taking over
another's address, and unloading. SectionTakesOverAddress fails without
this change.
Assisted-by: Claude Code
Strengthen the construct context tests
The METADIRECTIVE checks in declare-variant-metadirective-context.f90
bounded the construct depth only from above. Add a second METADIRECTIVE
to bare_do, combined and target_depth that selects TASKYIELD unless the
context holds the DO, PARALLEL followed by DO, or three constructs,
respectively. Use kind(host) instead of kind(cpu), which is not set for
every host architecture.
declare-variant-spec-expr.f90 had no call that selects the PARALLEL
variant, so removing that variant did not fail the test. Add one inside
PARALLEL, and check for the variant only in the procedures that must not
call it.
[LAA] Check for any scalable access type, not just scalable vectors (#247805)
getStrideFromAddRec and tryToCreateDiffCheck only rejected scalable
vector access types. Other types with a scalable size, like
target("aarch64.svcount") or aggregates of scalable vectors, then had
their size converted to a fixed value, which crashes.
Use isScalableTy() instead.
[clang-format] Restore InsertBraces around interior preprocessor directives (#239459)
Restore brace insertion when a body's closing-brace position is safe in
every preprocessor branch, without moving it past `#endif`.
Follow-up to #224947.
[mlir][Linalg] Fix output block arg remapping in DecomposeLinalgOp (#238168)
`DecomposeLinalgOp` splits a `linalg.generic` into a peeled op for the
first statement and a residual op for the rest. The residual op takes
the results of the peeled op as extra inputs, placed between the
original inputs and outputs, but uses of the original block arguments
are remapped by position. An output block argument used in the residual
body therefore ends up on one of the extra inputs.
For an f32 body like `%0 = arith.mulf %in, %in` followed by `%1 =
arith.addf %0, %out`, the residual op computes `addf(%0, %0)` instead of
`addf(%0, %out)`. The IR verifies and silently computes wrong values.
When the types differ the IR becomes invalid instead, e.g. the fold
assertion in #237535. The existing `destination_passing_style` test
encoded the same wrong mapping: its residual `mulf` read the first
output instead of the second one.
Shift the output block argument indices by the number of extra inputs,
correct the `destination_passing_style` checks, and add a regression
[2 lines not shown]
Skip non-construct directives in getConstructTraits
getConstructTraits returned an invalid placeholder, which counts as an
enclosing construct for scoring, for every leaf that was neither
informational nor listed explicitly. That included stand-alone
directives such as BARRIER, declarative directives such as DECLARE
TARGET, and SCAN, ERROR and BEGIN METADIRECTIVE. Only executable
directives with an associated block or loop are constructs, so skip all
other leaves. This also covers the cases that were listed explicitly.
OMPContext::addTrait with an invalid property set an active trait
instead of recording a construct, which would let variants with unknown
traits apply. Assert that callers use addUnknownConstruct instead.
Flang drops the placeholders before building a context, so neither
change affects variant selection yet.
Fix __has_embed with a limit larger than the file (#247349)
`__STDC_EMBED_FOUND__`, not `__STDC_EMBED_EMPTY__` when using
`__has_embed`. Also factor the calculation so that it is shared between
`#embed` (which was already correct) and `__has_embed` (which was
broken).
Fixes #247344
[AArch64] Update test generator script for atomics
Update the test generator script to generate tests for atomic fp stores
where the value being stored is a constant positive zero. This case
differs from rest of the fp stores because of the fact that positive
zero is same as integer zero which can benefit from use of zero register
from GPR bank.
ZTS: test txg cost and atomicity of batch snapshot destroy
lzc_destroy_snaps() promises that a batch is all-or-nothing and that
every failing snapshot is reported, and a batch has historically cost
one txg sync. Nothing in ZTS checks either, so the per-snapshot
sync-task loop added by 1cec121afb broke both without a test failing.
zfs_destroy_batch_txg destroys 50 snapshots in one call and requires
at most 5 txg syncs; the per-snapshot loop costs 50.
zfs_destroy_batch_errlist holds two of five snapshots, destroys all
five in one batch, and requires that none is destroyed and both held
snapshots are reported. It also checks that a missing name in a batch
is ignored.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Prakash Surya <prakash.surya at perforce.com>
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Closes #19865
dsl: preserve atomic batch snapshot destruction
dsl_destroy_snapshots_nvl() promises that a failed batch destroys no
snapshots, but it runs and waits for one sync task per member. A later
failure can therefore leave earlier snapshots destroyed, and only the
first failure is reported.
Use one sync task for the complete batch. Check every admitted snapshot
and collect its error before applying any destruction under the same
config-writer lock. Preserve absent snapshots, deferred destruction,
and task-level errors.
Add order-sensitive coverage for held snapshots, complete error
reporting, absent members, and adjacent snapshot chains.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Prakash Surya <prakash.surya at perforce.com>
Signed-off-by: Kamil Monicz <kamil at monicz.dev>
Closes #19865
[mlir][tblgen] Fix attr constraints that use $_op (#244902)
[mlir][tblgen] Fix attr constraints that use $_op
Uniqued attribute constraints referencing `$_op` fail to compile:
mlir-tblgen expands the predicate inside the `emitError`
overload (introduced in 5e118f933b65), which has no `op` parameter.
Since `verifyInherentAttrs` already skips these constraints, emit only
the `Operation *` overload for them and share the `$_op` check through
`constraintReferencesOp`.
Property constraints have the same bug (left for a follow-up).
Fixes #69789.