98 Commits
Author SHA1 Message Date
Christos Longros e48eb1c5c4 mailmap: Add entry for longros
Approved by:	jrm (mentor)
Differential Revision:	https://reviews.freebsd.org/D60912
2026-10-20 19:45:14 +02:00
Christos Longros 3061504326 Add Christos Longros as ports committer, update mentor/mentee
Reviewed by:	jrm (mentor)
Approved by:	jrm (mentor)
Differential Revision:	https://reviews.freebsd.org/D60591
2026-10-11 07:21:22 +02:00
Christos Longros 62e958df01 zfs: drop duplicate vfs.zfs.metaslab.condense_pct sysctl
`metaslab.c` already registers this tunable via `ZFS_MODULE_PARAM`, so the
`SYSCTL_UINT` here is a second registration of the same leaf. This
resulted in messages like:

```
sysctl_register_oid: can't re-use a leaf (vfs.zfs.metaslab.condense_pct)
```

Remove the duplicate sysctl registration, as upstream (OpenZFS) did.

MFC after:	1 week
Signed-off-by:	Christos Longros <[email protected]>
Reviewed by:	imp, mm, ngie
Differential Revision:	https://reviews.freebsd.org/D57721
2026-10-10 00:11:14 -07:00
Christos Longros b6c59d1597 ZTS/rsend: receive into a '.' or '..' component must fail
Receive a snapshot into $POOL2/. and $POOL2/.. and check that both
are rejected and that a name starting with a dot is still accepted.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18975
Closes #19010
2026-09-21 09:20:23 -07:00
Christos Longros 191a3939db unit/namecheck: cover dot components before a delimiter
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18975
Closes #19010
2026-09-21 09:20:19 -07:00
Christos Longros 88befe7428 zfs_namecheck: reject '.' and '..' before a snapshot or bookmark
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18975
Closes #19010
2026-09-21 09:20:07 -07:00
Christos Longros d8e315ba97 hid: Add Sony DualSense gamepad driver
Add a driver for the Sony PS5 DualSense controller (054c:0ce6)
providing gamepad input via evdev, lightbar RGB LED control, and
player indicator LEDs through sysctl.

Signed-off-by:	Christos Longros <[email protected]>
Reviewed by:	ziaee, wulf
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D56345
2026-09-11 18:49:22 +03:00
Christos Longros 8fe28f4ca4 zdb.8: document the -Z flag
Add Z to the SYNOPSIS and an entry for -Z, --zstd-headers to 
the option list.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #19094
2026-09-10 10:42:45 -07:00
Christos Longros 0ee8ea01bc FreeBSD: use sys/abi_compat.h for time32_t
FreeBSD 14.5 defines time32_t in sys/abi_types.h. The SPL typedef now
duplicates it, which breaks the -std=gnu99 module build on stable/14.
Apply the same change as freebsd-src 87632ddf67.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #19059
2026-09-09 11:17:23 -07:00
Christos Longros 9e06573c4f CI: update the FreeBSD STABLE CI runner to 14.5-STABLE
Update the FreeBSD STABLE CI from 14.4-STABLE to 14.5-STABLE. Update the
README as well.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #19058
2026-09-09 11:16:33 -07:00
Christos Longros b19fa7c97d log_spacemap: make zfs_log_sm_blksz tunable
Make the block size used for the log space map feature's space maps 
settable at runtime.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18974
2026-09-03 12:15:55 -07:00
Christos Longros 604d1b39b2 unit/btree: test the negative cases
Introduce the two negative tests, insert_duplicate and remove_missing,
from tests/zfs-tests/cmd/btree_test.c to the unit tests.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #19009
2026-09-03 09:33:34 -07:00
Christos Longros ef03c60246 kern_mib: remove kern.fallback_elf_brand compat sysctl
This compatibility alias for kern.elf{32,64}.fallback_brand has been
marked for removal since FreeBSD 6.0.

Signed-off-by: Christos Longros <[email protected]>

Reviewed by:	kib, emaste
Differential Revision:	https://reviews.freebsd.org/D56085
2026-08-31 13:23:53 -04:00
Christos Longros 4e006237ff vdev: expose dtl_sm_blksz and standard_sm_blksz on Linux
Expose zfs_vdev_dtl_sm_blksz and zfs_vdev_standard_sm_blksz as module
parameters on Linux.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18952
2026-08-19 22:17:31 -07:00
Christos Longros d1352096e5 unit/cityhash: test the cityhash hash functions
Cover known answers, the 1/2/3-argument specialized forms against
cityhash4, and distinct inputs.

