Include zfs rewrite -P blocks in raw encrypted sends
zfs rewrite -P keeps the logical birth of the blocks it rewrites, and
incremental sends prune by logical birth, so they leave those blocks
out. That is right for non-raw streams, but not for raw streams of
encrypted datasets. Rewriting an encrypted block gives it a new IV and
MAC, and the dnode blocks a raw stream carries keep the MACs of the
sender, which authenticate the new MACs through the indirect blocks.
The receiver still holds the old blocks, so once its key is loaded the
affected dnode blocks fail authentication and the replica cannot be
read.
Raw sends of encrypted datasets now prune by BP_GET_BIRTH(), which
differs from the logical birth only for blocks with the rewrite bit.
dbuf_write() sets it only at level 0, so indirect blocks keep pruning
as before. The condition is the one that sets DMU_BACKUP_FEATURE_RAW:
non-raw sends, zfs send -w of unencrypted datasets, which is not a raw
stream, and zfs diff still prune by logical birth and keep the benefit
of -P. A resumed send takes the same path, since its token records
[16 lines not shown]
zio: align diagnostic flag names
Add BYPASSED_QUEUE in its bit position and include POSTREAD and
LIGHTWEIGHT so later flag names describe the actual bits.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Giuseppe Piscitelli <ooonea at gmail.com>
Assisted-by: OpenAI Codex
Closes #19617
ddt: do not prune an entry that a copies=2 write may have extended
A dedup write that asks for more copies than its entry holds writes
the missing ones and adds them to the entry, while the BPs written
before keep fewer DVAs. Once the refcount falls back to 1, the entry
is in the unique class, and ddtprune clears it without freeing
anything, since the BP left refers to its block. If that BP was
written before the extension, nothing refers to the added DVAs any
more and they leak; freeing that BP later frees only its own DVAs.
On a pool with one file vdev and dedup=on, a 128K block written with
copies=1, then again with copies=2, and the second file removed: zdb
reported no leak before "zpool ddtprune -p 100" and 128K leaked after
it. A leak ztest reports about once in 10 to 16 runs of 600 s has the
same cause in the run examined.
An extended entry cannot be told from one written with as many copies
from the start, so prune only entries holding a single DVA, and gang
entries, which zio_ddt_write() never extends. Entries of blocks written
[7 lines not shown]
build: stop shipping FreeBSD's pkg repo config
NextBSD no longer ships or configures FreeBSD's package repo
(nextbsd/nextbsd-kernel#376). build.sh no longer writes
/usr/local/etc/pkg/repos/FreeBSD.conf and no longer creates
/usr/local/etc/pkg/repos; the image's only repo is NextBSD's own, from
nextbsd-overlays.
Nothing in the image build resolved from pkg.FreeBSD.org:
NextBSD-everything installs through the isolated NextBSD-only REPOS_DIR,
and pkglist.txt is empty. The pkglist.txt step now installs from that
same NextBSD-only repo config instead of the FreeBSD one, so it can never
reach pkg.FreeBSD.org. Comments in build.sh and pkglist.txt are updated
to match.
Refs nextbsd/nextbsd-kernel#376
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
build: pin pkg's ABI per arch in the image's pkg.conf
NextBSD is moving __FreeBSD_version/kern.osreldate to 2700000 (NextBSD
kernel 27.0.0). pkg reads its ABI from /usr/bin/uname's ELF note, so
once the world is built at 27 it would ask repositories for
FreeBSD:27:<arch>. NextBSD's own packages (built by nextbsd-pkg on a
FreeBSD 15.1 VM) and pkg.FreeBSD.org/latest are FreeBSD:15:<arch>, and
NextBSD keeps the releng/15.1 kernel and libc API.
Step 5 now appends ABI = "FreeBSD:15:amd64" (or "FreeBSD:15:aarch64")
and OSVERSION = 1501000, an unquoted integer as pkg 2.8.4 requires, to
the overlay-seeded /private/etc/pkg.conf, and fails if the overlay
already sets them or the pin is missing afterwards. No ALTABI. At
1501000 this matches what pkg detects today.
Refs nextbsd/nextbsd-kernel#376
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
zfs_valstr: terminate truncated bitfield strings
Reserve a terminating byte in all bitfield renderers and avoid unsigned
subtraction underflow for small token buffers. Leave zero-length output
unwritten and retain complete-output counts.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Giuseppe Piscitelli <ooonea at gmail.com>
Assisted-by: OpenAI Codex
Closes #19618
Merge tag 'power-utilities-2026.10.31' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
Pull x86 power utilities updates from Len Brown:
"Turbostat:
- Fix --cpu option to work more than once
- Fix --Joules option to work with --show power
- Remove hard-coded 8192-CPU limit
- Decode Uncore Frequency Agent Types
- Dump RDT (Resource Director Technology) config
- Dump RP (Resource Priority) config
- Recognize Rugged Panther Lake
- Fix PMT mmap size, bounds check, and mask computation
- Misc cleanups and minor fixes
x86_energy_perf_policy:
- Harden input parsing and bounds checks
- Fix optarg keyword matching
- Rewrite MSR device path discovery
- Misc cleanups and minor fixes"
[23 lines not shown]
CI: Allow more time for bootstrap
FreeBSD startup installs packages before the dependency phase. Increase
the startup timeout to 20 minutes for all platforms.
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Giuseppe Piscitelli <ooonea at gmail.com>
Assisted-by: OpenAI Codex
Closes #19624
recv: check the temporary clone name length
Reject an incremental receive whose temporary child name cannot fit
before syncing context formats its history entry. Corrective receives
create no child. Exercise both sides of the name limit and preserve the
base snapshot GUID after rejection.
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: ooonea <35407790+ooonea at users.noreply.github.com>
Assisted-by: OpenAI Codex
Closes #19554
devel/iscd-commons: Count CPUs with sysconf instead of libpmc
The port's lplib3.c patch counts CPUs with pmc_init()/pmc_ncpu() but
libCommons.so is not linked with libpmc, so loading it fails with
"Undefined symbol pmc_init" (e.g. cad/py-gmsh). pmc_init() also
needs hwpmc loaded. Use sysconf(_SC_NPROCESSORS_ONLN).
While here, fix portlint warnings and document the patch.
PR: 300280
ZTS: add rebuild_online_leaf
A two-way mirror leaf is offlined, misses writes, and is onlined
while a sequential rebuild to a third leaf is paused. With the scrub
after the rebuild disabled, which would otherwise repair the new leaf,
the pool is then imported from the new leaf alone, and it must hold
all data.
Without the previous commit the new leaf receives stale data from the
onlined leaf.
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Jared Maxwell <128261747+ThatRetiredDude at users.noreply.github.com>
Closes #19538
Do not copy stale data from a mirror child in a rebuild
A sequential rebuild reads with a block pointer that has no checksum
and birth txg TXG_INITIAL. vdev_mirror_child_select() only skips a
child whose DTL contains that txg, so a child that missed later
writes, for example one onlined while the rebuild runs, can serve the
read. Its stale data is then written to the leaf being rebuilt and
nothing verifies it. The resilver of the onlined child does not
repair the rebuilt leaf, so unless a scrub covers those blocks, for
example with zfs_rebuild_scrub_enabled=0, the rebuilt leaf keeps the
bad copies until a full scrub.
For rebuild reads, prefer children whose DTL is empty, and fall back
to one that missed writes only when no other child can be read.
dRAID is left unchanged: its distributed spares must stay preferred,
and its own reconstruction can still read such a child, which this
change does not address.
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
[3 lines not shown]
[TargetLowering] Don't call willNotOverflowSub in expandABD for ABDU with non-negative inputs. (#237338)
If the inputs are non-negative, then the difference between them
can never overflow so we don't need to call willNotOverflowSub.