[lldb] Change BreakpointList::FindBreakpointsByName to use StringRef (#205695)
It's not possible to turn a StringRef into a c-string safely without a
potential allocation. I will use this in a follow-up to remove
ConstString from BreakpointName.
[ADT] Add StringRef::nonEmptyOr (#204690)
This adds a new method to StringRef. The intended use case is for
situations when a non-empty StringRef is needed but some operation
returns an empty StringRef because of missing data or some other
exception.
This is primarily for ergonomics. I'm mainly motivated to avoid creating
a temporary StringRef in situations where a StringRef is obtained
through a long call chain. e.g.
`doAThing(my_obj.getFoo().getBar().getBaz().getStringRef().nonEmptyOr("unknown"))`
---------
Co-authored-by: Jonas Devlieghere <jonas at devlieghere.com>
[BPF] Sort BTF struct members by offset (#205396)
Sort BTF structure elements by their debug offsets. Prevent
source-ordered Rust debug metadata from producing descending member
offsets after rustc chooses a different physical layout, because the
kernel rejects such BTF.
Use the sorted order for member emission, declaration-tag component
indexes, and CO-RE access strings. Keep physical offset calculations on
the original debug indexes so changing BTF order does not change
generated code.
Eliminate the need for the bpf-linker metadata rewrite by enforcing the
ordering in the LLVM BPF backend:
https://github.com/aya-rs/bpf-linker/commit/1007ec7fed03562eb7d08f3e7521094a7e698b95
Revert "[NVPTX] Fold symbol addresses into memory operands" (#205852)
Reverts llvm/llvm-project#202379
check-llvm now fails on one of the new testcases
```
Failed Tests (1):
LLVM :: CodeGen/NVPTX/address-folder.ll
```
NAS-141531 / 27.0.0-BETA.1 / more zpool status checks in failover (by yocalebo) (by bugclerk) (#19206)
These changes make the standby transition fail closed so a controller
never releases its disks while a pool might still be imported.
When a controller demotes to standby it exports its pools and then stops
fencing to make the disks available to the other controller. The old
code exported each pool on a best effort basis and skipped any pool that
reported a status of OFFLINE. In rare cases a pool can report OFFLINE
while it is in fact still imported, so the old code could stop fencing
and release the disks while a pool was still attached. That is a fail
open scenario because the other controller could then import the same
pool at the same time, which can lead to data corruption.
The new code attempts to export every pool and then confirms the outcome
before releasing fencing. It checks each pool again using a lockless
read of the kernel kstat namespace, which reflects whether a pool is
actually present rather than what state it reports. If any pool is still
imported, or the export is still running past its timeout, or the import
[21 lines not shown]
[offload][OpenMP] Fix partial warp reduction
Don't use a full warp for the final cross-team reduction if the
reduction's thread limit is below the warp size.
Claude assisted with the test.
[ADT] Rewrite ImmutableSet/Map in-order iterator without per-node state (#205552)
ImutAVLTreeInOrderIterator was layered on a "generic" iterator whose
stack stored a 2-bit visit-state (None/Left/Right) packed into the low
bits of each node pointer, and which was spun through several
intermediate states per in-order step.
Replace it with a single iterator that keeps a stack of plain node
pointers (the root-to-current ancestor chain) and recovers the traversal
direction by inspecting whether it is ascending from a node's left or
right child. A node's parent cannot be cached in the node itself because
these trees are persistent and structurally shared (one node may be a
child of different parents across tree versions), so the ancestor stack
is the per-traversal parent chain.
The observable contract is unchanged: same in-order sequence, same
skipSubTree() semantics (so tree canonicalization via isEqual is
unaffected), and the iterator stays bidirectional. operator== now
compares the current node rather than the whole path, which is O(1) and
[21 lines not shown]
[lldb] Fix DWARFASTParserClang formatting (#205857)
In #205701, I applied Michael's suggestion and enabled auto-merge.
Despite the formatter check failing, the change still got merged. Fix
the formatting and another inconsistency in the use of braces.
[LoopInterchange] Add test for IR modification stops partway (#205562)
The transform phase in LoopInterchange, which actually modifies the
input IR, has several early exits. This means that if the process hits
one of them, the end result may be IR that has been left in a partially
modified state. As far as I have searched, there is only one case that
actually triggers an early exit. In that case, the final output happens
to be valid IR (though not interchanged), so I believe this is not a
correctness issue at the moment. However, the current implementation is
clearly undesirable, especially because the loop is regarded as
interchanged internally even though the transformation actually failed.
We should eliminate all such early exits.
This patch adds a test that I could find, and also adds a debug output
to make it clear which one is triggered.
Assisted-by: Claude Code
Merge tag 'block-7.2-20260625' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux
Pull block fixes from Jens Axboe:
- blk-cgroup locking rework and fixes:
- fix a use-after-free in __blkcg_rstat_flush()
- defer freeing policy data until after an RCU grace period
- defer the blkcg css_put until the blkg is unlinked from
the queue
- unwind the queue_lock nesting under RCU / blkcg->lock
across the lookup, create, associate and destroy paths
- NVMe fixes via Keith:
- Fix a crash and memory leak during invalid cdev teardown,
and related cdev cleanups (Maurizio, John)
- nvmet fixes: handle TCP_CLOSING in the tcp state_change
handler, reject short AUTH_RECEIVE buffers, handle inline
data with a nonzero offset in rdma, fix an sq refcount leak,
and allocate ana_state with the port (Maurizio, Michael,
[54 lines not shown]
Merge tag 'io_uring-7.2-20260625' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux
Pull io_uring fixes from Jens Axboe:
- Fix a file reference leak in the nop opcode when used with
IOSQE_FIXED_FILE
- Preserve the SQ array entries when resizing the ring via the register
path
- Preserve the partial result for an iopoll request rather than
overwriting it
- Don't audit log IORING_OP_RECV_ZC
- Bound io_pin_pages() by the page array byte size in the memmap path
- Follow-up cleanup to the task_work mpscq conversion, getting rid of
the now-unnecessary tw_pending tracking for the !DEFER_TASKRUN path
[11 lines not shown]
Constify some rrd_*() functions
These don't modify the db, so just constify them while we're in the
area.
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Longros <chris.longros at gmail.com>
Signed-off-by: Kyle Evans <kevans at FreeBSD.org>
Add dbrrd_latest_time() to grab the latest timestamp in the db
Returns 0 if the database is empty, otherwise it returns the highest
value of the minutely db. dbrrd_add() will already enforce the property
that these are monotonically increasing, so we won't try to second-guess
it.
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Longros <chris.longros at gmail.com>
Signed-off-by: Kyle Evans <kevans at FreeBSD.org>
freebsd: set mnt_time on the rootfs at mountroot time
FreeBSD's vfs_mountroot() will collect `mnt_time` from every filesystem
that we mounted and use the highest timestamp as a source for the system
time if we didn't get anything from an attached RTC.
Use the rrd mechanism added to gather up a notion of the latest time
and set it on mnt_time. If the timestamp db is empty, we just fallback
to the uberblock timestamp and hope that that is in the right ballpark.
Relevant: FreeBSD PR254058[0] reporting the problem downstream
[0] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254058
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Longros <chris.longros at gmail.com>
Signed-off-by: Kyle Evans <kevans at FreeBSD.org>
Fix aarch64 build failure by removing earlyclobber (#18532)
The UVR macros used "+&w" (read-write + earlyclobber) as the
constraint for NEON register operands that are declared as explicit
hard-register variables via:
register unsigned char wN asm("vN") __attribute__((vector_size(16)));
The + modifier implicitly makes the operand also an input (reading the
register before the asm runs). The & (earlyclobber) modifier says "this
output may be written before all inputs are consumed." Having an
earlyclobber output on the same hard-register that is simultaneously
an input is a contradiction — GCC 16 now strictly diagnoses this.
The fix removes the & from "+&w", yielding "+w". The earlyclobber
was both incorrect (contradicts the implicit input) and unnecessary
(the physical registers are already hard-bound, so the compiler has no
freedom to assign conflicting registers anyway).
[7 lines not shown]
vmd(8): reject invalid PIT periods causing UB.
A guest can write values to Register A that results in a negative
shift exponent when computing the resulting timer rate. Detect and
ignore values to prevent UB from negative shift.
Reported by Frank Denis.
Discussed with and "go for it" from mlarkin@
unit/zap: uint64 keys
Add coverage for binary uint64-array keys (ZAP_FLAG_UINT64_KEY), the key
type used by the dedup table and block reference table. Covers the
by-dnode operations on such a ZAP: add, lookup, length, lookup_length,
update and remove.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Closes #18639
[lldb] Use the source name when the linkage name is not mangled (#205701)
When a DW_TAG_subprogram has a DW_AT_linkage_name that is not actually a
mangled name and differs from DW_AT_name, lldb used the linkage name as
the function's display name. For C++ the linkage name demangles back to
the source name, but a plain symbol such as __main_argc_argv does not,
so the function showed up under its raw linkage name in backtraces,
breakpoint locations and `image lookup`, and was not findable by its
source name.
This happens on WebAssembly: wasi-libc renames `int main(int, char**)`
to its __main_argc_argv argv-passing wrapper, keeping DW_AT_name "main"
but recording DW_AT_linkage_name "__main_argc_argv".
When the linkage name has no recognized mangling scheme, use DW_AT_name
as the display name and keep the linkage name as the symbol, so lookups
by either name still resolve.