Reviewed-by: Rob Norris <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18880
2026-08-04 14:43:39 -07:00
Christos Longros 0a932e9a20 unit/sha2: add Monte Carlo test
SHAVS chain MD[i] = SHA(MD[i-3] || MD[i-2] || MD[i-1]) run for 1000
rounds, for SHA-256, SHA-512 and SHA-512/256.  The seeds and expected
digests are the COUNT = 0 vectors from the NIST CAVP byte-oriented test
vectors (shabytetestvectors).

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18879
2026-08-04 14:42:59 -07:00
Christos Longros b6b0d76cca ZTS: add scrub-from-txg into the runfile
zpool_scrub_txg_continue_from_last (#16301) and
zpool_events_scrub_txg_continue_from_last (#17432) are listed in
Makefile.am but not referenced in common.run thus ignored into CI
and ZTS

The test defines that the last_scrubbed_txg is initially 0, which is
only valid on a pool with no scrub history. Recreate the pool so the
test does not depend on its position in the runfile.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18785
2026-07-23 16:18:18 -07:00
Christos Longros 52424e4d38 unit/sha2: test SHA-256, SHA-512 and SHA-512/256
NIST known answers, split updates across the 64- and 128-byte block
boundaries, and cross-implementation equality via zfs_impl_get_ops().
Check SHA-256 and SHA-512 against the one-million-'a' digests based
on the NIST standard.

Reviewed-by: Tino Reichardt <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18779
2026-07-11 14:10:34 -07:00
Christos Longros cbf7db51dd unit/fletcher: test fletcher-2 and fletcher-4 checksums
Cover known answers, incremental vs single-call agreement, varsize,
byteswap, and cross-implementation equality.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18747
2026-07-07 10:44:30 -07:00
Christos Longros 19d69a9193 unit/btree: test basic B-Tree operations
module/zfs/btree.c has no dedicated unit test. This adds a small 
tests/unit suite for its basic public operations.  Cover an empty tree,
add/find, remove, and walk over a tree of uint64_t and drain a tree.

Reviewed-by: Rob Norris <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18690
2026-06-29 07:58:36 -07:00
Christos Longros e2b97ab18e 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 <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18639
2026-06-25 09:41:47 -07:00
Christos Longros ca24d0ac4b unit/zap: add MT_MATCH_CASE mixed-case test
New case-normalization test to cover the exact-case path. On a TOUPPER
ZAP, MT_NORMALIZE | MT_MATCH_CASE matches only the stored casing, while
an MT_NORMALIZE lookup matches any case.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Rob Norris <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18638
2026-06-24 16:54:52 -07:00
Christos Longros 9417b115a2 loader/efi: pre-allocate memory map buffer before ExitBootServices
Move the memory map allocation before the ExitBootServices retry
loop to ensure no boot service calls occur between GetMemoryMap
and ExitBootServices.  This simplifies the control flow by removing
the inner sizing loop and matches the strategy used by the Linux
EFI stub.

Identified while investigating an ExitBootServices hang on
AMD AGESA 1.3.0.0a firmware (Gigabyte B650 GAMING X AX V2).

Signed-off-by:		Christos Longros <[email protected]>
Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D56249
2026-06-23 22:46:16 -06:00
Christos Longros b02c28ed70 README: update supported FreeBSD release to 15.1
Our CI runners moved to FreeBSD 15.1 in 0a4b59765 (#18667), but the
README still lists 15.0. Update it to match the CI version.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18696
2026-06-23 09:01:01 -04:00
Christos Longros 714ad77c5f CI: Add a unit-tests workflow to our infrastructure
Run `make unit` on each PR so the unit-test suite (currently 64
tests) is tested as it grows.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Rob Norris <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18670
2026-06-22 14:19:42 -07:00
Christos Longros c0f62d4fdf spa: make ccw_retry_interval tunable on Linux (#18681)
zfs_ccw_retry_interval sets the time interval after which a retry of a
failed write of the configuration cache file is attempted. It was only
exposed on FreeBSD. Make it Linux tunable with ZFS_MODULE_PARAM and
document it in zfs.4.

Signed-off-by: Christos Longros <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
2026-06-18 13:42:39 -07:00
Christos Longros 0a4b597654 Update our CI runners to the newest FreeBSD 15.1 RELEASE (#18667)
Signed-off-by: Christos Longros <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
2026-06-16 09:00:32 -07:00
Christos Longros 7e054b2e7e unit/namecheck: test name validation
Add a test_namecheck unit suite covering zfs_namecheck name check
functions, including: pool, dataset, snapshot, bookmark, component,
permset and mountpoint, plus get_dataset_depth and dataset_nestcheck.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Rob Norris <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18643

* unit/namecheck: simplify name generation and helpers

1) introduce check_longname_invalid() and simplify the long-name helper
2) document that zfs_max_dataset_nesting is a tunable and drop the
   unnecessary restore
3) drop snprintf and use fixed intervals for the delimiters in a
   random string

Signed-off-by: Christos Longros <[email protected]>

---------

Signed-off-by: Christos Longros <[email protected]>
2026-06-09 16:51:23 -07:00
Christos Longros 2d8cfcec6e test_zap: correct duplicate words
Fix two doubled words in comments: "which which" and "them them".

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18641
2026-06-08 09:17:35 -07:00
Christos Longros a170134feb metaslab: expose df_alloc_threshold and df_free_pct on Linux
Expose metaslab_df_alloc_threshold and metaslab_df_free_pct as module
parameters on Linux, matching their existing FreeBSD sysctls.

Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18632
2026-06-06 10:16:23 -07:00
Christos Longros a65ed7afd3 zpool/zfs: accept --help and -? after a subcommand
Print the short usage instead of "invalid option".

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18541
2026-06-04 13:39:00 -07:00
Christos Longros 4eb0851d71 ZTS: fix mktemp usage on FreeBSD
On FreeBSD -t takes a required prefix argument. Use
"mktemp -d $TEST_BASE_DIR/..." instead.

Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18621
2026-06-03 17:33:19 -07:00
Christos Longros 037368b124 metaslab: expose condense_pct and sm_blksz tunables on Linux
Expose zfs_metaslab_condense_pct and zfs_metaslab_sm_blksz_* as
module parameters on Linux, matching their existing FreeBSD sysctls.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18594
2026-06-02 09:33:22 -07:00
Christos Longros 20d56830f9 CI: add concurrency support to zfs-arm
The zfs-arm workflow was the only build/test workflow without a
concurrency block, so superseded runs were not cancelled.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18608
2026-05-31 18:27:40 -07:00
Christos Longros bfb914ca58 CI: apt-get update before purging host packages
The package removal ran against a stale package index and failed to
fetch a package that had been removed from the repository. Refresh
the index first.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18607
Closes #18609
2026-05-31 18:25:26 -07:00
Christos Longros ec65e4b6bb CI: skip smatch, zloop, and zfs-arm for documentation-only changes
Follow-up to #18518, which skipped the qemu matrix on doc-only PRs.
zloop, zfs-arm, and smatch are irrelevant to doc-only changes.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18601
2026-05-28 17:32:07 -07:00
Christos Longros 3250b4393e CI: Update checkstyle checkout action to v6
The checkstyle workflow was the only one still pinned to
actions/checkout@v4; the other workflows already use v6.
Bump it to match.

Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18600
2026-05-28 15:06:46 -07:00
Christos Longros 6303a58242 spa: expose max_missing_tvds_cachefile and _scan on Linux
Register the two siblings of zfs_max_missing_tvds via
ZFS_MODULE_PARAM in spa.c

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18589
2026-05-26 17:15:42 -07:00
Christos Longros 8bfac28f15 .github: update workflows README
Describe the current zfs-qemu pipeline, ci_type selection, supported
guests, and the code-checking and other auxiliary workflows.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18590
2026-05-26 15:45:38 -07:00
Christos Longros efdc755761 ZTS/zinject: cover label, object, delay, panic and verify effect (#18579)
* ZTS/zinject: cover label, object, delay, panic and verify effect

Cover the device, label, object, delay and panic injection modes:
every valid value is accepted and unknown values are rejected. A
final pass confirms that registered injections execute by watching
the inject counter advance after triggering the desired injected
error.

Signed-off-by: Christos Longros <[email protected]>

* ZTS/zinject: add author copyright

Signed-off-by: Christos Longros <[email protected]>

---------

Signed-off-by: Christos Longros <[email protected]>
2026-05-26 12:10:44 -07:00
Christos Longros 88656cc95b ZTS/alloc_class: move file_in_special_vdev to alloc_class.kshlib
Move the function into the shared library.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18584
2026-05-25 16:07:02 -07:00
Christos Longros af0228bb54 ZTS: zpool_expand_005_pos: correct variable name in expandsize check
The check referenced $zpool_expandsize, which is not defined in this
test; the variable assigned two lines above is $expandsize. A "-"
value returned by zpool reopen therefore did not trigger the
intended log_fail, and the failure surfaced only at the later
post-online-e size check with a less specific message.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18580
2026-05-25 16:05:07 -07:00
Christos Longros accb2b418e CI: run full CI when a workflow YAML changes
FULL_RUN_REGEX in generate-ci-type.py covered .github/workflows/scripts/
but not the workflow YAML files, so a PR that only edited zfs-qemu.yml
got "quick" CI and never tested its own matrix change. Add the YAML
files to the list.

Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18577
2026-05-22 13:15:31 -07:00
Christos Longros 971791762a CI: enable FreeBSD 15.0-RELEASE in matrix
Add freebsd15-0r to the FreeBSD presets

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18561
2026-05-22 09:18:39 -07:00
Christos Longros ea7fd8a7bc libzfs_pool: add docstrings to several public functions
Cover a number of frequently-used functions that previously had no
documentation.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18538
2026-05-19 09:08:48 -07:00
Christos Longros 3f44da701b CI: remove FreeBSD 13.5 (EOL April 30, 2026)
FreeBSD 13.5 and stable/13 reached End-of-Life on April 30, 2026 and no
longer receive security support, so they fall outside README.md's stated
support policy.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18553
2026-05-18 11:27:45 -07:00
Christos Longros 414ce4b5fc Linux: expose zfs_arc_no_grow_shift as a module parameter
The zfs_arc_no_grow_shift variable is tunable via sysctl on FreeBSD
but had no module parameter registration on Linux.

Register it once in arc.c using param_get_uint and a per-platform
set handler, replacing the FreeBSD-only registration.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alek Pinchuk <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18461
2026-05-12 14:23:12 -07:00
Christos Longros 59e10e7b92 libzfs_pool: document export and initialize functions
Add brief docstrings to zpool_export(), zpool_export_force(),
zpool_initialize() and zpool_initialize_wait().

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18514
2026-05-12 07:50:33 -07:00
Christos Longros 968f4db039 zpool-attach.8: add EXAMPLES section
Mirror-attach (shared with zpool.8 example 5) and raidz expansion.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Tino Reichardt <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18508
2026-05-11 12:19:28 -07:00
Christos Longros 35853ac849 CI: skip qemu matrix for documentation-only pull requests
Add a new "docs" CI type, selected when every file modified by a
pull request matches a documentation pattern (man pages, .md,
AUTHORS, COPYRIGHT, LICENSE, NOTICE, .gitignore). For this type the
os_selection is empty and the qemu matrix runs no jobs.

This affects only pull requests whose entire diff is documentation.
Any change touching a non-documentation file continues to be
classified as full, quick, linux, or freebsd by the existing
file-path rules, and a manual ZFS-CI-Type commit tag still overrides
that classification.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18518
2026-05-11 12:16:48 -07:00
Christos Longros 5dd912192d Update description of spl_schedule_hrtimeout_slack_us
Clarify the effect of the non-zero value on wakeup coalescing.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18467
2026-05-04 15:09:33 -07:00
Christos Longros b68c782d82 man: document three missing properties and tunables
Add manpage entries for parameters and properties that exist in
source but were not previously described:

- spl.4: spl_schedule_hrtimeout_slack_us
- zfsprops.7: longname
- vdevprops.7: raidz_expanding

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18467
2026-05-04 15:09:00 -07:00
Chris Longros 91bfba010b cron: log when a crontab path is too long
Log via syslog when snprintf truncates the crontab path, instead of
silently skipping the entry.

Signed-off-by:	Christos Longros <[email protected]>
Reviewed by:	bcr, kevans
Differential Revision:	https://reviews.freebsd.org/D56235
2026-04-28 23:06:29 -05:00
Christos Longros cd06f79e29 build: use pax tar format for make dist
Automake's default tar formats (v7 pre-1.18, ustar since) impose path
length limits that drop several long test filenames from the release
tarball when `make dist` runs. Pax format has no such limit and is
read by GNU tar 1.14+ and libarchive/bsdtar.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes: #17276
Closes: #18465
2026-04-25 15:24:38 -07:00
Christos Longros 4a58ab8ce2 zfs.4: document five missing module parameters
Add entries for module parameters that are exposed via
ZFS_MODULE_PARAM but not covered in zfs.4:

  zfs_active_allocator          (charp,  module/zfs/metaslab.c)
  zfs_compressed_arc_enabled    (int,    module/zfs/arc.c)
  zfs_arc_no_grow_shift         (uint,   module/os/freebsd/zfs/arc_os.c)
  zfs_scan_blkstats             (int,    module/zfs/dsl_scan.c)
  zfs_snapshot_history_enabled  (int,    module/zfs/dsl_dataset.c)

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18456
2026-04-25 14:39:43 -07:00
Christos Longros 207202cde3 ZTS: fix trim test portability for FreeBSD
Replace GNU-specific du flags (--block-size, -B1) and dd conv=nocreat
with POSIX compatible commands. Move -O flag before pool name in
zpool create to align with FreeBSD's strict POSIX getopt(). Relax vdev
size thresholds in trim_config to account for ZFS-on-ZFS overhead.
Add sync_pool before zpool trim -w to ensure freed blocks are committed
before trimming.

Skip zpool_trim_partial, zpool_trim_verify_trimmed, trim_config, and
autotrim_config on FreeBSD where trim does not reclaim space on file
vdevs stored on a ZFS filesystem within the test framework.

Tested on FreeBSD 16.0-CURRENT: 26 PASS, 4 SKIP, 0 FAIL.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18398
2026-04-22 15:46:41 -07:00
Christos Longros 7f9a480698 ZTS: remove outdated FreeBSD skip from trim tests
FreeBSD has supported hole punching via fspacectl(2) since
FreeBSD 14.0 and the test library already handles this using
truncate -d. Remove the skip that prevented trim tests from
running on FreeBSD.

Tests will still skip if the hardware does not support
TRIM/UNMAP, which is checked separately via diskinfo.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18398
2026-04-22 15:46:12 -07:00
Christos Longros 76c0821807 ure: add USB device IDs for additional RTL8152/RTL8153 adapters
Add device IDs for several USB Ethernet adapters that use
RTL8152 and RTL8153 chips but are not yet recognized by ure(4).
This includes adapters from Cisco/Linksys, D-Link, Lenovo,
Microsoft Surface, Realtek, Samsung, and TP-Link.

All added devices use chip revisions already handled by
ure_read_chipver().

Signed-off-by: Christos Longros <[email protected]>

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D55748
2026-04-21 07:14:09 -07:00
Christos Longros 1cebe8a38e libzfs: report invalid permission name in zfs allow
zfs allow with a typo (e.g. "snapshop") produced the misleading
error "operation not applicable to datasets of this type".  Report
"invalid permission" instead.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18401
Closes #11903
2026-04-20 10:15:29 -07:00
Christos Longros 7fdd2bf7d4 libzfs: report permission error from umount helper
Non-root callers got "unmount failed" when ZFS_MOUNT_HELPER was set
because /bin/umount's exit status doesn't preserve errno.  Map a
non-zero helper exit to EPERM when geteuid() != 0 so the user sees
"permission denied".

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #11740
Closes #18443
2026-04-20 10:02:26 -07:00
Christos Longros d9e7dd4a19 carp: define CARP_AUTHLEN for carp_authlen field
Replace the bare 7 with a named constant.
2026-04-17 11:32:01 -07:00
Christos Longros 9a4a9f623b ping6: treat setsockopt failures as fatal
ping6 needs IPV6_RECVPKTINFO and IPV6_RECVHOPLIMIT to process
incoming replies. When these options fail, replies are silently
dropped and ping6 appears to hang. Use err(3) instead of warn(3)
so the user gets a clear error and immediate exit.

Signed-off-by: Christos Longros <[email protected]>

Reviewed by:	pouria, jlduran, glebius
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56237
2026-04-17 18:19:39 +00:00
Christos Longros 4390c37b5c rge: add disable_aspm tunable for PCIe power management
Add a per-interface loader tunable dev.rge.%d.disable_aspm to
disable PCIe ASPM (L0s/L1) and ECPM on the RTL8125/8126/8127.

Disabling ASPM reduces latency at the cost of higher power
consumption. Default is off (ASPM left as configured by BIOS).

Signed-off-by: Christos Longros <[email protected]>

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D56103
2026-04-16 19:34:55 -07:00
Christos Longros 4b4ae48f9a deb.am: propagate build errors in native-deb targets
Replace semicolons with && so build failures are not masked by the
subsequent lockfile cleanup.  Use trap to ensure the lockfile is
removed on both success and failure.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18206
Closes #18424
2026-04-15 14:50:20 -07:00
Christos Longros fc68534a9a rge: add Wake-on-LAN support for magic packet
Advertise IFCAP_WOL_MAGIC when PCI power management is available
and enable it by default.  On suspend or shutdown, rge_setwol()
enables the WOL_MAGIC and WOL_LANWAKE bits in CFG3/CFG5, disables
the RXDV gate, and enables PM so the NIC stays powered to watch
for magic packets.

Move hardware-specific WOL register configuration into
rge_wol_config() in if_rge_hw.c to keep hardware-specific
functions in sync with OpenBSD.

Update rge.4 to document WoL support.

Tested on FreeBSD 16.0-CURRENT bare metal with Realtek RTL8125
on a Gigabyte B650 Gaming X AX motherboard.

Signed-off-by: Christos Longros <[email protected]>

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D56259
2026-04-10 10:31:38 -07:00
Christos Longros 1ff1f13a87 vdevprops: remove unused slow_io defaults, fix documentation
Remove the unused DEFAULT_SLOW_IO_N and DEFAULT_SLOW_IO_T defines
from zfs_diagnosis.c.  Unlike the checksum and I/O thresholds, the
slow_io_n and slow_io_t properties must be manually opted in and
have no built-in defaults.  The defines were misleading.

Update the vdevprops man page to clarify that slow_io_n and
slow_io_t must be manually set, and that the documented defaults
(10 errors in 600 seconds) apply only to checksum and I/O events.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18359
2026-04-06 09:30:46 -07:00
Christos Longros 33ed68fc24 zpool create: report which device caused failure
When zpool create fails because a vdev is already in use, the
error message now identifies the problematic device and the pool
it belongs to, e.g.:

  cannot create 'tank': device '/dev/sdb1' is part of
  active pool 'rpool'

Implementation follows the ZPOOL_CONFIG_LOAD_INFO pattern used
by zpool import:

  - Add spa_create_info to spa_t to capture error info during
    vdev_label_init(), before vdev_close() resets vdev state
  - When vdev_inuse() detects a conflict, read the on-disk
    label to extract the pool name and store it with the
    device path
  - Return the info wrapped under ZPOOL_CONFIG_CREATE_INFO
    through the ioctl zc_nvlist_dst to userspace
  - In libzfs, zpool_create_info() unwraps the nvlist and
    formats the device-specific error message

Restructure zpool_create() error handling so all switch cases
use break instead of return, eliminating duplicated cleanup
code and using the single create_failed exit path.

Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18213
2026-04-03 14:18:24 -07:00
Christos Longros a7157221db AUTHORS: add Christos Longros
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18396
2026-04-03 11:17:08 -07:00
Christos Longros 74504cf7fd zinject: add numeric suffix support for -r range
Parse range values with zfs_nicestrtonum() instead of strtoull()
so that -r accepts human-readable suffixes (K, M, G, T, P, E).

For example: zinject -r 1G,2G /pool/file

Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18374
2026-04-01 13:53:56 -07:00
Christos Longros 0f86f244ce ZTS: re-enable send_raw_ashift on FreeBSD
The test was skipped on FreeBSD since 2023 (#14961) due to exceeding
the 10-minute CI timeout on FreeBSD 14.  CI runs on the fork now show
the test completes well within limits:

  FreeBSD 14.3-RELEASE:  10 seconds
  FreeBSD 15.0-STABLE:   11 seconds
  FreeBSD 16.0-CURRENT:  14 seconds

Remove the FreeBSD skip and the corresponding known skip entry.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18389
2026-04-01 13:13:56 -07:00
Christos Longros 67ec68fd0d zfs.4: document the zfs_arc_free_target parameter
Document the FreeBSD-specific zfs_arc_free_target tunable which
controls the number of free pages below which the ARC triggers
reclaim. Note its initialization from vm.v_free_target and its
distinction from the Linux-specific zfs_arc_sys_free.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18350
2026-03-31 15:42:00 -07:00
Christos Longros 78dd098768 dbufstat: add man page
Add a manual page for the dbufstat(1) utility which displays
statistics about the DMU buffer cache. Document all options,
fields, and include sample output from a live FreeBSD system.

Also add dbufstat.1 to Makefile.am and Debian packaging.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18358
2026-03-31 15:11:21 -07:00
Christos Longros 2e1dd5760b doc: note that resilver progress can exceed 100%
Document that both scrubs and resilvers can progress beyond 100%
completion due to concurrent writes on a live system. Remove
"slightly" from the existing scrub note as progress can
exceed 100%.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #17693
Closes #18338
2026-03-31 09:56:07 -07:00
Christos Longros 59cb18f356 vmgenc.4: Add VM Generation ID Counter manual
Document the vmgenc(4) ACPI driver which detects virtual machine
cloning and snapshot restoration via the VM Generation ID
specification. The driver reseeds the kernel entropy pool when
a generation change is detected.

MFC after:		3 days
Reviewed by:		cem (previous), ziaee
Signed-off-by:		Christos Longros <[email protected]>
Differential Revision:	https://reviews.freebsd.org/D56011
2026-03-30 22:31:43 -04:00
Christos Longros 3667b04734 zfs-set.8: document the received column and -o all option
The received column was missing from the list of columns displayed
by zfs get. Document it and note that it is not shown by default.

Also document the "all" keyword for the -o option, which selects
all five columns, and list the supported field names.

Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18349
Closes #10420
2026-03-30 17:06:35 -07:00
Christos Longros f3fc362c0f bluetooth: remove redundant 0x0bda entries from ng_ubt_rtl, rtlbtfw
Generic Realtek vendor rules already match all 0x0bda Bluetooth devices.
Remove the redundant per-product entries from ng_ubt_rtl.c,
rtlbtfw main.c, and rtlbtfw.conf.

Reviewed by:	wulf
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D56137
2026-03-29 22:00:59 +03:00
Christos Longros d82bcf5681 bluetooth: add device IDs for Intel AX411 and BE200 adapters
Add USB product IDs for Intel AX411 (0x0035) and BE200 (0x0036)
Bluetooth adapters to ng_ubt_intel, ng_ubt, iwmbtfw, and iwmbtfw.conf.

Both chips use the same TLV-based firmware protocol as the existing
9260/9560 entries.  Newer Blazar-generation chips (BE201, BE202,
Whale Peak 2) are omitted as they require IML support not yet
implemented in iwmbtfw.

Signed-off-by: Christos Longros <[email protected]>

Reviewed by:	wulf
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56122
2026-03-29 16:16:57 +03:00
Christos Longros ccc235fe02 vmgenc: fix typo in MODULE_DEPEND declaration
The random_harvestq dependency was registered under the misspelled
name "vemgenc" instead of "vmgenc", causing the dependency to not
be associated with the correct module.

Signed-off-by: Christos Longros <[email protected]>
Reviewed by: cem, imp
Differential Revision:	https://reviews.freebsd.org/D56012
2026-03-27 22:03:35 -06:00
Christos Longros 6cf1afeccd newsyslog: check for rename failure during log rotation
Differential Revision:	https://reviews.freebsd.org/D56088
2026-03-27 12:28:42 -07:00
Christos Longros 930a790c2a rge: make rx_process_limit a sysctl tunable
The number of packets processed per interrupt was hardcoded to 16.
Add a per-interface sysctl dev.rge.%d.rx_process_limit tunable so
users can adjust this value at runtime.

Signed-off-by: Christos Longros <[email protected]>

Reviewed by:	ziaee, adrian
Differential Revision:	https://reviews.freebsd.org/D56014
2026-03-24 18:27:14 -07:00
Christos Longros 8f36a012d6 rge.4: fix incorrect speed range in HARDWARE section
The HARDWARE section stated "PCIe 1GB to 1GB Ethernet devices"
which is incorrect. The RTL8125/8126/8127 chips support speeds
from 1Gbps to 10Gbps. Correct the range.

Signed-off-by: Christos Longros <[email protected]>

rge.4: note that the driver manages PHY directly

The rge(4) driver does not use the miibus(4) interface for PHY
management. Instead, it accesses PHY registers directly via the
chip's OCP (On-Chip Peripheral) bus. Document this in the
DESCRIPTION section.

Signed-off-by: Christos Longros <[email protected]>

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D55995
2026-03-24 18:26:10 -07:00
Christos Longros 08d7a62673 ci: update FreeBSD CI images from 14.3 to 14.4
Update FreeBSD CI targets from 14.3 to 14.4 in both the QEMU
start script and the workflow configuration.

Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18362
2026-03-23 10:34:10 -07:00
Christos Longros a45929021a zpool-list.8: clarify that only imported pools are listed (#18352)
The man page stated "all pools in the system are listed" which is
misleading, as only imported pools are shown. Clarify this and
add a cross-reference to zpool-import(8) for discovering pools
available for import.

Signed-off-by: Christos Longros <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
2026-03-23 09:21:08 -07:00
Christos Longros f259a47c74 zpool-iostat.8: clarify first report shows per-second averages
The first report printed by zpool iostat shows average per-second
values since boot, not cumulative totals. Clarify this in the man
page to avoid user confusion.

Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18337
2026-03-18 10:48:04 -07:00
Christos Longros f80338facc zarcsummary: add man page
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18330
2026-03-16 11:08:05 -07:00
Christos Longros f9d26b88b7 zilstat: add AUTHORS section to man page
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18329
2026-03-16 11:07:27 -07:00
Christos Longros 9976cff55e rge: use C style comments instead of C++
FreeBSD style(9) mandates C style comments. The initial import from
OpenBSD left several C++ style // comments in if_rge.c and if_rgevar.h.
Replace them with proper /* */ comments.

Also fix a malformed comment that mixed // with a closing */.

Signed-off-by: Christos Longros <[email protected]>

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D55743
2026-03-15 13:10:59 -07:00
Christos Longros 462a1f6197 resolver.5: document six previously undocumented options
Document the edns0, inet6, insecure1, insecure2, no-check-names,
and rotate options which are parsed by res_init(3) but were not
described in the resolver(5) man page.

MFC after:	1 week
Signed-off-by:	Christos Longros <[email protected]>
Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D55864
2026-03-15 16:17:08 +01:00
Christos Longros e6f4e4ab8a re(4), rge(4): improve Realtek driver man pages
Add D-Link DGE-530(T) and Killer E2600 to the re(4) HARDWARE list.
Both are supported by the driver but were missing from the man page.

Also add cross-references between re(4) and rge(4) in SEE ALSO,
as both are Realtek NIC drivers.

Signed-off-by: Christos Longros <[email protected]>

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D55745
2026-03-14 14:35:20 -07:00
Christos Longros d35951b18d zpool clear: remove undocumented rewind flags
Remove the -F, -n, and -X flags from zpool clear.  These flags were
inherited from OpenSolaris but are not applicable in this context.
Unlike zpool import, where the pool is not yet loaded and a specific
TXG can be selected, zpool clear operates on an already imported pool
whose in-memory state is ahead of what is on disk.  Rewinding
transactions would require force-exporting the pool first.

The rewind policy passed to zpool_clear() is now always
ZPOOL_NO_REWIND.

Tested on FreeBSD 16.0-CURRENT (amd64).  Verified that -F, -n, and
-X are properly rejected as invalid options and that the usage output
reflects the change.

Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #13825
Closes #18300
2026-03-11 15:15:45 -07:00
Christos Longros 65165df129 zilstat: add man page
The zilstat command has no man page. Add zilstat.1 documenting all
options and field definitions based on the source in cmd/zilstat.in.

Reviewed-by: Ameer Hamza <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18303
2026-03-11 15:11:41 -07:00
Christos Longros 6ccfa67ac4 Fix typos in manual pages
bpf.4: accomodate -> accommodate
hier.7: compatability -> compatibility
namei.9: succesfull -> successful

Signed-off-by: Christos Longros <[email protected]>
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D55746
2026-03-09 14:34:27 -04:00
Christos Longros 304de7f19b libzfs: handle EDOM error in zpool_create
When creating a pool with devices that have incompatible block sizes,
the kernel returns EDOM. However, zpool_create() did not handle this
errno, falling through to zpool_standard_error() which produced a
confusing message about invalid property values.

Add a case EDOM handler in zpool_create() to return EZFS_BADDEV with
a descriptive auxiliary message, consistent with the existing EDOM
handler in zpool_vdev_add().

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18268
2026-03-08 12:59:10 -07:00
Christos Longros 71e8b32415 src.conf.5: Fix "incompatibility" typo
MFC after:	3 days
Reviewed by:	ziaee
Signed-off-by:	Christos Longros <[email protected]>
Closes:		https://github.com/freebsd/freebsd-src/pull/2035
2026-03-04 13:32:33 -05:00
Christos Longros 6a717f31e6 Improve misleading error messages for ZPOOL_STATUS_CORRUPT_POOL
When devices are missing or claimed by another subsystem (e.g.
mdadm, LVM), zpool import reports "The pool metadata is corrupted"
and suggests destroying the pool. This is misleading because the
metadata is not necessarily corrupted -- it may simply be incomplete
due to inaccessible devices.

Update the status, action, and recovery messages to acknowledge
that missing devices can trigger this status, and suggest checking
device availability before resorting to pool destruction.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Chris Longros <[email protected]>
Closes #18251
Closes #8236
2026-02-23 09:41:24 -08:00
Christos Longros acbf7498f5 rge: log silicon revision during attach
The initial import from OpenBSD contained chip revision printf() calls
commented out, as OpenBSD's bare printf() style does not translate to
FreeBSD's device_printf() idiom. The result is that users cannot
distinguish RTL8125 from RTL8125B, RTL8125D_1, RTL8125D_2 etc. via
dmesg alone, even though all variants show as '<RTL8125>' from the PCI
probe string.

Add proper device_printf() calls including the raw hwrev value,
consistent with how re(4) reports chip revisions.

Signed-off-by: Christos Longros <[email protected]>

Reviewed by:	zlei, imp, adrian
Differential Revision:	https://reviews.freebsd.org/D55402
2026-02-22 10:07:37 -08:00
Christos Longros 102fed041d src.conf.5: Fix "incompatibility" typo
MFC after:	3 days
Reviewed by:	ziaee
Signed-off-by:	Christos Longros <[email protected]>
Closes:		https://github.com/freebsd/freebsd-src/pull/2035
2026-02-20 12:20:31 -05:00
Christos Longros 040ba7a7ca libzfs: improve error message for zpool create with ENXIO
When zpool create fails because a vdev cannot be opened (ENXIO),
the error falls through to zpool_standard_error() which reports
the generic 'one or more devices is currently unavailable'. This
is misleading when the real cause is a block size mismatch or
other device open failure.

Add an explicit ENXIO case in zpool_create()'s error handling to
provide a more descriptive message.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christos Longros <[email protected]>
Closes #18184
Closes #11087
2026-02-10 13:19:44 -08:00