system: diag.disk rework (#10875)
changes diag.disk to return total bytes as well as formatted bytes so the API returns more info but keeps functionality the same.
[lldb] Make the shell expansion timeout an LLDB setting (#221952)
LLDB launches a small utility program that prints its own arguments to
expand launch arguments. This lldb-argdumper invocation was previously
capped with a hardcoded 10 second timeout, which is low enough that we
kept hitting it on CI bots in random tests:
```
runCmd failed!
>>> error: shell expansion failed (reason: timed out waiting for shell command to complete). consider launching with 'process launch'.
```
This turns the timeout into the new "platform.shell-expand-timeout"
setting (in seconds) so it can be tuned without recompiling. The
default is now three minutes, and a value of 0 disables the timeout
entirely.
The test suite now disables the timeout altogether as it serves
no purpose there.
NAS-142807 / 26.0.0 / Enforce canmount=noauto across the whole apps dataset tree (by Qubad786) (#19799)
## Problem
We only re-assert canmount=noauto on the five structural ix-apps
datasets, never on the per-app volume datasets beneath app_mounts. If
one of those ends up canmount=on - a hand-rolled zfs recv migration, or
simply the ZFS default when a replication task runs without properties -
the boot mount sweep mounts it while correctly skipping its noauto
parent, and docker then mounts /mnt/.ix-apps straight over the top. The
volume stays mounted but unreachable: zfs reports mounted=yes, stat
returns ENOENT, and the container fails with "bind source path does not
exist". Nothing recovers from this on its own, because the remount path
only mounts datasets reporting mounted=no.
## Solution
Walk the whole apps tree in a single query and set canmount=noauto
wherever it drifted. This is hooked into the docker start reconcile and,
more importantly, into pool import right after the root dataset
properties are normalized. The import hook is what actually prevents the
[7 lines not shown]
[clang-tidy] Fix crash in bugprone-misplaced-pointer-arithmetic-in-alloc (#224509)
This commit checks for an empty constructor argument list before
accessing its last element.
Reproducer at: https://godbolt.org/z/Tfvnbhx19
AI Usage: the issue was found by Grok 4.6. Although IMO this is a pretty
uncommon/rare case, less crash-on-valid is always better.
amdsmu: Hints on what to do if IP block blocking S0i3
Reviewed by: olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59674
amdsmu: Diagnose S0i3 entry after resume
Print out diagnostic information after resuming from suspend-to-idle if
we failed to enter S0i3, i.e. the IP blocks that were blocking entry to
S0i3.
Don't give detailed IP block info for other SMUs than for Phoenix, as I
have not had a chance to test these yet and the SMU seems to be very
quirky.
Reviewed by: olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59673
power: Add power_resume_check eventhandler
This is intended to be used on resuming to check that everything that
happened during suspend was expected.
It is not meant to check for errors we should hard-fail from, rather it
should be used as an opportunity for drivers such as amdsmu(4) to check
e.g. whether the previous suspend-to-idle actually entered a deep sleep
state (S0i3).
Reviewed by: olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59740
acpi: Don't check suspend-to-idle if suspend failed
If we e.g. failed to suspend a device and suspend bounced because of
that, then we're not expected to have entered a deep sleep state in the
first place. In this situation, don't overload the user with irrelevant
information.
Reviewed by: olce
Fixes: 5f68acc931a4 ("acpi: Warn if no amdsmu(4) loaded after suspend-to-idle resume")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59731
[llvm-pdbutil] Print error on invalid YAML (#207528)
From
https://github.com/llvm/llvm-project/pull/207058#discussion_r3522204565:
We should print out an error if we encounter invalid YAML.
With this PR, the error is printed. I included the diagnostics here,
because they provide better error messages and allow you to locate the
error easier.
NAS-143924 / 26.0.0 / Fix webshare share gathering in usage reporting (by Qubad786) (#19802)
## Problem
`sharing.webshare` is a typesafe service, so its `query` hands back
pydantic entries rather than dicts, and the gather loop subscripted
them. A single configured webshare was enough to raise `TypeError` — and
since `gather()` swallows a failing stat function wholesale, that
dropped the entire `shares` payload, SMB/NFS/iSCSI included, leaving
only a log line behind.
## Solution
Read `enabled` and `is_home_base` off the entry as attributes.
Original PR: https://github.com/truenas/middleware/pull/19800
Co-authored-by: M. Rehan <mrehanlm93 at gmail.com>
NAS-143924 / 26.0.0-RC.1 / Fix webshare share gathering in usage reporting (by Qubad786) (#19803)
## Problem
`sharing.webshare` is a typesafe service, so its `query` hands back
pydantic entries rather than dicts, and the gather loop subscripted
them. A single configured webshare was enough to raise `TypeError` — and
since `gather()` swallows a failing stat function wholesale, that
dropped the entire `shares` payload, SMB/NFS/iSCSI included, leaving
only a log line behind.
## Solution
Read `enabled` and `is_home_base` off the entry as attributes.
Original PR: https://github.com/truenas/middleware/pull/19800
Co-authored-by: M. Rehan <mrehanlm93 at gmail.com>
route/fib_algo: Fix nexthop index collision across families
fib_algo indexes its idx->nhop array by the nexthop index with
assumption of its uniqueness. Which is true except for IPv4 over
IPv6 nexthops.
Give each index space its own segment within the same array and
offset the index by the segment base. Segments are created on demand
and sized independently, so the rib's own family keeps base 0 and
tables without cross-family nexthops index exactly as before.
Reviewed by: melifaro
Discussed with: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D59552
interfaces: handle these as well
They are correct but it doesn't hurt to keep them in the list
to avoid noise in the config diff for now. It's easier to
spot actual issues such as "<dhcp6-ia-pd-len>0</dhcp6-ia-pd-len>"
being written to a LAN configuration.
[LV] Fold invariant reduction phis to their start value. (#223279)
A reduction phi whose backedge value is the phi itself is invariant and
equal to its start value. This can happen when the reduction operation
folds away, e.g. `or X, 0`, `and X, -1`, `add X, 0` or `mul X, 1`.
Clean up such trivial non-reductions early.
PR: https://github.com/llvm/llvm-project/pull/223279
bhyve: Add an option to prevent automatic restart in monitor mode
Monitor mode will currently unconditionally restart the guest if it
reboots, which can be incovenient in certain situations (e.g., resetting
the guest after a panic).
Address this by introducing a way to prevent automatic guest restarts
in monitor mode.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D59123
db/hash: Harden hash(3) database code
The hash(3) database code does not validate the on-disk database header,
leaving it open to several OOB read and write vulnerabilities.
This change adds basic header validation and array bounds checking to
parts of the hash(3) code that can be manipulated by messing with the
database header.
Reviewed by: kevans
Sponsored by: Klara, Inc.
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D58822