Commit Graph

1516 Commits

Author SHA1 Message Date
Martin Matuska df58e8b150 zfs: merge openzfs/zfs@8302b6e32
Notable upstream pull request merges:
 #16853 894edd084 Add TXG timestamp database
 #17004 -multiple Implement dynamic gang header sizes
 #17405 dea0fc969 ZVOL: Return early, if volmode is ZFS_VOLMODE_NONE
                  on FreeBSD side
 #17455 cf146460c Default to zfs_bclone_wait_dirty=1
 #17481 523d9d600 Validate mountpoint on path-based unmount using statx
 #17482 92da9e0e9 ZVOL: Implement zvol_alloc() function on FreeBSD side
 #17489 dee62e074 spa: ZIO_TASKQ_ISSUE: Use symbolic priority
 #17496 bf846dcb7 Release topology restrictions on special/dedup
 #17497 4e92aee23 Relax special_small_blocks restrictions
 #17503 ea38787f2 Revert "Fix incorrect expected error in ztest"
 #17505 be1e991a1 Allow and prefer special vdevs as ZIL
 #17506 ee0cb4cb8 ztest: Fix false positive of ENOSPC handling
 #17507 92d3b4ee2 zio: rename `io_reexecute` as `io_post`;
                  use it for the direct IO checksum error flag
 #17508 6af8db61b metaslab: don't pass whole zio to throttle reserve APIs
 #17518 4c2a7f85d FreeBSD: Add support for _PC_HAS_HIDDENSYSTEM
 #17521 d7ab07dfb ZIL: Force writing of open LWB on suspend
 #17524 b6e8db509 zpool/zfs: Add '-a|--all' option to scrub, trim,
                  initialize
 #17531 c1e51c55f Correct weight recalculation of space-based metaslabs
 #17533 d323fbf49 FreeBSD: zfs_putpages: don't undirty pages until
                  after write completes
 #17536 b21e04e8d Fix zdb pool/ with -k
 #17537 -multiple Userspace tunables
 #17540 2957eabbe Add support for FreeBSD's Solaris style extended
                  attribute interface
 #17547 4bd7a2eaa zdb: fix checksum calculation for decompressed blocks
 #17551 -multiple cleanup: remove var init/update
 #17561 0f8a1105e Skip dbuf_evict_one() from dbuf_evict_notify()
                  for reclaim thread
 #17563 10a78e264 Faster checksum benchmark on system boot
 #17564 00ce064d8 spa: update blkptr diagram to include vdev padding
                  on encrypted blocks
 #17565 -multiple Physical rewrite
 #17566 fc885f308 Don't use wrong weight when passivating group
 #17572 f70c85086 BRT: Fix ZAP entry endianness
 #17575 0b6fd024a ZVOL: Unify zvol minors operations and improve error
                  handling
 #17581 cb5e7e097 range_tree: Provide more debug details upon unexpected
                  add/remove
 #17587 -multiple Fix two issues with dynamic gang headers

