fsck_hammer2 - Print recursion stack with error message
* Print the full blockref spec (that can be used in a "hammer2 show")
* Print the recursion stack leading up to and including the error block.
* Errored blocks and stack are printed without needing any -d options.
Note that two -d opts will dump the full stack during the scan, which
could end up being terrabytes of text so... maybe don't do that.
sys/compat/freebsd32: Fix i386 compilation
The compile assertion now failing is due to the change '__int64_t' =>
'__int32_t' as the type of 'time32_t' on i386, which is the correct
value. The use of 'freebsd32.h' on i386 may seem strange, but it comes
from 'kern_umtx.c' including it unconditionally as it needs 'struct
umutex32'.
Fixes: 87632ddf67b0 ("openzfs sys/types32.h: use abi_compat.h for time32_t")
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 07c4eb506be45a4b836665e14ad63034ef3d573a)
dev/mfi: include sys/abi_compat.h unconditionally
not only for COMPAT_FREEBSD32 case. The driver uses INPTR() for
non-compat32 code.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
(cherry picked from commit bf603dbbb2c9964bba3d5bf2ba2371a75a0cc521)
sys/event.h: reduce namespace pollution from sys/abi_compat.h
Split out types definitions into sys/abi_types.h, and only include
abi_types.h into sys/event.h.
Tested and reviewed by: bz
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55202
(cherry picked from commit ecadac729a1b855fe0d77a682ee424c3da1eb3db)
devstat: Provide 32-bit compatibility
If a 32-bit process running on a 64-bit kernel requests kern.devstat.all,
translate each struct devstat to its 32-bit equivalent before copying it
out.
Also fix a bug where an early error would be ignored if there were no
devices to report.
MFC after: 1 week
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D54591
(cherry picked from commit a11d132f6c62f32abe44b19f7527d97ddc239058)
freebsd32: Fix includes
The previous commit added <sys/cdefs.h>, which isn't actually needed.
Conversely, <sys/event.h> is needed (and has been for a long time) but
[7 lines not shown]
sys/compat/freebsd32: FF clock struct: Don't pack, use 'ffcounter32'
Packing 'struct ffclock_estimate32', in absence of substitution of
'ffcounter' (some 'uint64_t') by a 32-bit compatible type, was necessary
on amd64 since 'uint64_t' is 8-byte aligned, which leaves a padding gap
of 4-byte between fields 'update_time' and 'update_ffcount'. This gap
does not exist on i386 (or amd64 32-bit mode), as 'uint64_t' there is
only 4-byte aligned.
Change the type of the 'update_ffcount' and 'leapsec_next' fields to the
recently introduced 'freebsd32_uint64_t', and adapt copy-in and copy-out
accordingly. Using `CP()` previously worked due to the '__packed__'
attribute.
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55282
(cherry picked from commit 7c2fc4419db43a8a7d1886b0b8e08aa97bfa31e4)
sys/compat/freebsd32: ki_pd is missing from struct kinfo_proc32
This is missed by the sizeof(struct kinfo_proc32) assert due to another
bug: namely, the use of uint64_t type that has different alignment on
i386 than on amd64 host.
Fixes: 85078b8573332c2c83a79adea8a61b519fb3b6af
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55135
(cherry picked from commit 154778e3585166f613fd3d2978a0cab2262d1611)
openzfs sys/types32.h: use abi_compat.h for time32_t
The time32_t typedef leaks into openzfs compilation environment
through sys/event.h. Simultaneously, openzfs provides its own
definition that is only correct for amd64 on FreeBSD.
Try to fix it by using sys/abi_compat.h directly. Since toolchain build
from the make buildworld uses host abi_compat.h, add a preprocessor
symbol __HAVE_TIME32_T to signal consumers that time32_t is typedef'ed.
If not defined, fall back to old and wrong time32_t, which is enough for
bootstraping toolchain.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55135
(cherry picked from commit 87632ddf67b01f3d4787d10332afc1eeece52e2d)
sys/abi_compat.h: fix UB for bintime32 handling
Do not cast and then access potentially unaligned uint64_t in the BT_CP()
macro. Use freebsd32_uint64_t type and FU64_CP() for the frac member.
Noted by: des
Reviewed by: des, emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54663
(cherry picked from commit be1b2da855cc38531733b5c97891cd4a40a993bc)
sys/abi_compat.h: move freebsd32_uint64_t and FU64_CP() there
Use private names for uintXX_t types.
Remove conflicting (but equal) PTR_IN() definition from dev/mfi.c.
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55135
(cherry picked from commit e651c64bcab08c7b12d8ad6e3ad0b1ef3af3b875)
compat32: provide a type and a macro for (u)int64_t handling on non-x86 arches
uint64_t is 4-byte aligned on i386, but is 8-bytes aligned on all other
32bit arches FreeBSD supports. Provide the freebsd32_uint64_t type and
the FU64_CP() macro, which are intended to be used where 32bit ABI uses
(u)int64_t type, and do proper layout and copying for the aggregate type.
Reviewed by: des, emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54663
(cherry picked from commit 96acaa960023c20e852e04e7cc5c6a5faca36c67)
devstat: Provide 32-bit compatibility
If a 32-bit process running on a 64-bit kernel requests kern.devstat.all,
translate each struct devstat to its 32-bit equivalent before copying it
out.
Also fix a bug where an early error would be ignored if there were no
devices to report.
MFC after: 1 week
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D54591
(cherry picked from commit a11d132f6c62f32abe44b19f7527d97ddc239058)
freebsd32: Fix includes
The previous commit added <sys/cdefs.h>, which isn't actually needed.
Conversely, <sys/event.h> is needed (and has been for a long time) but
[7 lines not shown]
devstat: Provide 32-bit compatibility
If a 32-bit process running on a 64-bit kernel requests kern.devstat.all,
translate each struct devstat to its 32-bit equivalent before copying it
out.
Also fix a bug where an early error would be ignored if there were no
devices to report.
MFC after: 1 week
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D54591
(cherry picked from commit a11d132f6c62f32abe44b19f7527d97ddc239058)
freebsd32: Fix includes
The previous commit added <sys/cdefs.h>, which isn't actually needed.
Conversely, <sys/event.h> is needed (and has been for a long time) but
[7 lines not shown]