The barrier code was using semaphores which have been deprecated in
macOS and not working at all, causing a race condition. Since macOS
does not have pthread_barrier_*(), this change uses a condition
variable instead.
PR: 290958
Reported by: wosch
MFC after: 2 weeks
Reviewed by: imp, markj
Differential Revision: https://reviews.freebsd.org/D54018
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
Remove the ctf-tools package. Add a new package which contains the
previous contents of ctf-tools along with libctf. This removes
CDDL-licensed code from the utilities package.
Set LIB_PACKAGE for libctf so that DTrace runtime doesn't need to
install the tools.
MFC after: 1 day
Reviewed by: bapt
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D52776
Commit f9513c334f moved the shared libraries for ZFS and UFS into
separate packages (libzfs and libufs), which resulted in a rather
large number of packages being created, e.g. for ZFS:
FreeBSD-libzfs
FreeBSD-libzfs-dbg
FreeBSD-libzfs-dbg-lib32
FreeBSD-libzfs-dev
FreeBSD-libzfs-dev-lib32
FreeBSD-libzfs-lib32
FreeBSD-zfs
FreeBSD-zfs-dbg
FreeBSD-zfs-dbg-lib32
FreeBSD-zfs-dev
FreeBSD-zfs-dev-lib32
FreeBSD-zfs-lib32
FreeBSD-zfs-man
Use LIB_PACKAGE instead, which significantly reduces the number of
packages:
FreeBSD-zfs
FreeBSD-zfs-dbg
FreeBSD-zfs-dbg-lib32
FreeBSD-zfs-dev
FreeBSD-zfs-dev-lib32
FreeBSD-zfs-lib
FreeBSD-zfs-lib32
FreeBSD-zfs-man
MFC after: 3 days
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D52416
printm is specific to the FreeBSD dtrace port. I believe it's
effectively the same as tracemem(), though printm apparently predates
it. It stores the size of the buffer of traced data inline. Currently
it represents that size using a uintptr_t, which isn't really right and
poses challenges when porting to CHERI because
`DTRACE_STORE(uintptr_t, ...` requires the destination to be suitably
aligned, but this isn't necessary since we're just storing a size.
Convert to using a size_t. This should be a no-op since
sizeof(uintptr_t) == sizeof(size_t) on non-CHERI platforms (and besides
that I don't see a reason to use printm() when tracemem() is available
and is simpler to use.)
Reviewed by: Domagoj Stolfa, avg
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D52055
The upstream source (which we've currently hacked downstream to make it
compile, even though it won't work) assumes ELF for its hand-rolled
linker set implementation, and macOS's Mach-O is sufficiently different
for it to not even compile there. However, we don't actually need this
file at all, since we only use the bootstrap libspl for DTrace tools, so
just add it to the set of files we don't build when bootstrapping.
Fixes: df58e8b150 ("zfs: merge openzfs/zfs@8302b6e32")
Notable upstream pull request merges:
#16853894edd084 Add TXG timestamp database
#17004 -multiple Implement dynamic gang header sizes
#17405dea0fc969 ZVOL: Return early, if volmode is ZFS_VOLMODE_NONE
on FreeBSD side
#17455cf146460c Default to zfs_bclone_wait_dirty=1
#17481523d9d600 Validate mountpoint on path-based unmount using statx
#1748292da9e0e9 ZVOL: Implement zvol_alloc() function on FreeBSD side
#17489dee62e074 spa: ZIO_TASKQ_ISSUE: Use symbolic priority
#17496bf846dcb7 Release topology restrictions on special/dedup
#174974e92aee23 Relax special_small_blocks restrictions
#17503ea38787f2 Revert "Fix incorrect expected error in ztest"
#17505be1e991a1 Allow and prefer special vdevs as ZIL
#17506ee0cb4cb8 ztest: Fix false positive of ENOSPC handling
#1750792d3b4ee2 zio: rename `io_reexecute` as `io_post`;
use it for the direct IO checksum error flag
#175086af8db61b metaslab: don't pass whole zio to throttle reserve APIs
#175184c2a7f85d FreeBSD: Add support for _PC_HAS_HIDDENSYSTEM
#17521d7ab07dfb ZIL: Force writing of open LWB on suspend
#17524b6e8db509 zpool/zfs: Add '-a|--all' option to scrub, trim,
initialize
#17531c1e51c55f Correct weight recalculation of space-based metaslabs
#17533d323fbf49 FreeBSD: zfs_putpages: don't undirty pages until
after write completes
#17536b21e04e8d Fix zdb pool/ with -k
#17537 -multiple Userspace tunables
#175402957eabbe Add support for FreeBSD's Solaris style extended
attribute interface
#175474bd7a2eaa zdb: fix checksum calculation for decompressed blocks
#17551 -multiple cleanup: remove var init/update
#175610f8a1105e Skip dbuf_evict_one() from dbuf_evict_notify()
for reclaim thread
#1756310a78e264 Faster checksum benchmark on system boot
#1756400ce064d8 spa: update blkptr diagram to include vdev padding
on encrypted blocks
#17565 -multiple Physical rewrite
#17566fc885f308 Don't use wrong weight when passivating group
#17572f70c85086 BRT: Fix ZAP entry endianness
#175750b6fd024a ZVOL: Unify zvol minors operations and improve error
handling
#17581cb5e7e097 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
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
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
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
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
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
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
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
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