Obtained from:	OpenZFS
OpenZFS commit:	8302b6e32b
2025-08-07 09:06:31 +02:00
Alan Somers a13ddd6210 zfsd: don't try to fix an OFFLINE condition
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
2025-08-04 10:00:52 -06:00
Mateusz Piotrowski 1acfb873cf dtrace.1: Document security.bsd.allow_destructive_dtrace
PR:		288284
Reviewed by:	bcr, markj
MFC after:	3 days
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D51633
2025-08-01 17:23:20 +02:00
Mark Johnston dabde7d976 libdtrace: Permit taking the address of an identifier without type info
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 b2b974f7ef ("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
2025-07-21 14:57:58 +00:00
Mark Johnston 654dea5967 libdtrace: Use a designated array initializer for dt_cook_funcs[]
Also make the array const.  No functional change intended.

MFC after:	1 week
2025-07-21 14:57:58 +00:00
Mateusz Piotrowski 9388c28878 dtrace_fbt.4: Document the DTrace fbt provider
Reported by:	markj
Reviewed by:	christos, markj (earlier version), ziaee
Obtained from:	Mark Johnston, DTrace, FreeBSD Journal, May 2014
Obtained from:	https://wiki.freebsd.org/DTrace/One-Liners
MFC after:	2 weeks
Relnotes:	yes
2025-07-16 12:27:52 +02:00
Mateusz Piotrowski 1fe7af0635 dtrace.1: Document evaltime
Reviewed by:	christos, ziaee
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D51301
2025-07-14 18:38:19 +02:00
Mateusz Piotrowski 46efd2ceca dtrace_profile.4: Document the DTrace profile provider
Event:		Berlin Hackathon 202507
Reviewed by:	bcr, christos
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D51278
2025-07-14 18:35:01 +02:00
Mateusz Piotrowski 193f2289fc d.7: Document the DTrace scripting language
Reviewed by:	bcr, christos, ziaee
Event:		Berlin Hackathon 202507
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D51268
2025-07-14 15:01:51 +02:00
Mateusz Piotrowski a487606afd dtrace_dtrace.4: Document the DTrace dtrace provider
Reviewed by:	bcr, christos
Event:		Berlin Hackathon 202507
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D51267
2025-07-14 14:17:04 +02:00
Mateusz Piotrowski 98a1084001 dtrace.1: Reference dwatch(1) and tracing(7)
Reviewed by:	bcr
Event:		Berlin 2025 Hackathon
2025-07-12 11:35:29 +02:00
Jiacong Fang 12bef37a82 dtrace: fix symbol address resolution
Dtrace assumes only ELF sections of type SHT_PROGBITS or SHT_NOBITS
occupy memory space. However, sections with SHF_ALLOC flag also consume
memory space. Moreover, the symbol address initialization skips symbols
at the very beginning of a section in ET_REL KLDs.

Fix: Check section flag for calculating section offset, and disable the
skipping at the beginning of a section.

PR:		288000
Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D51188
2025-07-07 20:16:31 +00:00
Ricardo Branco 4140012f83 tests: Adapt oclo tests to FreeBSD
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1698
2025-07-06 23:09:10 +00:00
Ricardo Branco 20ee243707 tests: Add Illumos oclo tests for O_CLOEXEC & O_CLOFORK
Taken from last commit bb9475a199514dcace79d04d02c1eff05d65b94f from
https://github.com/illumos/illumos-gate/tree/master/usr/src/test/os-tests/tests/oclo

MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1698
2025-07-06 23:09:05 +00:00
Alan Somers b5962a1837 Fix location of libtpool.so.2 after 5c1ba994a8
Commit 5c1ba994a8 inadvertently moved the installed location of a
shared library.  Move it back.

Reported by:	olivier
Tested by:	olivier
Fixes:		5c1ba994a8
Sponsored by:	ConnectWise
2025-06-26 08:12:04 -06:00
Mark Johnston 7b26124ae1 libtpool/tests: Fix a flaky test
I occasionally see failures due to pthread_barrier_wait() not returning
0.  There is another possible non-error return value, so allow that too.
While here, check the result in tp_delay() as well.

Fixes:		5c1ba994a8 ("Add a regression test for a libtpool bug")
Differential Revision:	https://reviews.freebsd.org/D50967
2025-06-25 17:17:08 +00:00
Ed Maste 6b70ffeb2a ZFS: Fix tests build with FORTIFY_SOURCE
Reviewed by:	kevans
Event:		Kitchener-Waterloo Hackathon 202506
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50876
2025-06-16 10:47:22 -04:00
Alan Somers 5c1ba994a8 Add a regression test for a libtpool bug
Test that tpool_dispatch returns an error if it cannot start even one
worker.  Previously, it would hang.  The test must reside here rather
than in the OpenZFS repo because the latter has no infrastructure for
writing libtpool tests.

https://github.com/openzfs/zfs/issues/16172

MFC after:	2 weeks
Sponsored by:	Axcient
Differential Revision: https://reviews.freebsd.org/D45587
2025-06-15 10:01:37 -06:00
Mateusz Piotrowski 177471148a dtrace.1: Mention providers in SEE ALSO
Reviewed by:	bnovkov, christos, markj
Approved by:	bnovkov (mentor), christos (mentor), markj (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D50852
2025-06-14 19:49:56 +02:00
Alexander Ziaee 3fd42db26c ctfconvert.1: Minor cleanup
Alphabetize option table to improve first glance access.
Markup semantics to differentiate them and add them to apropos.

MFC after:		3 days
Reviewed by:		Pau Amma <pauamma@gundo.com>
Approved by:		mhorne (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D49883
2025-06-13 15:24:12 -04:00
Brooks Davis 8e35800732 build: remove the last vestiges of lint support
Commit 1cbb58886a (shipped in 12.0.0) removed all lint infrastructure.
A bunch of NO_LINT definitions remained (perhaps as a bootstrapping
measture).  Remove them.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D50704
2025-06-06 00:55:34 +01:00
Mark Johnston fdaba0128c dtrace tests: Fix nits in some test programs
Otherwise these tests fail spuriously, depending on which compiler is
installed as cc.

MFC after:	2 weeks
Sponsored by:	Innovate UK
2025-06-04 20:58:38 +00:00
Martin Matuska b1c1ee4429 zfs: merge openzfs/zfs@3084336ae
Notable upstream pull request merges:
 #14876 b048bfa9c Allow opt-in of zvol blocks in special class
 #16486 b6916f995 ARC: parallel eviction
 #17169 1a8f5ad3b zvol: Enable zvol threading functionality on FreeBSD
 #17209 c17bdc491 More aggressively assert that db_mtx protects db.db_data
 #17218 734eba251 Wire O_DIRECT also to Uncached I/O
 #17246 49fbdd453 Introduce zfs rewrite subcommand
 #17255 b1ccab172 ARC: Avoid overflows in arc_evict_adj()
 #17280 848794503 zcp: get_prop: fix encryptionroot and encryption
 #17301 086105f4c Cause zpool scan resume commands to get logged in history
 #17306 246e5883b zfs_valstr: update zio_flag strings for
                  ZIO_FLAG_PREALLOCATED
 #17309 78628a5c1 FreeBSD: Use new SYSCTL_SIZEOF()
 #17314 89a8a9158 ARC: Notify dbuf cache about target size reduction
 #17319 8b9c4e643 spa: clear checkpoint information during retry
 #17339 d5616ad34 Increase meta-dnode redundancy in "some" mode
 #17340 ea74cdedd Fix 2 bugs in non-raw send with encryption
 #17342 e55225be3 Add explicit DMU_DIRECTIO checks
 #17343 d8a33bc0a icp: Use explicit_memset() exclusively in gcm_clear_ctx()
 #17344 -multiple libzfs_core: add ZFS_IOC_TRACE envvar to enable ioctl
                  tracing
 #17348 f0baaa329 arcstat: prevent ZeroDivisionError when L2ARC becomes
                  empty
 #17353 83fa80a55 dmu_objset_hold_flags() should call
                  dsl_dataset_rele_flags() on error
 #17355 -multiple Allow txg_wait_synced_flags() and dmu_tx_assign()
                  to return when the pool suspends
 #17361 5c30b2438 Fix null dereference in spa_vdev_remove_cancel_sync()
 #17363 ddf28f27c Fix off-by-one bug in range tree code
 #17367 06fa8f3f6 zfs_cmd: reorganise zfs_cmd_t to match original size
 #17368 2a91d577b Expose dataset encryption status via fast stat path
 #17372 c464f1d01 Only interrupt active disk I/Os in failmode=continue
 #17373 9d76950d6 ZIL: Improve write log size accounting
 #17377 -multiple tunables: general code cleanup
 #17379 fa697b94e FreeBSD: Add posix_fadvise(POSIX_FADV_WILLNEED) support
 #17384 3dfa98d01 ZVOL: Make zvol_inhibit_dev module parameter
                  platform-independent

Obtained from:	OpenZFS
OpenZFS commit: 3084336ae4
2025-05-30 11:17:41 +02:00
Lexi Winter f9513c334f add packages for libufs, libzfs
currently FreeBSD-utilities depends on both FreeBSD-ufs and FreeBSD-zfs.
this is not desirable, because those are both relatively large packages
and the user may want to remove one or the other – or perhaps both, e.g.
in a jail or embedded system.

the reason for this dependency is that fstyp(8), which is in
FreeBSD-utilities, links both libufs and libzfs.  FreeBSD-utilities is
the correct place for fstyp, so we don't want to move that.

instead, add two new packages: libufs contains libufs, and libzfs
contains libzfs plus the ZFS libraries it depends on: libavl, libnvpair,
libspl, libtpool, libumem, libuutil, libzfs_core and libzutil.

with this change, it is possible to remove FreeBSD-ufs and/or
FreeBSD-zfs while leaving FreeBSD-libufs, FreeBSD-libzfs and
FreeBSD-utilities installed.

Reviewed by:	manu, des
Approved by:	des (mentor)
Differential Revision:	https://reviews.freebsd.org/D50148
2025-05-05 16:39:25 +01:00
Jens Schweikhardt 7fbe9f370c Note that bash(1) is from a port. 2025-04-19 20:13:22 +02:00
Mark Johnston 1bb8b1d7e1 libdtrace: Fix formatting of messages about drops
dt_oformat_drop() should only be called when in structured output mode.

Reviewed by:	Domagoj Stolfa
Fixes:		93f27766a7 ("dtrace: Add the 'oformat' libdtrace option")
2025-04-15 18:26:59 +00:00
Mark Johnston 9a30c8d347 libdtrace: Fix an off-by-one in CPU ID handling
The illumos-specific _SC_CPUID_MAX is the largest CPU ID in the system.  This
was mapped to _SC_NPROCESSORS_CONF, which is the total number of CPUs recognized
by the kernel.  If CPU IDs are contiguous, as is the case on amd64 and arm64,
this value is one greater than the maximum ID.   As a result, when consuming
per-CPU dtrace buffers, libdtrace tries to fetch from a non-existent CPU.  This
is mostly harmless in practice, but still wrong.

As we don't have a sysconf value for the maximum CPU ID, add a wrapper which
fetches it using the kern.smp.maxid sysctl.

MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D49243
2025-03-09 23:00:59 -04:00
Mark Johnston 7ee1bdd094 libdtrace: Fix an off-by-one in the priority queue implementation
The zero'th index in the array is unused, so a priority queue of N elements
needs N+1 array slots.  Fix the allocation.

Also fix the assertion in dt_pq_insert(): the assertion needs to be checked
after incrementing the count of items in the priority queue, otherwise it can
miss an overflow.

Reported by:	CHERI
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D49242
2025-03-09 23:00:42 -04:00
Martin Matuska b59a0cde6a zfs: merge openzfs/zfs@6a2f7b384
Notable upstream pull request merges:
 #16857 387ed5ca4 Add recursive dataset mounting and unmounting support
                  to pam_zfs_key
 #16929 c2458ba92 optimize recv_fix_encryption_hierarchy()
 #16980 12f0baf34 Make the vfs.zfs.vdev.raidz_impl sysctl cross-platform
 #16986 40496514b Expand fragmentation table to reflect larger possibile
                  allocation sizes
 #17003 88020b993 Add kstats tracking gang allocations
 #17013 21205f648 Avoid ARC buffer transfrom operations in prefetch
 #17016 390f6c119 zio: lock parent zios when updating wait counts on
                  reexecute
 #17029 b8c73ab78 zio: do no-op injections just before handing off to vdevs
 #17037 6a2f7b384 Fix metaslab group fragmentation math
 #17040 b901d4a0b Update the dataset name in handle after zfs_rename

Obtained from:	OpenZFS
OpenZFS commit:	6a2f7b3844
2025-02-20 17:40:55 +01:00
Mark Johnston 51688136b1 libdtrace: Use designators to initialize the opcode array
No functional change intended.

MFC after:	2 weeks
Sponsored by:	Innovate UK
2025-01-29 00:59:21 +00:00
Mark Johnston 096a5c6cd2 libdtrace: Generalize handling of data models a bit
Make it easier to support data models other than ILP32 and LP64 by
avoiding constructs which assume that it must be one or the other.

No functional change intended.

MFC after:	2 weeks
Sponsored by:	Innovate UK
2025-01-25 16:02:41 +00:00
Mark Johnston fed08c59b7 dtrace tests: Fix the ATF config variable name
Fixes:		6e6a67e986 ("dtrace tests: Avoid hard-coding paths to required programs")
Sponsored by:	Innovate UK
2025-01-23 19:09:56 +00:00
Mark Johnston 61c4ac2df7 libdtrace: Use C99 designated initializers for dt_idops_t
No functional change intended.

MFC after:	1 week
Sponsored by:	Innovate UK
2025-01-22 14:40:54 +00:00
Mark Johnston 6e6a67e986 dtrace tests: Avoid hard-coding paths to required programs
MFC after:	1 week
Sponsored by:	Innovate UK
2025-01-22 14:20:33 +00:00
Mark Johnston 4196f227aa libdtrace: Be less strict when comparing pointer types
If one of two pointers refers to a forward declaration, let the pointers
be compatible so long as the referred types have the same name.
Otherwise we can get spurious errors.

To give a specific example, this can happen when ipfw_nat.ko is loaded
before ipfw.ko and /usr/lib/dtrace/ipfw.d is processed.  Currently,
ipfw_nat.ko does not have a definition for struct inpcb (i.e., none of
its files include in_pcb.h), so in the CTF type graph, struct
ip_fw_args' "inp" member refers to a forward declaration, represented in
CTF with CTF_K_FORWARD.

Then, when libdtrace processes the ipfw_match_info_t translator in
ipfw.d, it decides that the "inp" field assignment is incorrect because
the two pointers are incompatible.  However, there's no harm in allowing
this assignment.  Add some logic to dt_node_is_ptrcompat() to detect
this case and declare the pointers as compatible so long as the name of
the thing they refer to is the same, similar to how any pointer is
compatible with a void *.

Reported by:	marck
Reviewed by:	Domagoj Stolfa <domagoj.stolfa@gmail.com>
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D48254
2025-01-01 00:05:03 +00:00
Richard Scheffenegger 31034044ff tcp: cleanup of nits after use of accessor tcp_get_flags
Remove unneeded th_x2 initalization, use named constants
instead of magic numbers (fixing one oversight) and add
some line breaks. Expand one man page slightly.

No functional change intended.

Reviewed By: tuexen, cc
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D48065
2024-12-19 16:37:24 +01:00
Martin Matuska 5c65a0a916 zfs: merge openzfs/zfs@1c9a4c8cb
Notable upstream pull request merges:
 #16244 acb6e71ed Added output to `zpool online` and `offline`
 #16684 94a03dd1e Pack dmu_buf_impl_t by 16 bytes
 #16690 6187b1943 On the first vdev open ignore impossible ashift hints
 #16692 673efbbf5 zdb: add extra -T flag to show histograms of BRT refcounts
 #16693 2bf152021 Fix gcc uninitialized warning in FreeBSD zio_crypt.c
 #16694 b16e09619 Reduce dirty records memory usage
 #16701 5945676bc ZFS send should use spill block prefetched from
                  send_reader_thread
 #16734 1c9a4c8cb Fix user properties output for zpool list

Obtained from:	OpenZFS
OpenZFS commit:	1c9a4c8cb4
2024-11-13 13:49:10 +01:00
Ed Maste 3750ccefb8 Retire MK_PROFILE infrastructure
It was disabled by default in fe52b7f60e.  We planned to (but did not)
remove the option before FreeBSD 14.  Remove it now, for FreeBSD 15.

Relnotes:	Yes
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31558
2024-11-12 12:11:51 -05:00
Ed Maste 01a5af6a98 zstream: avoid absolute symlink
PR:		282192
Reported by:	wosch
Fixes:		44877c8db0
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47226
2024-10-26 08:53:16 -04:00
Martin Matuska 7a7741af18 zfs: merge openzfs/zfs@b10992582
Notable upstream pull request merges:
 #9416  -multiple zio_compress: introduce max size threshold
 #10018 a10e552b9 Adding Direct IO Support
 #15147 e419a63bf xattr dataset prop: change defaults to sa
 #15454 7e957fde7 send/recv: open up additional stream feature flags
 #15810 0d77e738e Defer resilver only when progress is above a threshold
 #15921 3cf2bfa57 Allocate zap_attribute_t from kmem instead of stack
 #16483 -multiple dmu_objset: replace dnode_hash impl with cityhash4
 #16485 8be2f4c3d zio_resume: log when unsuspending the pool
 #16491 88433e640 sys/types32.h: Remove struct timeval32 from libspl header
 #16496 f245541e2 zfs_file: implement zfs_file_deallocate for FreeBSD 14
 #16511 308f7c2f1 Fix an uninitialized data access
 #16529 29c9e6c32 Fix handling of DNS names with '-' in them for sharenfs
 #16531 ddf5f34f0 Avoid fault diagnosis if multiple vdevs have errors
 #16539 6f50f8e16 zfs_log: add flex array fields to log record structs
 #16546 d40d40913 Evicting too many bytes from MFU metadata
 #16551 3014dcb76 Reduce and handle EAGAIN errors on AIO label reads
 #16554 80645d658 FreeBSD: restore zfs_znode_update_vfs()
 #16565 832f66b21 FreeBSD: Sync taskq_cancel_id() returns with Linux
 #16567 48d1be254 Properly release key in spa_keystore_dsl_key_hold_dd()
 #16569 141368a4b Restrict raidz faulted vdev count
 #16583 c84a37ae9 lua: add flex array field to TString type
 #16584 86737c592 Avoid computing strlen() inside loops
 #16587 d34d4f97a snapdir: add 'disabled' value to make .zfs inaccessible
 #16593 224393a32 feature: large_microzap
 #16597 412105977 Temporarily disable Direct IO by default
 #16605 4ebe674d9 ARC: Cache arc_c value during arc_evict()

Backported pull request merges:
 #16613 ab777f436 Return boolean_t in inline functions of
                  lib/libspl/include/sys/uio.h
 #16616 efeb60b86 FreeBSD: ignore some includes when not building kernel
 #16635 ---TBD--- zdb: fix printf format in dump_zap()

Obtained from:	OpenZFS
OpenZFS commit:	b109925820
OpenZFS tag:	2.3.0-rc1
2024-10-11 08:43:49 +02:00
Graham Percival c801836ff4 manuals: Fix "skipping end of block" .El errors
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
2024-10-07 15:37:47 -03:00
Alan Somers 618ae939b7 zfsd: replace vdevs with the AUX faulted state
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
2024-10-03 16:21:46 -06:00
Mark Johnston d439598dd0 dtrace tests: Add a test case which validates FBT probe arguments
Reviewed by:	avg
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D46674
2024-09-19 09:22:03 +00:00
Martin Matuska e2df9bb441 zfs: merge openzfs/zfs@b10992582
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:	b109925820
2024-09-09 18:13:02 +02:00
Mark Johnston a58ece8730 zfsd tests: Update the mock zpool_handle
The zfsd tests rely on this having the same layout as the real
zpool_handle, which changed in the last OpenZFS import.

Fixes:	62e7d3c89e ("ddt: add support for prefetching tables into the ARC")
Reported by:	Jenkins
2024-08-29 17:40:44 +00:00
Martin Matuska ce4dcb97ca zfs: merge openzfs/zfs@9c56b8ec7
Notable upstream pull request merges:
 #15817 5536c0dee Sync AUX label during pool import
 #15889 c7ada64bb ddt: dedup table quota enforcement
 #15890 62e7d3c89 ddt: add support for prefetching tables into the ARC
 #15894 e26b3771e spa_preferred_class: pass the entire zio
 #15894 d54d0fff3 dnode: allow storage class to be overridden by object type
 #16197 55427add3 Several improvements to ARC shrinking
 #16217 -multiple JSON output for various zfs and zpool subcommands
 #16248 24e6585e7 libzfs.h: Set ZFS_MAXPROPLEN and ZPOOL_MAXPROPLEN
                  to ZAP_MAXVALUELEN
 #16264 9dfc5c4a0 Fix long_free_dirty accounting for small files
 #16268 ed0db1cc8 Make txg_wait_synced conditional in zfsvfs_teardown,
                  for FreeBSD
 #16288 d60debbf5 Fix sa_add_projid to lookup and update SA_ZPL_DXATTR
 #16308 ec580bc52 zfs: add bounds checking to zil_parse
 #16310 c21dc56ea Fix zdb_dump_block for little endian
 #16315 7ddc1f737 zil: add stats for commit failure/fallback
 #16326 b0bf14cdb abd: lift ABD zero scan from zio_compress_data()
                  to abd_cmp_zero()
 #16337 c8184d714 Block cloning conditionally destroy ARC buffer
 #16338 dbe07928b Add support for multiple lines to the sharenfs property
                  for FreeBSD
 #16374 1a3e32e6a Cleanup DB_DNODE() macros usage
 #16374 ed87d456e Skip dnode handles use when not needed
 #16346 fb6d8cf22 Add some missing vdev properties
 #16364 670147be5 zvol: ensure device minors are properly cleaned up
 #16382 dea8fabf7 FreeBSD: Fix RLIMIT_FSIZE handling for block cloning
 #16387 aef452f10 Improve zfs_blkptr_verify()
 #16395 cbcb52243 Fix the names of some FreeBSD sysctls in
                  include/tunables.cfg
 #16401 5b9f3b766 Soften pruning threshold on not evictable metadata
 #16404 cdd53fea1 FreeBSD: Add missing memory reclamation accounting
 #16404 1fdcb653b Once more refactor arc_summary output
 #16419 1f5bf91a8 Fix memory corruption during parallel zpool import
                  with -o cachefile
 #16426 cf6e8b218 zstream: remove duplicate highbit64 definition

Obtained from:	OpenZFS
OpenZFS commit:	9c56b8ec78
2024-08-10 11:43:43 +02:00
Mark Johnston 2aeb3e204a zdb: Chase a missing library dependency
Fixes:	75e1fea68a ("zfs: merge openzfs/zfs@1147a2797")
2024-07-18 09:57:38 -04:00
Martin Matuska 75e1fea68a zfs: merge openzfs/zfs@1147a2797
Notable upstream pull request merges:
 #16209 --multi-- icp: rip out everything we don't use
 #16230 20c8bdd85 FreeBSD: Update use of UMA-related symbols in
                  arc_available_memory
 #16242 121a2d335 FreeBSD: unregister mountroot eventhandler on unload
 #16258 5de3ac223 vdev_open: clear async fault flag after reopen
 #16270 436731276 zvol: Fix suspend lock leaks
 #16273 c87cb22ba head_errlog: fix use-after-free
 #16284 f72e081fb FreeBSD: Use a statement expression to implement
                  SET_ERROR()
 #16300 a10faf5ce FreeBSD: Use the new freeuio() helper to free dynamically
                  allocated UIOs
 #16302 a7fc4c85e zstd: don't call zstd_mempool_reap if there are no buffers
 #16334 dc91e7452 zdb: dump ZAP_FLAG_UINT64_KEY ZAPs properly

Obtained from:	OpenZFS
OpenZFS commit: 1147a27978
2024-07-18 10:02:12 +02:00
Warner Losh e9ac41698b Remove residual blank line at start of Makefile
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
2024-07-15 16:43:39 -06:00
Kyle Evans 41c233dec6 Prepare some build fixes in advance of more _FORTIFY_SOURCE
ZFS' libspl needs to be made aware that we have strlcat(3) and
strlcpy(3) to avoid some more complicated declaration duplication, so
go ahead and define these HAVE_ macros now.

libprocstat has to define `_KERNEL` and include kernel headers in order
to get what it wants, but this results in sys/cdefs.h being included too
late and we pick up the build breaking version of the __RENAME
definition.  Just explicitly include sys/cdefs.h earlier rather than
disabling _FORTIFY_SOURCE.  The zfs/ subdir only builds an object that
holds some structures and sizes, so just disable _FORTIFY_SOURCE there
entirely rather than trying to move #define _KERNEL into the file..

While we're here, make sure that we disable _FORTIFY_SOURCE in the
bootloader because we don't have the symbol renaming support today to do
it as cleanly as we'd like.  ssp/ssp.h needs to be pulled into the libsa
environment so that other bits can understand that ssp is disabled in
the consistent __SSP_FORTIFY_LEVEL way that we try to do.

Reviewed by:	allanjude (previous version), markj
Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield
Differential Revision:	https://reviews.freebsd.org/D45676
2024-07-13 00:16:23 -05:00