kern - Make lseek(2) generic
* Extend fileops with fo_seek function allowing pluggable lseek(2)
implementations. Part of preparation for linux DMA-BUF compat API.
* Move current vnode lseek implementation into vnode and devfs fileops.
Code is exactly the same in both, note about duplication added.
* Set remaining fileops to badfo_seek.
Mentored-By: dillon
world - Replace gnu diff, diff3, and sdiff with BSD versions
* Replace diff and diff3 with the OpenBSD diff and diff3,
Replace sdiff with the FreeBSD sdiff,
Remove the GNU diff, diff3, and sdiff
* Basic testing with dsynth bulk to ensure no significant compatibility
disruptions.
Submitted-by: Tyler <tyler.clark at foxide.xyz>
sbin/hammer2/cmd_debug.c: Refactor unreadable cmd_show()
0b7381572b131c74051832dc251604e7f77b5a54 added multi-volumes
support to cmd_show() (entry point of freemap,show,volhdr directives)
with minimum modification using goto, but the code has been not
so readable since then. Rewrite this entry point function.
The output is same except that "Volume %d header %d..."
by default (= when not showing volhdr or bref for all volumes)
appears before printing each volhdr or bref, rather than all
at once in the beginning.
sbin/hammer2/cmd_debug.c: Clear errno
otherwise affects next strtol(3) variant when no error.
strtol(3) says "If no conversion could be performed,
0 is returned and the global variable errno is set to EINVAL".
sys/vfs/hammer2: Change hammer2_inode_meta::target_type to unused84
No longer used or needed since
da0cdd33148ab3e3c227355de759c595c533841a in 2017.
target_type was only used for the initial hardlink design and
implementation, which is not how it works today.
rtld - Improve error reporting
* Prefix hex type values with 0x
* Include (%s) obj->path so the user has some idea which file is
responsible for the error.
Requested-by: servik
sbin/hammer2: Verify fstype UUID in hammer2_verify_volumes_common()
Its string form has to be HAMMER2_UUID_STRING.
Also move common volu_id check to hammer2_verify_volumes_common().
sbin/newfs_hammer2: Fail if input size is < alignment size
If aligned size becomes 0, it should fail with an error message
before hammer2_install_volume().
e.g. If a regular file av[0] is 4MiB, size becomes 0 after aligned.
Also add same sanity in hammer2_verify_volumes_common().
vol->size == 0 passes 8MiB or 1GiB alignment sanity.
sbin/newfs_hammer2: Remove redundant inode.meta.name_xxx zero clears
Remove obsolete code from b33a7e92438b9c9fc915e7c432666385051369db in 2012.
suproot has a name "SUPROOT" in inode itself if not in dirent,
and name_len is initialized with a proper length right after this.
dsynth - Make dummy /usr/packages directory for pkg compatibility
* For the chroot, make /usr/packages for pkg compatibility. Certain
pkg related temporary files are created there for reasons unknown.
poll - Fix events == 0 handling for TAP and TUN, fix console spam
* BSD poll() supports events == 0 representing a "HUP ONLY" event.
Most of our devices properly support this but TAP and TUN did not.
Fix TAP and TUN to support this feature. This fixes openvpn()
when operating under heavier loads.
* Fix console spam on non-debug kprintf()s by rate-limiting any
such spam if it occurs. If a device doe snot support poll()'s
HUP ONLY feature, the loop deregistration path will be hit and
generate a kprintf(). We don't want console spam to stall the
cpu.
acpi: Narrow workaround for broken interrupt settings
Commit ad52dd3206 ("Sync acpi_resource with FreeBSD") introduced a
workaround for some broken BIOSes that specified active-lo instead of
active-hi polarity for ISA IRQs for UARTs. The workaround assumed that
edge-sensitive ISA IRQs on x86 should always be active-hi. However,
some recent AMD systems actually use active-lo edge-sensitive ISA IRQs
(and not just for UARTs, but also for the keyboard and PS/2 mouse
devices) and the override causes interrupts to be dropped resulting in
boot time hangs, non-working keyboards, etc.
Add a hw.acpi.override_isa_irq_polarity tunable (readable as a sysctl
post-boot) to control this quirk. It can be set to 1 to force enable
the override and 0 to disable it. The log of FreeBSD-PR (see below)
mentions an Intel motherboard as the sample case, so default the
tunable to 1 on systems with an Intel CPU and 0 otherwise.
Special thanks to Matthias Lanter <freebsd at lanter-it.ch> for tracking
down boot time issues on recent AMD systems to mismatched interrupt
[7 lines not shown]
vfs/procfs: Add kqueue support
This patch is mostly derived from tmpfs.
With kqueue support implemented, poll() now works with the files on this
pseudo filesystem. For example, poll() would report POLLIN instead of
timing out, and this makes less(1) work correctly.
Reviewed-by: dillon
rc.conf: Add and document the missing root_rw_mount=YES
The 'root_rw_mount' variable was missing, and it caused the rc.d/root
script to always ignore the 'mount -u -o rw /' command. Nevertheless,
the '/' root filesystem was still remounted to be 'rw' because the later
'mount -a' command, according to /etc/fstab.
With this 'root_rw_mount=YES' placed, the '/' entry should now be
optional in /etc/fstab because the '/' root filesystem can be correctly
remounted to be 'rw'.
Obtained-from: FreeBSD (commit 6e1b226)
Reported-by: robstinge (IRC)