r366087 tsoome Sept. 23, 2020, 7:15 p.m.
We can not include zfs headers while building without zfs.

Reported by:	Oscar Holmlund
r366086 nick Sept. 23, 2020, 6:54 p.m.
No functional changes, just cleanup.

Reviewed by:	kp
Approved by:	kp (mentor)
Sponsored by:	Axiado
r366085 kib Sept. 23, 2020, 6:03 p.m.
and current address space is already destroyed, so kern_execve()
terminates the process.

While there, clean up some internals of post_execve() inlined in init_main.

Reported by:	Peter <pmc@citylink.dinoex.sub.org>
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D26525
r366078 cem Sept. 23, 2020, 5:04 p.m.
Fix unquoted test for an empty value, which broke nextboot(8) on non-ZFS /boot
systems after r365938.

Discussed with:	allanjude, tsoome
X-MFC-With:	r365938
r366077 emaste Sept. 23, 2020, 2:52 p.m.
We left these in the clean rule to avoid having stale files remain in
working trees, but enough time has now passed that it's no longer

Discussed with:	imp
r366075 arichardson Sept. 23, 2020, 12:54 p.m.
I've submitted this patch upstream, so apply this to contrib/ until a new
version containing this change has been released.

Reviewed By:	jkim
Differential Revision: https://reviews.freebsd.org/D26505
r366074 arichardson Sept. 23, 2020, 12:54 p.m.
This builds the kernel-toolchain target and an amd64 GENERIC kernel on
Ubuntu 18.04, 20.04 and the latest macOS to ensure that new changes
don't regress building on non-FreeBSD hosts.

Reviewed By:	emaste, lwhsu
Differential Revision: https://reviews.freebsd.org/D26512
r366072 mjg Sept. 23, 2020, 11:02 a.m.
r366071 mjg Sept. 23, 2020, 10:46 a.m.
The optional scan is wasteful, thus it is removed altogether from unmount.

Callers which always want it anyway remain unaffected.
r366070 mjg Sept. 23, 2020, 10:44 a.m.
The entire cache scan was a leftover from the old implementation.

It is incredibly wasteful in presence of several mount points and does not
win much even for single ones.
r366069 mjg Sept. 23, 2020, 10:42 a.m.
- use subtract instead of adding -1
- drop the useless _rel fence

Note this should be converted to a scalable scheme.
r366066 tsoome Sept. 23, 2020, 8:22 a.m.
During devswitch probe, we pick boot pool based on boot disk, if the boot
disk happens to have multiple pools in freebsd-zfs partitions, the current
code does pick last pool from boot disk as boot pool. While there is no
way at that stage to test, the more logical approach would be to pick
first matching pool.

This patch is assuming we do pass pool guid pointer with guid value 0,
this will help us to determine, if the guid value is already set or not.

The general suggestion would be not to share disk between different pools.

Reported by:	Alexander Leidinger
r366065 delphij Sept. 23, 2020, 7:27 a.m.
Pointy hat to:	delphij
MFC after:	3 days
r366064 delphij Sept. 23, 2020, 6:52 a.m.
The purpose of checksize() is to verify that the referenced cluster
chain size matches the recorded file size (up to 2^32 - 1) in the
directory entry. We follow the cluster chain, then multiple the
cluster count by bytes per cluster to get the physical size, then
check it against the recorded size.

When a file is close to 4 GiB (between 4GiB - cluster size and 4GiB,
both non-inclusive), the product of cluster count and bytes per
cluster would be exactly 4 GiB. On 32-bit systems, because size_t
is 32-bit, this would wrap back to 0, which will cause the file be
truncated to 0.

Fix this by using 64-bit physicalSize instead.

This fix is inspired by an Android change request at

PR:		249533
Reviewed by:	kevlo
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26524
r366063 bdragon Sept. 23, 2020, 4:09 a.m.
Similar to OPAL calls, switch to big endian to do calls to RTAS.

(Missed this one when I was doing the bulk commit of PowerPC64LE support.)

Sponsored by:	Tag1 Consulting, Inc.