aboutsummaryrefslogtreecommitdiff
path: root/cddl/usr.sbin
Commit message (Collapse)AuthorAgeFilesLines
* zfsd: Improve spare selectionAlexander Motin2026-06-251-34/+155
| | | | | | | | | | | | | | | Port OpenZFS PRs #18597 and #18578 from zed to zfsd. When activating a spare, sort candidates before trying them: 1. Distributed dRAID spare matching the failed vdev's group (fastest rebuild via sequential resilver) 2. Regular spares 3. Non-matching distributed spares (kernel will reject anyway) 4. Within each tier: prefer rotational match, then smallest sufficient size Also try all healthy spares in order rather than stopping at the first one, and use sequential rebuild for distributed spares.
* Remove -fms-extensions throughout the treeBjoern A. Zeeb2026-04-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During a discussion about using -fms-extensions jhb pointed out that we have them enabled in the kernel for gcc by default (even multiple times in one part). I had missed all that and clang still failed on my use case (needing another option). The original cause for enabling them for our tree back then was that we needed to support C11 anonymous struct/unions. Our in-tree gcc 4.2.1, despite later patches, needed the -fms-extensions to support these even though this was not the expected use case for that option ( cc4a90c445aa0 enabled it globally for the kernel). clang at that time (or at least when it became default for 10.0) already was fine (with C11). Any later gcc (4.6.0 onwards) did not need that option anymore, even when compiled for -std=iso9899:1990 (which does not support anonymous structs/unions) unless one would add -pedantic (see gcc git 4bdd0a60b27a). This is also the reason why userland cddl sources now compile with the option removed despite CSTD=c99. The only driver which needed the option recently was ccp, but that was fixed in 8d3f41dbcb2a by jhb. So cleanup all uses cases of -fms-extensions for the moment as they are no longer needed given all compilers currently supported seem to be fine without them and gcc-4.2.1 was removed from the tree in stable/13 in 2020 (a9854bc3812b). Reported by: jhb (all this but possibly the world CDDL parts) Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste (earlier), imp, jhb, glebius Differential Revision: https://reviews.freebsd.org/D55072
* zfs: merge openzfs/zfs@3ee08abd2Martin Matuska2026-03-192-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #17000 -multiple cmd/zfs: support creating parents with canmount=no #17926 b481a8bbb Make zpool status dedup table support raw bytes -p output #18238 -multiple Report space metrics per allocation class #18240 5dad9459d Add --no-preserve-encryption flag #18257 1eace5906 libzfs: use mount_setattr for selective remount including legacy mounts #18259 1e2c94a04 More consistent use of TREE_* macros in AVL comparators #18262 c58b8b7dc Fix check for .cfi_negate_ra_state on aarch64 #18264 f109c7bb9 Add the --file-layout (-f) option to zdb(8) #18268 304de7f19 libzfs: handle EDOM error in zpool_create #18275 753f1e1e2 zstream: add a drop_record subcommand #18276 0f90a797d Fix vdev_rebuild_range() tx commit #18277 1e1d64d66 Fix log vdev removal issues #18278 06b0abfe6 Fix the send --exclude option to work with encryption #18281 e73ada771 libzpool: lift zfs_file ops out to separate source file #18284 d97945776 zstream: consolidate shared code #18285 -multiple Separate SIMD compile checks for userspace and kernel #18288 c5905b2cb Implement lzc_send_progress #18289 -multiple L2ARC: Add depth cap and write budget fairness for persistent markers #18290 d45c8d648 FreeBSD: Improve dmesg kernel message prefix #18294 b403040c4 draid: fix data corruption after disk clear #18296 -multiple libzfs: mnttab cleanup #18300 d35951b18 zpool clear: remove undocumented rewind flags #18301 ae7fcd5f9 fix libzfs diff mem leak in an error path #18303 65165df12 zilstat: add man page #18314 7f65e04ab libzfs: scrub: only include start and end nv pairs if needed for scrub #18315 -multiple Sync ZVOLs block cloning conditions with file systems #18330 f80338fac zarcsummary: add man page #18337 f259a47c7 zpool-iostat.8: clarify first report shows per-second averages Obtained from: OpenZFS OpenZFS commit: 3ee08abd2fcef3123188e9ad61a9cd80b9b7831c
* zfs: unbreak build after 89f729dcc mergeMartin Matuska2025-12-082-1/+2
| | | | Link zfsd against spl and pthread
* zfs: world changes after 89f729dcc mergeMartin Matuska2025-12-074-4/+2
| | | | | Remove, unbind and obsolete libuutil and libtpool Update zfs_configh and zfs_gitrev.h
* Use ZFSTOP more broadlyJohn Baldwin2025-11-246-21/+21
| | | | | | Reviewed by: brooks Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D53791
* Centralize definition of ZFSTOPJohn Baldwin2025-11-242-4/+0
| | | | | | | | | Define this helper variable in one place and make it available while building the entire base system. Reviewed by: sjg Obtained from: CheriBSD (mostly) Differential Revision: https://reviews.freebsd.org/D53790
* zfs: fix build after openzfs/zfs@e63d026b9Martin Matuska2025-11-175-3/+6
| | | | | Fix Makefiles Update zfs_config.h and zfs_gitrev.h
* zfs: install zhack(1) manual pageGleb Smirnoff2025-08-141-2/+5
|
* zfsd: don't try to fix an OFFLINE conditionAlan Somers2025-08-042-2/+23
| | | | | | | | | | If the system administrator does "zpool offline", he's doing it for a reason. zfsd shouldn't consider an offline disk to be an event that requires automatic healing. Don't online it in response to a GEOM event, and don't try to activate a hotspare to take over from it. MFC after: 2 weeks Sponsored by: ConnectWise
* libdtrace: Permit taking the address of an identifier without type infoMark Johnston2025-07-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Symbols defined using assembler directives lack type info, but in this case one ought to be able to cast a pointer to the symbol and dereference the pointer to get a value. Without this change, D disallows this trick since it requires all identifiers to have a type. Relax the rules slightly and allow an identifier to have type "void" if we know we're just taking its address. As a result, the following dtrace invocation works: dtrace -n 'tick-1s {printf("%d", *(int *)&`ticks);}' In particular, since commit b2b974f7ef4c ("clock: Simplify subr_ticks and rename"), "ticks" does not have any type info associated with it, so its value couldn't be printed. This trick provides a workaround and is probably generally useful. Add a regression test which exercises this functionality. PR: 287752 Reviewed by: avg MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D51417
* Note that bash(1) is from a port.Jens Schweikhardt2025-04-191-2/+2
|
* dtrace tests: Fix the ATF config variable nameMark Johnston2025-01-231-1/+1
| | | | | Fixes: 6e6a67e98652 ("dtrace tests: Avoid hard-coding paths to required programs") Sponsored by: Innovate UK
* dtrace tests: Avoid hard-coding paths to required programsMark Johnston2025-01-221-1/+1
| | | | | MFC after: 1 week Sponsored by: Innovate UK
* manuals: Fix "skipping end of block" .El errorsGraham Percival2024-10-071-1/+0
| | | | | | | | | | | | | These were reported by `mandoc -T lint ...` as errors; this commit only handles unnecessary .El commands. The rendered output (in ascii and html) is not affected by this commit. Signed-off-by: Graham Percival <gperciva@tarsnap.com> Reviewed by: mhorne MFC after: 3 days Sponsored by: Tarsnap Backup Inc. Pull Request: https://github.com/freebsd/freebsd-src/pull/1447
* zfsd: replace vdevs with the AUX faulted stateAlan Somers2024-10-031-1/+1
| | | | | | | | | | | | Without this patch, vdevs faulted via AUX state would not be replaced once the appropriate drive is replaced. ZFS does not internally use that state, but a drive can be manually forced into such a state with a command like zinject. Submitted by: Goran Mekić <meka@tilda.center> Sponsored by: ConnectWise MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46866
* dtrace tests: Add a test case which validates FBT probe argumentsMark Johnston2024-09-191-0/+2
| | | | | | Reviewed by: avg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46674
* zfs: merge openzfs/zfs@b10992582Martin Matuska2024-09-093-0/+3
| | | | | | | | | | | | | | | | | Notable upstream pull request merges: #15892 -multiple Fast Dedup: Introduce the FDT on-disk format and feature flag #15893 -multiple Fast Dedup: “flat” DDT entry format #15895 -multiple Fast Dedup: FDT-log feature #16239 6be8bf555 zpool: Provide GUID to zpool-reguid(8) with -g #16277 -multiple Fast Dedup: prune unique entries #16316 5807de90a Fix null ptr deref when renaming a zvol with snaps and snapdev=visible #16343 77a797a38 Enable L2 cache of all (MRU+MFU) metadata but MFU data only #16446 83f359245 FreeBSD: fix build without kernel option MAC #16449 963e6c9f3 Fix incorrect error report on vdev attach/replace #16505 b10992582 spa_prop_get: require caller to supply output nvlist Obtained from: OpenZFS OpenZFS commit: b109925820fb79db3e37670c159977f03edd950f
* zfsd tests: Update the mock zpool_handleMark Johnston2024-08-291-0/+3
| | | | | | | | The zfsd tests rely on this having the same layout as the real zpool_handle, which changed in the last OpenZFS import. Fixes: 62e7d3c89ebd ("ddt: add support for prefetching tables into the ARC") Reported by: Jenkins
* zdb: Chase a missing library dependencyMark Johnston2024-07-181-1/+1
| | | | Fixes: 75e1fea68aaa ("zfs: merge openzfs/zfs@1147a2797")
* Remove residual blank line at start of MakefileWarner Losh2024-07-1518-18/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* dtrace tests: Regenerate makefiles after commit d0b2dbfa0ecfMark Johnston2024-06-0189-89/+0
|
* dtrace tests: Fix loading of the test kernel moduleMark Johnston2024-06-011-1/+1
| | | | | | | | The old way is racy and can cause two instances, running in parallel, to attempt to load dtrace_test, and only one will succeed. This caused errors when running dtrace tests in parallel. MFC after: 1 week
* zfsd: fix unit tests after 89f4f91dbfdcabe65bc7476bc5f13dfb837870feAlan Somers2024-04-132-1/+4
| | | | | | | | | Reported by: markj MFC after: 1 week MFC with: 89f4f91dbfdcabe65bc7476bc5f13dfb837870fe Sponsored by: Axcient Reviewed by: Alek Pinchuk <pinchuk.alek@gmail.com> Differential Revision: https://reviews.freebsd.org/D44744
* zfsd: Use vdev prop values for fault/degrade thresholdsAlan Somers2024-03-053-43/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | ZED uses vdev props for setting disk fault/degrade thresholds, this patch enables zfsd to use the same vdev props for these same tasks. OpenZFS on Linux is using vdev props for ZED disk fault/degrade thresholds. Originally the thresholds supported were for io and checksum events and recently this was updated to process slow io events as well, see https://github.com/openzfs/zfs/commit/cbe882298e4ddc3917dfaf239eca475fe06d62d4 This patch enables us to use the same vdev props in zfsd as ZED uses. After this patch is merged both OSs will use the same vdev props to set retirement thresholds. It's probably important to note that the threshold defaults are different between OS. I've kept the existing defaults inside zfsd and DID NOT match them to what ZED does. Differential Revision: https://reviews.freebsd.org/D44043 MFC after: 2 weeks Relnotes: yes Reviewed by: asomers, allanjude Sponsored by: Axcient Submitted by: Alek Pinchuk <apinchuk@axcient.com>
* zfs: merge openzfs/zfs@229b9f4edMartin Matuska2024-02-081-1/+1
| | | | | | | | | | Notable upstream pull request merges: #15769 082338875 Add 'zpool status -e' flag to see unhealthy vdevs #15804 a0d3fe72b libzdb: Initial breakout of libzdb #15847 229b9f4ed LUA: Backport CVE-2020-24370's patch Obtained from: OpenZFS OpenZFS commit: 229b9f4ed05e6d14fb4d73fa04a71e99b01bb534
* dtrace tests: Diff expected and actual output upon a miscompareMark Johnston2024-01-101-0/+4
| | | | | | This makes quick diagnosis of test failures easier. MFC after: 1 week
* dtrace tests: Require perlMark Johnston2024-01-101-1/+1
| | | | | | | A number of tests use it, so just require it globally as we do with other tools. MFC after: 1 week
* dtrace tests: Run ksh with -pMark Johnston2024-01-101-2/+2
| | | | | | | | In particular, avoid loading the user's .profile file, since that can have undesirable side effects. Most tests were already careful to do this. MFC after: 1 week
* dtrace: Add the 'oformat' libdtrace optionDomagoj Stolfa2024-01-104-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This option can be used to specify a format to use in DTrace output. The following formats are supported: - json - xml - html - none (default DTrace output) This is implemented using libxo and integrated into libdtrace. Client code only works with the following API: - dtrace_oformat_setup(dtrace_hdl_t *) -- to be called when output is starting. - dtrace_oformat_teardown(dtrace_hdl_t *) -- to be called when output is finished - dtrace_oformat(dtrace_hdl_t *) -- check if oformat is enabled. - dtrace_set_outfp(FILE *) -- sets the output file for oformat. - Ensure that oformat is correctly checked in the drop handler and record processing callbacks. This commit also adds tests which check if the generated output is valid (JSON, XML) and extends the dtrace(1) describing the structured output. Reviewed by: markj Discussed with: phil MFC after: 2 months Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D41745
* libc: expose execvpe for Linux compatBrooks Davis2023-12-111-1/+1
| | | | | | | | | | | | | | We already implemented execvpe internally with an _ prefix in libc so go ahead and expose it for compatibility with Linux. This reverts c605eea952146348e5e1ad5cab6c127d7a1bd164. Bump __FreeBSD_version for the addition and add definitions to supress compat shims in libzfs (zfs changes were merged from upstream). PR: 275370 (request and exp-run (thanks antoine!)) Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D42846
* zfsd: fault disks that generate too many I/O delay eventsAlan Somers2023-11-293-4/+88
| | | | | | | | | | | | If ZFS reports that a disk had at least 8 I/O operations over 60s that were each delayed by at least 30s (implying a queue depth > 4 or I/O aggregation, obviously), fault that disk. Disks that respond this slowly can degrade the entire system's performance. MFC after: 2 weeks Sponsored by: Axcient Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D42825
* Trim various $FreeBSD$John Baldwin2023-10-101-1/+0
| | | | | | Approved by: markj (cddl/contrib changes) Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41961
* Fix zfsd with the device_removal pool feature.Alan Somers2023-09-122-4/+38
| | | | | | | | | | | | | | | | | | Previously zfsd would crash in the presence of a pool with a top-level-vdev that had previously been removed. The crash happened because the configuration nvlist of such a TLV contains an empty ZPOOL_CONFIG_CHILDREN array, which led to a pop_front from an empty list, which has undefined behavior. The crash only happened in stable/14 and later, probably do to differences in libcxx, but the change should be MFCed anyway. PR: 273663 Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl> MFC after: 1 week Sponsored by: Axcient Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D41818
* dtrace: Remove $FreeBSD$ from genmakefiles.sh.Domagoj Stolfa2023-08-251-2/+0
| | | | | | | $FreeBSD$ is gone in head, so this should be removed as well. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D41595
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-163-6/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-16223-224/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-167-18/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-1614-28/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* dtrace: Add WITH_DTRACE_ASANDomagoj Stolfa2023-08-023-0/+19
| | | | | See commit 4ae6991228105eb34989c870194ae7b0a1e23be4. This version of the commit avoids inadvertently changing SHLIBDIR for libdtrace.so.
* dtrace: Revert the addition of WITH_DTRACE_ASANMark Johnston2023-08-013-19/+0
| | | | | The follow-up fix triggers a lib32 build failure, revert everything until the problem is addressed.
* dtrace: Add WITH_DTRACE_ASANDomagoj Stolfa2023-07-273-0/+19
| | | | | | | | | | | | | | | | This option is a blanket for all the DTrace-related software. The option when enabled passes in -fsanitize=address -fsanitize=undeifned, enabling ASAN and UBSAN in the following components: - libdtrace - dtrace(1) - lockstat(1) - plockstat(1) The option defaults to "no" and is intended as a developer aid. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D41157
* Fix zfsd unittests after 92642bba4dbAlan Somers2023-07-141-3/+3
| | | | | | | | | At the time we ensured that the more important functional tests were working, but neglected to update the unit tests. MFC after: 2 weeks MFC with: 92642bba4db4bf1719758ac7233468bc09a0bd59 Sponsored by: Axcient
* zfsd: listen for sysevent.fs.zfs instead of misc.fs.zfsAlan Somers2023-07-103-9/+9
| | | | | | | | | | | At some point the names of these devd events changed. Probably it happened when importing OpenZFS. Before that, FreeBSD's sysevent_alloc method didn't create a "class" nvpair in the event, which led to log_sysevent using the event's ev_subclass field as its type. MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D39437
* dtrace: move kinst tests to commonChristos Margiolis2023-07-043-2/+2
| | | | | | | Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40414
* zfsd: Fix typo in commentElyes Haouas2023-06-021-1/+1
| | | | | | Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/653
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-196-52/+7
|
* zfsd: add support for hotplugging sparesAlan Somers2023-04-064-8/+69
| | | | | | | | | | | | | | If you remove an unused spare and then reinsert it, zfsd will now online it in all pools. Do not MFC without 2a58b312b62 (but it's ok to MFC that one without this one). Submitted by: Ameer Hamza <ahamza@ixsystems.com> (zfsd), Me (tests) MFC after: 2 weeks MFC with: 2a58b312b62f908ec92311d1bd8536dbaeb8e55b Sponsored by: iX Systems, Axcient Pull Request: https://github.com/freebsd/freebsd-src/pull/697
* zfs: merge openzfs/zfs@431083f75Martin Matuska2023-04-034-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #12194 Fix short-lived txg caused by autotrim #13368 ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced() #13392 Implementation of block cloning for ZFS #13741 SHA2 reworking and API for iterating over multiple implementations #14282 Sync thread should avoid holding the spa config write lock when possible #14283 txg_sync should handle write errors in ZIL #14359 More adaptive ARC eviction #14469 Fix NULL pointer dereference in zio_ready() #14479 zfs redact fails when dnodesize=auto #14496 improve error message of zfs redact #14500 Skip memory allocation when compressing holes #14501 FreeBSD: don't verify recycled vnode for zfs control directory #14502 partially revert PR 14304 (eee9362a7) #14509 Fix per-jail zfs.mount_snapshot setting #14514 Fix data race between zil_commit() and zil_suspend() #14516 System-wide speculative prefetch limit #14517 Use rw_tryupgrade() in dmu_bonus_hold_by_dnode() #14519 Do not hold spa_config in ZIL while blocked on IO #14523 Move dmu_buf_rele() after dsl_dataset_sync_done() #14524 Ignore too large stack in case of dsl_deadlist_merge #14526 Use .section .rodata instead of .rodata on FreeBSD #14528 ICP: AES-GCM: Refactor gcm_clear_ctx() #14529 ICP: AES-GCM: Unify gcm_init_ctx() and gmac_init_ctx() #14532 Handle unexpected errors in zil_lwb_commit() without ASSERT() #14544 icp: Prevent compilers from optimizing away memset() in gcm_clear_ctx() #14546 Revert zfeature_active() to static #14556 Remove bad kmem_free() oversight from previous zfsdev_state_list patch #14563 Optimize the is_l2cacheable functions #14565 FreeBSD: zfs_znode_alloc: lock the vnode earlier #14566 FreeBSD: fix false assert in cache_vop_rmdir when replaying ZIL #14567 spl: Add cmn_err_once() to log a message only on the first call #14568 Fix incremental receive silently failing for recursive sends #14569 Restore ASMABI and other Unify work #14576 Fix detection of IBM Power8 machines (ISA 2.07) #14577 Better handling for future crypto parameters #14600 zcommon: Refactor FPU state handling in fletcher4 #14603 Fix prefetching of indirect blocks while destroying #14633 Fixes in persistent error log #14639 FreeBSD: Remove extra arc_reduce_target_size() call #14641 Additional limits on hole reporting #14649 Drop lying to the compiler in the fletcher4 code #14652 panic loop when removing slog device #14653 Update vdev state for spare vdev #14655 Fix cloning into already dirty dbufs #14678 Revert "Do not hold spa_config in ZIL while blocked on IO" Obtained from: OpenZFS OpenZFS commit: 431083f75bdd3efaee992bdd672625ec7240d252
* Retire WITHOUT_CXX optionEd Maste2023-01-271-2/+1
| | | | | | | | | | | | Several important base system components are written in C++, and the WITHOUT_CXX option produced a system that was not fully functional. Just accept this, and remove the option to build without C++ support. This reverts commit adc3c128c6603054586a993d117e5dd808deac17. Reviewed by: brooks, kevans, jhb (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33108