]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agompr(4): Fix a typo in a source code comment
Gordon Bergling [Tue, 30 Nov 2021 09:40:50 +0000 (10:40 +0100)]
mpr(4): Fix a typo in a source code comment

- s/segement/segment/

(cherry picked from commit ddeb702f7b29d967f86ae705b5604c4fa81bb908)

2 years agoelf(3): Fix a typo in a sysctl description
Gordon Bergling [Tue, 30 Nov 2021 09:38:34 +0000 (10:38 +0100)]
elf(3): Fix a typo in a sysctl description

- s/segement/segment/

(cherry picked from commit c8ca80e22381e68f7cc23e8822f3ef5e6a68c3c0)

2 years agonvme(4): Correct a typo in a sysctl description
Gordon Bergling [Tue, 30 Nov 2021 09:26:25 +0000 (10:26 +0100)]
nvme(4): Correct a typo in a sysctl description

- s/printting/printing/

(cherry picked from commit 5f8ccf6515288fd98896eaf0511eedd654cd3530)

2 years agovfs: Fix a typo in a sysctl description
Gordon Bergling [Tue, 30 Nov 2021 06:28:40 +0000 (07:28 +0100)]
vfs: Fix a typo in a sysctl description

- s/dependecies/dependencies/

(cherry picked from commit b6f4818a7ee41a4f81f8fd68a2c9820ebf65bd1d)

2 years agorelease: move installworld before installkernel
Ed Maste [Mon, 5 Apr 2021 17:16:01 +0000 (13:16 -0400)]
release: move installworld before installkernel

To support -DNO_ROOT work.  The top-level installworld target creates a
new METALOG starting with `#mtree 2.0` so it needs to be first, to avoid
overwriting installkernel METALOG entries.

Reviewed by: gjb
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29582

(cherry picked from commit 4bbfa3d3baf70492ad4c3eacace0f966f3ca7070)

2 years agogvinum: add deprecation notice
Ed Maste [Fri, 26 Mar 2021 15:26:22 +0000 (11:26 -0400)]
gvinum: add deprecation notice

Vinum is a Logical Volume Manager that was introduced in FreeBSD 3.0,
and for FreeBSD 5 was ported to geom(4) as gvinum. gvinum has had no
specific development at least as far back as 2010, and has a number of
known bugs which are unlikely to be resolved.

Add a deprecation notice to raise awareness but state that vinum "may
not be" available in FreeBSD 14.  Either it will be removed and the
notice will be updated to "is not" available, or someone will step up
to fix issues and maintain it and we will remove the notice.

Reviewed by: imp (earlier version)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29424

(cherry picked from commit b218441ac074d9cb9417e284980bf87f79a89585)

2 years agoAllow minidumps to be performed on the live system
Mitchell Horne [Wed, 17 Nov 2021 15:35:59 +0000 (11:35 -0400)]
Allow minidumps to be performed on the live system

Add a boolean parameter to minidumpsys(), to indicate a live dump. When
requested, take a snapshot of important global state, and pass this to
the machine-dependent minidump function. For now this includes the
kernel message buffer, and the bitset of pages to be dumped. Beyond
this, we don't take much action to protect the integrity of the dump
from changes in the running system.

A new function msgbuf_duplicate() is added for snapshotting the message
buffer. msgbuf_copy() is insufficient for this purpose since it marks
any new characters it finds as read.

For now, nothing can actually trigger a live minidump. A future patch
will add the mechanism for this. For simplicity and safety, live dumps
are disallowed for mips.

Reviewed by: markj, jhb
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31993

(cherry picked from commit 588ab3c7745480778281ce2ab086eacfb487e413)

2 years agominidump: Use the provided dump bitset
Mitchell Horne [Wed, 17 Nov 2021 15:35:18 +0000 (11:35 -0400)]
minidump: Use the provided dump bitset

When constructing the set of dumpable pages, use the bitset provided by
the state argument, rather than assuming vm_page_dump invariably. For
normal kernel minidumps this will be a pointer to vm_page_dump, but when
dumping the live system it will not.

To do this, the functions in vm_dumpset.h are extended to accept the
desired bitset as an argument. Note that this provided bitset is assumed
to be derived from vm_page_dump, and therefore has the same size.

Reviewed by: kib, markj, jhb
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31992

(cherry picked from commit 10fe6f80a6c871ba317ddc2684cecb8f02096943)

2 years agominidump: Use provided msgbuf pointer
Mitchell Horne [Wed, 17 Nov 2021 15:34:13 +0000 (11:34 -0400)]
minidump: Use provided msgbuf pointer

Don't assume we are dumping the global message buffer, but use the one
provided by the state argument. While here, drop superfluous
cast to char *.

Reviewed by: markj, jhb
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31991

(cherry picked from commit 1d2d1418b492359921716aaa41e93750969b6e1f)

2 years agominidump: reduce the amount direct accesses to page tables
Mitchell Horne [Wed, 17 Nov 2021 15:30:43 +0000 (11:30 -0400)]
minidump: reduce the amount direct accesses to page tables

During a live dump, we may race with updates to the kernel page tables.
This is generally okay; we accept that the state of the system while
dumping may be somewhat inconsistent with its state when the dump was
invoked. However, when walking the kernel page tables, it is important
that we load each PDE/PTE only once while operating on it. Otherwise, it
is possible to have the relevant PTE change underneath us. For example,
after checking the valid bit, but before reading the physical address.

Convert the loads to atomics, and add some validation around the
physical addresses, to ensure that we do not try to dump a non-existent
or non-canonical physical address.

Similarly, don't read kernel_vm_end more than once, on the off chance
that pmap_growkernel() is called between the two page table walks.

Reviewed by: kib, markj
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31990

(cherry picked from commit 681bd71047f184282d10d5ec9c1770882d525eb8)

2 years agominidump: Parameterize minidumpsys()
Mitchell Horne [Wed, 17 Nov 2021 15:26:59 +0000 (11:26 -0400)]
minidump: Parameterize minidumpsys()

The minidump code is written assuming that certain global state will not
change, and rightly so, since it executes from a kernel debugger
context. In order to support taking minidumps of a live system, we
should allow copies of relevant global state that is likely to change to
be passed as parameters to the minidumpsys() function.

This patch does the work of parameterizing this function, by adding a
struct minidumpstate argument. For now, this struct allows for copies of
the kernel message buffer, and the bitset that tracks which pages should
be dumped (vm_page_dump). Follow-up changes will actually make use of
these arguments.

Notably, dump_avail[] does not need a snapshot, since it is not expected
to change after system initialization.

The existing minidumpsys() definitions are renamed, and a thin MI
wrapper is added to kern_dump.c, which handles the construction of
the state struct. Thus, calling minidumpsys() remains as simple as
before.

Reviewed by: kib, markj, jhb
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D31989

(cherry picked from commit 1adebe3cd6b1eb0973969e2c4c5d41f174caa304)

2 years agoamd64: provide PHYS_IN_DMAP() and VIRT_IN_DMAP()
Mitchell Horne [Wed, 17 Nov 2021 15:29:02 +0000 (11:29 -0400)]
amd64: provide PHYS_IN_DMAP() and VIRT_IN_DMAP()

It is useful for quickly checking an address against the DMAP region.
These definitions exist already on arm64 and riscv.

Reviewed by: kib, markj
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D32962

(cherry picked from commit 90d4da62259299a8d91fed1121be97ac5b7b6b3c)

2 years agotwsi: compile in support for debug messages, disabled by default
Andriy Gapon [Fri, 26 Nov 2021 06:52:56 +0000 (08:52 +0200)]
twsi: compile in support for debug messages, disabled by default

Debug messages can now be enabled per driver instance via a new sysctl.
Also, debug messages in TWSI_READ and TWSI_WRITE require debug level
greater than 1 as they are mostly redundant because callers of those
functions already log most interesting results.

NB: the twsi drivers call their device iichb, so the new sysctl will
appear under dev.iichb.N.

(cherry picked from commit a2793d6182256b8edf647c11c642ad3c7c83809e)

2 years agotwsi: remove write-only softc field
Andriy Gapon [Fri, 26 Nov 2021 06:45:12 +0000 (08:45 +0200)]
twsi: remove write-only softc field

(cherry picked from commit f00bc54f62c455c7ed44afee736c3c64873a305a)

2 years agotwsi: add more of status definitions
Andriy Gapon [Fri, 26 Nov 2021 06:30:22 +0000 (08:30 +0200)]
twsi: add more of status definitions

For completeness and for future use.

(cherry picked from commit de86f339cdda0a10130033ff1771fb13cfacd9d0)

2 years agotwsi: sort headers, remove unneeded
Andriy Gapon [Fri, 26 Nov 2021 06:28:41 +0000 (08:28 +0200)]
twsi: sort headers, remove unneeded

(cherry picked from commit 26559dd1770bb49c68f58a5fbcea3b4c96534c94)

2 years agousb/u3g: Add support for Quectel EM05.
Hans Petter Selasky [Thu, 25 Nov 2021 14:27:50 +0000 (15:27 +0100)]
usb/u3g: Add support for Quectel EM05.

Pull Request: https://github.com/freebsd/freebsd-src/pull/565
Sponsored by: NVIDIA Networking

(cherry picked from commit 0229172a65765392f566ae1cdc730615ab504e15)

2 years agolink_elf_obj: Process global ifunc relocs after other global relocs
Mark Johnston [Thu, 25 Nov 2021 21:52:17 +0000 (16:52 -0500)]
link_elf_obj: Process global ifunc relocs after other global relocs

This is needed to ensure that resolvers that reference global symbols
return correct results.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b11e6fd75b1bb9d337b0edab14d160ff65b11aae)

2 years agomake_dev.9: Fix a typo
Mark Johnston [Thu, 25 Nov 2021 16:32:30 +0000 (11:32 -0500)]
make_dev.9: Fix a typo

(cherry picked from commit cc7decfcf93be2a9e78923cc9782fd913f70b78e)

2 years agork_spi: declare support for rk3328
Andriy Gapon [Thu, 25 Nov 2021 21:12:11 +0000 (23:12 +0200)]
rk_spi: declare support for rk3328

Tested on Rock64 using the onboard SPI flash.

(cherry picked from commit 8c12ee5021e293c992a7b54215fda1edfbebaa25)

2 years agoswap_pager: lock vnode in swapdev_strategy()
Konstantin Belousov [Wed, 24 Nov 2021 11:26:46 +0000 (13:26 +0200)]
swap_pager: lock vnode in swapdev_strategy()

(cherry picked from commit b19740f4ce7a542783f87de2fee48476a7801d86)

2 years agoswapon: extend the region where the swap vnode is locked
Konstantin Belousov [Wed, 24 Nov 2021 03:06:02 +0000 (05:06 +0200)]
swapon: extend the region where the swap vnode is locked

(cherry picked from commit 6ddf41faa6f54738db9b3f313086974b6403d680)

2 years agoswap pager: lock vnode around VOP_CLOSE()
Konstantin Belousov [Tue, 23 Nov 2021 09:16:53 +0000 (11:16 +0200)]
swap pager: lock vnode around VOP_CLOSE()

(cherry picked from commit a6d04f34a4db6ff3fd5431ae10d4b877337fc138)

2 years agomountd: Fix handling of usernames that start with a digit
Rick Macklem [Thu, 18 Nov 2021 21:35:25 +0000 (13:35 -0800)]
mountd: Fix handling of usernames that start with a digit

yocalebo_gmail.com submitted a patch for mountd.c that
fixes the case where a username starts with a digit.
Without this patch, the username that starts with a
digit is misinterpreted as a numeric uid.
With this patch, any string that does not entirely
convert to a decimal number via strtoul() is considered
a user/group name.

(cherry picked from commit f4bf849bb894f4934b8df6c04a820dfa52e9576c)

2 years agorc.conf.5: Add entries for NFS
Rick Macklem [Thu, 18 Nov 2021 15:59:34 +0000 (07:59 -0800)]
rc.conf.5: Add entries for NFS

Entries for a few recently defined rc variables
were missing from rc.conf.5.  This patch adds
those.

It was not obvious to me what the ordering is,
so I added them to the area where other nfsd
related variables are.  I can easily move them.

I also replaced "are" with "is", since it seems to
read better.

This is a content change.

(cherry picked from commit 9dae2d03bc644be38196cf76c55039af1a7c1ba6)

2 years agonfsd: Add a new rc variable nfs_server_maxio
Rick Macklem [Wed, 17 Nov 2021 00:02:53 +0000 (16:02 -0800)]
nfsd: Add a new rc variable nfs_server_maxio

Since vfs.nfsd.srvmaxio can only be set when nfsd.ko
is loaded, but nfsd is not running, setting it in
/etc/sysctl.conf is not feasible when "options NFSD"
was not specified for the kernel.

This patch adds a new rc variable nfs_server_maxio,
which sets vfs.nfsd.srvmaxio at the correct time.

rc.conf.5 will be patched separately.

(cherry picked from commit 5509bad74e44eed3b9d54fbd74d3752b88428147)

2 years agopowerpc64le: add LINT64LE kernel config
Alfredo Dal'Ava Junior [Mon, 29 Nov 2021 15:08:26 +0000 (12:08 -0300)]
powerpc64le: add LINT64LE kernel config

Add configuration file to be used by "FreeBSD-<branch>-powerpc64le-LINT"
CI/Jenkins job

Reviewed by: lwhsu
MFC after: 2 days
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D33136

(cherry picked from commit e671037b3c49734566e7e0af74ba1a64f45b77a2)

2 years agopowerpc64: make autoboot possible on powernv machines
Alfredo Dal'Ava Junior [Fri, 26 Nov 2021 00:02:53 +0000 (21:02 -0300)]
powerpc64: make autoboot possible on powernv machines

It's required to specify a default boot option in order to make
petitboot's autoboot feature work.

Tested on Raptor Blackbird

Reviewed by: imp, luporl
MFC after: 2 days
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D32838

(cherry picked from commit b6644f529ca4c13975727c5625415fcc30c60af6)

2 years agopf tests: Test PR259689
Kristof Provost [Mon, 8 Nov 2021 12:28:43 +0000 (13:28 +0100)]
pf tests: Test PR259689

We didn't populate dyncnt/tblcnt, so `pfctl -sr -vv` might not have the
table element count.

PR: 259689
MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D32893

(cherry picked from commit 2de49deeca0b1377664dee2cd0a43ee7cf6b4bc4)

2 years agopf: ensure we populate dyncnt/tblcnt in struct pf_addr_wrap
Kristof Provost [Mon, 8 Nov 2021 12:25:20 +0000 (13:25 +0100)]
pf: ensure we populate dyncnt/tblcnt in struct pf_addr_wrap

PR: 259689
MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D32892

(cherry picked from commit 218a8a491c4980dcc941908f9505d37e7f052868)

2 years agonet tests: basic if_stf test
Kristof Provost [Fri, 5 Nov 2021 14:20:19 +0000 (15:20 +0100)]
net tests: basic if_stf test

Test the 6to4 code.

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D32850

(cherry picked from commit eb5e0755f7496d1328d572b4d181c70b39152f08)

2 years agoif_stf: style(9) pass
Kristof Provost [Fri, 5 Nov 2021 10:20:16 +0000 (11:20 +0100)]
if_stf: style(9) pass

As stated in style(9): "Values in return statements should be enclosed
in parentheses."

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D32848

(cherry picked from commit 3576121c8b1fcaa31b3a45ea52ff83f7c5855266)

2 years agoif_stf: enable use in vnet jails
Kristof Provost [Fri, 5 Nov 2021 11:01:37 +0000 (12:01 +0100)]
if_stf: enable use in vnet jails

The cloner must be per-vnet so that cloned interfaces get destroyed when
the vnet goes away. Otherwise we fail assertions in vnet_if_uninit():

panic: vnet_if_uninit:475 tailq &V_ifnet=0xfffffe01665fe070 not empty
cpuid = 19
time = 1636107064
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe015d0cac60
vpanic() at vpanic+0x187/frame 0xfffffe015d0cacc0
panic() at panic+0x43/frame 0xfffffe015d0cad20
vnet_if_uninit() at vnet_if_uninit+0x7b/frame 0xfffffe015d0cad30
vnet_destroy() at vnet_destroy+0x170/frame 0xfffffe015d0cad60
prison_deref() at prison_deref+0x9b0/frame 0xfffffe015d0cadd0
sys_jail_remove() at sys_jail_remove+0x119/frame 0xfffffe015d0cae00
amd64_syscall() at amd64_syscall+0x12e/frame 0xfffffe015d0caf30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe015d0caf30
--- syscall (508, FreeBSD ELF64, sys_jail_remove), rip = 0x8011e920a, rsp = 0x7fffffffe788, rbp = 0x7fffffffe810 ---
KDB: enter: panic

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D32849

(cherry picked from commit 8e45fed3aefd00ff544efce8fedeba5e099d3d01)

2 years agonetinet: Remove unneeded mb_unmapped_to_ext() calls
Mark Johnston [Wed, 24 Nov 2021 18:20:09 +0000 (13:20 -0500)]
netinet: Remove unneeded mb_unmapped_to_ext() calls

in_cksum_skip() now handles unmapped mbufs on platforms where they're
permitted.

Reviewed by: glebius, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 44775b163bfa902ea96658343e852062e2e67a8e)

2 years agonetinet: Implement in_cksum_skip() using m_apply()
Mark Johnston [Wed, 24 Nov 2021 18:19:54 +0000 (13:19 -0500)]
netinet: Implement in_cksum_skip() using m_apply()

This allows it to work with unmapped mbufs.  In particular,
in_cksum_skip() calls no longer need to be preceded by calls to
mb_unmapped_to_ext() to avoid a page fault.

PR: 259645
Reviewed by: gallatin, glebius, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 0d9c3423f59bb305301f5a5bc7c8f5daf7b7aa52)

2 years agonetinet: Deduplicate most in_cksum() implementations
Mark Johnston [Wed, 24 Nov 2021 18:19:44 +0000 (13:19 -0500)]
netinet: Deduplicate most in_cksum() implementations

in_cksum() and related routines are implemented separately for each
platform, but only i386 and arm have optimized versions.  Other
platforms' copies of in_cksum.c are identical except for style
differences and support for big-endian CPUs.

Deduplicate the implementations for the rest of the platforms.  This
will make it easier to implement in_cksum() for unmapped mbufs.  On arm
and i386, define HAVE_MD_IN_CKSUM to mean that the MI implementation is
not to be compiled.

No functional change intended.

Reviewed by: kp, glebius
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ecbbe831445a4b94279e5932828d60076e4ca444)

2 years agonetinet: Remove in_cksum.c
Mark Johnston [Wed, 24 Nov 2021 18:19:34 +0000 (13:19 -0500)]
netinet: Remove in_cksum.c

It does not get compiled into the kernel.  No functional change
inteneded.

Reviewed by: kp, glebius, cy
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 5195bcc2126b302802643f5204d1030e5893fb62)

2 years agonatd: Remove uneeded in_cksum.h includes
Mark Johnston [Wed, 24 Nov 2021 18:30:28 +0000 (13:30 -0500)]
natd: Remove uneeded in_cksum.h includes

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 517373f7230207e60e4561bc44c8b3c44acea963)

2 years agonetinet: Remove in_cksum_update()
Mark Johnston [Wed, 24 Nov 2021 18:15:40 +0000 (13:15 -0500)]
netinet: Remove in_cksum_update()

It was never implemented on powerpc or riscv and appears to have been
unused since it was added in 1998.  No functional change intended.

Reviewed by: kp, glebius, cy
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 09100f936be0684aa8caef441b96345960fd9c72)

2 years agosafexcel: Fix -Wunused-but-set-variable warnings
Mark Johnston [Wed, 24 Nov 2021 18:30:39 +0000 (13:30 -0500)]
safexcel: Fix -Wunused-but-set-variable warnings

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 60c95f316374fdd383f70b50e98ad097460accf3)

2 years agoldconfig(8): check for no-args command line after options are parsed
Konstantin Belousov [Fri, 19 Nov 2021 04:07:58 +0000 (06:07 +0200)]
ldconfig(8): check for no-args command line after options are parsed

(cherry picked from commit 3ede04c78c7c726ed79a39d22c65a58d0ecc5d00)

2 years agoldconfig: use libexec/rtld-elf/rtld_paths.h
Konstantin Belousov [Fri, 19 Nov 2021 03:45:31 +0000 (05:45 +0200)]
ldconfig: use libexec/rtld-elf/rtld_paths.h

(cherry picked from commit af9115870670f508c11b3d173bcff5116d8ef320)

2 years agortld_paths.h: Provide _PATH_ELF32_HINTS string, unconditionally
Konstantin Belousov [Fri, 19 Nov 2021 03:44:33 +0000 (05:44 +0200)]
rtld_paths.h: Provide _PATH_ELF32_HINTS string, unconditionally

(cherry picked from commit f340188625d4e0e4db850becb0a9b25448053e10)

2 years agoldconfig(8): nostd/-s does nothing
Konstantin Belousov [Fri, 19 Nov 2021 05:21:21 +0000 (07:21 +0200)]
ldconfig(8): nostd/-s does nothing

(cherry picked from commit b828161d123bec894bc5a320ef26d6afc9b13ae8)

2 years agoldconfig: start of cleanup
Konstantin Belousov [Fri, 19 Nov 2021 03:35:50 +0000 (05:35 +0200)]
ldconfig: start of cleanup

(cherry picked from commit 3f2c6f5598410b7233b0acd1c804a0473fa1e9fa)

2 years agoldconfig: remove a comment which is another remnant of a.out support
Konstantin Belousov [Wed, 24 Nov 2021 20:44:20 +0000 (22:44 +0200)]
ldconfig: remove a comment which is another remnant of a.out support

(cherry picked from commit 83511ce5c473406e0661247e40971be28e218684)

2 years agoktls.4: fix openssl-devel port name
Sergey A. Osokin [Fri, 12 Nov 2021 14:31:48 +0000 (09:31 -0500)]
ktls.4: fix openssl-devel port name

PR: 259630
(cherry picked from commit b39a93b18ef17dcb1897186b1f01999337b9f8b9)

2 years agoevdev: Add parentheses around '-' expression in operand of '&'.
John Baldwin [Wed, 15 Sep 2021 16:03:18 +0000 (09:03 -0700)]
evdev: Add parentheses around '-' expression in operand of '&'.

This fixes a -Wparentheses error with GCC 9.

Reviewed by: wulf
Differential Revision: https://reviews.freebsd.org/D31947

(cherry picked from commit d99c87c8d54a02a229cbeaa19ec8784b1d5afbb9)

2 years agoHyper-V: vPCI: Prepopulate device bars
Wei Hu [Sat, 27 Nov 2021 06:42:34 +0000 (06:42 +0000)]
Hyper-V: vPCI: Prepopulate device bars

In recent Hyper-V releases on Windows Server 2022, vPCI code does not
initialize the last 4 bit of device bar registers. This behavior change
could result weird problems cuasing PCI code failure when configuring
bars.

Just write all 1's to those bars whose probed values are not the same
as current read ones. This seems to make Hyper-V vPCI and
pci_write_bar() to cooperate correctly on these releases.

Reported by: khng@freebsd.org
Tested by: khng@freebsd.org
MFC after: 2 weeks
Sponsored by: Microsoft

(cherry picked from commit 75412a521f60d4b0393c730ffb284e7c6ff9d2de)

2 years agosctp: Remove now-unneeded mb_unmapped_to_ext() calls
Mark Johnston [Tue, 16 Nov 2021 18:38:09 +0000 (13:38 -0500)]
sctp: Remove now-unneeded mb_unmapped_to_ext() calls

sctp_delayed_checksum() now handles unmapped mbufs, thanks to m_apply().

No functional change intended.

Reviewed by: tuexen
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 756bb50b6a867f3309ce76d76f1842a667dd303a)

2 years agosctp: Use m_apply() to calcuate a checksum for an mbuf chain
Mark Johnston [Tue, 16 Nov 2021 18:36:30 +0000 (13:36 -0500)]
sctp: Use m_apply() to calcuate a checksum for an mbuf chain

m_apply() works on unmapped mbufs, so this will let us elide
mb_unmapped_to_ext() calls preceding sctp_calculate_cksum() calls in
the network stack.

Modify sctp_calculate_cksum() to assume it's passed an mbuf header.
This assumption appears to be true in practice, and we need to know the
full length of the chain.

No functional change intended.

Reviewed by: tuexen, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b4d758a0cc54d991d2bdf7f697ec0b6b3fd6230d)

2 years agombuf: Only allow extpg mbufs if the system has a direct map
Mark Johnston [Tue, 16 Nov 2021 18:31:04 +0000 (13:31 -0500)]
mbuf: Only allow extpg mbufs if the system has a direct map

Some upcoming changes will modify software checksum routines like
in_cksum() to operate using m_apply(), which uses the direct map to
access packet data for unmapped mbufs.  This approach of course does not
work on platforms without a direct map, so we have to disallow the use
of unmapped mbufs on such platforms.

I believe this is the right tradeoff: we only configure KTLS on amd64
and arm64 today (and one KTLS consumer, NFS TLS, requires a direct map
already), and the use of unmapped mbufs with plain sendfile is a recent
optimization.  If need be, m_apply() could be modified to create
CPU-private mappings of extpg mbuf pages as a fallback.

So, change mb_use_ext_pgs to be hard-wired to zero on systems without a
direct map.  Note that PMAP_HAS_DMAP is not a compile-time constant on
some systems, so the default value of mb_use_ext_pgs has to be
determined during boot.

Reviewed by: jhb
Discussed with: gallatin
Sponsored by: The FreeBSD Foundation

(cherry picked from commit fcaa890c4469118255d463495b4044eef484fa3e)

2 years agoext2fs: check for eh_depth in ext4_ext_check_header()
Neel Chauhan [Wed, 17 Nov 2021 00:25:04 +0000 (16:25 -0800)]
ext2fs: check for eh_depth in ext4_ext_check_header()

PR: 259112
Reported by: Robert Morris <rtm@lcs.mit.edu>
Reviewed by: fsu (src)
Differential Revision: https://reviews.freebsd.org/D33030

(cherry picked from commit be60d8f276fa20fc11ad814e54c9c2540f79c7da)

2 years agosyslogd: fix WITHOUT_INET builds
Artem Khramov [Sat, 12 Jun 2021 17:21:13 +0000 (20:21 +0300)]
syslogd: fix WITHOUT_INET builds

Since 2d82b47 syslogd can't be built with `WITHOUT_INET` or
`WITHOUT_INET6` build variables set, because `iovlist_truncate` is not
defined but used.

This change wraps the problematic `iovlist_truncate` call within ifdef
directive.  It's compiled out in this situation...

Pull Request: https://github.com/freebsd/freebsd-src/pull/475
Reviewed by: imp@ (commit message slightly tweaked)

(cherry picked from commit f06fa6f88733d709a5f9dd3a27b1a08571e49e6b)

PR: 260098

2 years agosrc.conf.5: regen
Ed Maste [Mon, 29 Nov 2021 14:16:17 +0000 (09:16 -0500)]
src.conf.5: regen

2 years agoDo not build libatf-c++ when WITHOUT_CXX
Ed Maste [Fri, 29 Oct 2021 03:01:21 +0000 (23:01 -0400)]
Do not build libatf-c++ when WITHOUT_CXX

libatf-c++ requires C++ support.

From jrtc27: bit slightly odd this isn't gated by MK_TESTS (which itself
depends on MK_CXX), but this makes sense given the current behaviour.

Reported by: Michael Dexter, Build Option Survey
Reviewed by: imp, jrtc27
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32732

(cherry picked from commit 6ce99625ca7acecaa64723f0440007eb3f60f53d)

2 years agosrc.opts.mk: Add WITHOUT_CXX dependencies
Ed Maste [Fri, 29 Oct 2021 01:43:33 +0000 (21:43 -0400)]
src.opts.mk: Add WITHOUT_CXX dependencies

OFED, OPENMP, and PMC depend on C++ support.  Force them off when
building WITHOUT_CXX.

Reported by: Michael Dexter, Build Option Survey
Reviewed by: imp, jrtc27
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32730

(cherry picked from commit 0e1c864898c1803835b1be0d59342ca761051db8)

2 years agoDon't build sanitizer runtimes under WITHOUT_CXX
Ed Maste [Fri, 29 Oct 2021 00:49:12 +0000 (20:49 -0400)]
Don't build sanitizer runtimes under WITHOUT_CXX

In the past we built the sanitizer runtimes when building Clang
(and using Clang as the compiler) but 7676b388adbc changed this to
be conditional only on using Clang, to make the runtimes available
for external Clang.

They fail to build when WITHOUT_CXX is set though, so add MK_CXX
as part of the condition.

Reported by: Michael Dexter, Build Option Survey
Reviewed by: imp, jrtc27
Fixes: 7676b388adbc ("Always build the sanitizer runtimes...")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32731

(cherry picked from commit ad09e2c8cfbc2cf6f2b8826c121d6de8b3bfe96d)

2 years agonet tests: basic if_gif(4) test case
Kristof Provost [Thu, 4 Nov 2021 16:15:19 +0000 (17:15 +0100)]
net tests: basic if_gif(4) test case

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D32836

(cherry picked from commit 6e0755b37b20f776c7a9ac7a720db1af13966717)

2 years agoif_gif: fix vnet shutdown panic
Kristof Provost [Thu, 4 Nov 2021 17:05:58 +0000 (18:05 +0100)]
if_gif: fix vnet shutdown panic

If an if_gif exists and has an address assigned inside a vnet when the
vnet is shut down we failed to clean up the address, leading to a panic
when we ip_destroy() and the V_in_ifaddrhashtbl is not empty.

This happens because of the VNET_SYS(UN)INIT order, which means we
destroy the if_gif interface before the addresses can be purged (and
if_detach() does not remove addresses, it assumes this will be done by
the stack teardown code).

Set subsystem SI_SUB_PSEUDO just like if_bridge so the cleanup
operations happen in the correct order.

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D32835

(cherry picked from commit 8ca6c11a7cf834721c03cbe1a1aab0a17bae4d4d)

2 years agoHoist cddl prebuild lib dependency definitions out of a MK_ZFS block
Mark Johnston [Fri, 26 Nov 2021 14:27:19 +0000 (09:27 -0500)]
Hoist cddl prebuild lib dependency definitions out of a MK_ZFS block

The compilation of several libraries under cddl/lib is not conditional
on MK_ZFS = "yes", so their dependency on libspl is not conditional
either.  Unbreak buildworld when WITHOUT_ZFS is set.

Reported by: bz
Fixes: 9e9c651caceb ("cddl: fix missing ZFS library dependencies")

(cherry picked from commit 7b3642da21cb4b1c301d8c6b6ce0847d19d8a473)

2 years agocddl: fix missing ZFS library dependencies
Greg V [Sat, 16 Oct 2021 16:29:28 +0000 (19:29 +0300)]
cddl: fix missing ZFS library dependencies

In 9fae47666 zfsd got a libspl dependency to avoid undefined references.
However that workaround did not help external consumers of libzfs_core.

Fix all missing dependencies lld 13 and the rtld complain about.

Reviewed by: freqlabs, markj

(cherry picked from commit 9e9c651caceb9ecd17131e8bb29791ba4cf1cec7)

2 years agoamd64: Initialize kernel_pmap's active CPU set to all_cpus
Mark Johnston [Mon, 15 Nov 2021 17:41:24 +0000 (12:41 -0500)]
amd64: Initialize kernel_pmap's active CPU set to all_cpus

This is in preference to simply filling the cpuset, and allows the
conditional in pmap_invalidate_cpu_mask() to be elided.

Also export pmap_invalidate_cpu_mask() outside of pmap.c for use in a
subsequent commit.

Suggested by: kib
Reviewed by: alc, kib
Tested by: pho
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 71e6e9da225aede95f6813a0fcf886538d0da9fe)

2 years agovm_page: Remove vm_page_sbusy() and vm_page_xbusy()
Mark Johnston [Mon, 15 Nov 2021 16:35:52 +0000 (11:35 -0500)]
vm_page: Remove vm_page_sbusy() and vm_page_xbusy()

They are unused today and cannot be safely used in the face of unlocked
lookup, in which pages may be busied without the object lock held.

Obtained from: jeff (object_concurrency patches)
Reviewed by: kib

(cherry picked from commit a2665158d03e87dad410384e5c61c72e675f3edd)

2 years agovm_page: Consolidate page busy sleep mechanisms
Mark Johnston [Mon, 15 Nov 2021 16:35:44 +0000 (11:35 -0500)]
vm_page: Consolidate page busy sleep mechanisms

- Modify vm_page_busy_sleep() and vm_page_busy_sleep_unlocked() to take
  a VM_ALLOC_* flag indicating whether to sleep on shared-busy, and fix
  up callers.
- Modify vm_page_busy_sleep() to return a status indicating whether the
  object lock was dropped, and fix up callers.
- Convert callers of vm_page_sleep_if_busy() to use vm_page_busy_sleep()
  instead.
- Remove vm_page_sleep_if_(x)busy().

No functional change intended.

Obtained from: jeff (object_concurrency patches)
Reviewed by: kib

(cherry picked from commit 87b646630c4892e21446cd096bea6bcaecea33ac)

2 years agovm: Add a mode to vm_object_page_remove() which skips invalid pages
Mark Johnston [Mon, 15 Nov 2021 16:44:04 +0000 (11:44 -0500)]
vm: Add a mode to vm_object_page_remove() which skips invalid pages

This will be used to break a deadlock in ZFS between the per-mountpoint
teardown lock and page busy locks.  In particular, when purging data
from the page cache during dataset rollback, we want to avoid blocking
on the busy state of invalid pages since the busying thread may be
blocked on the teardown lock in zfs_getpages().

Add a helper, vn_pages_remove_valid(), for use by filesystems.  Bump
__FreeBSD_version so that the OpenZFS port can make use of the new
helper.

PR: 258208
Reviewed by: avg, kib, sef
Tested by: pho (part of a larger patch)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit d28af1abf031ee87a478b37180e3f0c518caedf6)

2 years agoFix segment size in compressing core dumps
Justin Hibbits [Fri, 1 Oct 2021 18:39:18 +0000 (13:39 -0500)]
Fix segment size in compressing core dumps

A core segment is bounded in size only by memory size.  On 64-bit
architectures this means a segment can be much larger than 4GB.
However, compress_chunk() takes only a u_int, clamping segment size to
4GB-1, resulting in a truncated core.  Everything else, including the
compressor internally, uses size_t, so use size_t at the boundary here.

This dates back to the original refactor back in 2015 (r279801 /
aa14e9b7).

PR: 260006
Sponsored by: Juniper Networks, Inc.

(cherry picked from commit 63cb9308a75b99fe057409705bc1b2ac0293f578)

2 years agopchtherm: Let the driver be compiled into the kernel
N.J. Mann [Mon, 22 Nov 2021 17:04:05 +0000 (12:04 -0500)]
pchtherm: Let the driver be compiled into the kernel

PR: 259776

(cherry picked from commit a11983366ea72165809837a667d58e2ad440c496)

2 years agonfsstat: Add output for counts of new RPCs to the "-E" option
Rick Macklem [Sun, 14 Nov 2021 21:36:14 +0000 (13:36 -0800)]
nfsstat: Add output for counts of new RPCs to the "-E" option

Add output to the "-E" option for new RPCs related
to NFSv4.1/4.2. Also, add output of the counts for
allocated layouts and the title for the "Client"
section (which was lost during a previous commit).

(cherry picked from commit 75c666197cc7574f6f0d48344f8725f72072fc84)

2 years agostyle.Makefile.5: Do not require $FreeBSD$ SCM IDs
Mateusz Piotrowski [Thu, 18 Nov 2021 21:00:30 +0000 (22:00 +0100)]
style.Makefile.5: Do not require $FreeBSD$ SCM IDs

It's no longer required to have those SCM IDs at the start of makefiles.

MFC after: 3 days

(cherry picked from commit 1ac5586c6d86134922e18871b270ca483c00bf8b)

2 years agoos-release.5: Fix quoting of dots
Mateusz Piotrowski [Tue, 23 Nov 2021 10:34:44 +0000 (11:34 +0100)]
os-release.5: Fix quoting of dots

Dots needs to escaped with \& to be places inside Ql quotes.

MFC after: 3 days

(cherry picked from commit ee7485bef53df9108a20e497dac6341d030248ce)

2 years agoffs_softdep: Fix a typo in a source code comment
Gordon Bergling [Fri, 19 Nov 2021 18:17:41 +0000 (19:17 +0100)]
ffs_softdep: Fix a typo in a source code comment

- s/conditonally/conditionally/

(cherry picked from commit bebff615877efdf549e5033b47ade4d8553f6a77)

2 years agoppbus(4): Fix a typo in source code comment
Gordon Bergling [Fri, 19 Nov 2021 18:19:36 +0000 (19:19 +0100)]
ppbus(4): Fix a typo in source code comment

- s/quering/querying/

Obtained from: NetBSD

(cherry picked from commit 975e2e3f84b0b7425185c9bb43722da779e8cd98)

2 years agolpr(1): Fix a typo in a source code comment
Gordon Bergling [Fri, 19 Nov 2021 19:04:09 +0000 (20:04 +0100)]
lpr(1): Fix a typo in a source code comment

-s /debuging/debugging/

(cherry picked from commit 840d72371bdc48be58152c839160c492bef7f1b7)

2 years agofirewire(4): Fix a typo in a source code comment
Gordon Bergling [Fri, 19 Nov 2021 18:50:56 +0000 (19:50 +0100)]
firewire(4): Fix a typo in a source code comment

- s/unavailabe/unavailable/

(cherry picked from commit 3e5ddef0fd391049f378456e10a0cea015652bc0)

2 years agoixl(4): Fix a typo in a sysctl description
Gordon Bergling [Fri, 19 Nov 2021 18:59:28 +0000 (19:59 +0100)]
ixl(4): Fix a typo in a sysctl description

(cherry picked from commit d7125850f031f8e763ff35c70fda310a1419b876)

2 years agoiscsi(4): Fix a typo in a source code comment
Gordon Bergling [Fri, 19 Nov 2021 18:29:21 +0000 (19:29 +0100)]
iscsi(4): Fix a typo in a source code comment

- s/conditon/condition/

(cherry picked from commit 5e21882bb4e7d36ebcf0300234486a54ff4e7b13)

2 years agosched_ule(4): Fix two typo in source code comments
Gordon Bergling [Fri, 19 Nov 2021 18:13:28 +0000 (19:13 +0100)]
sched_ule(4): Fix two typo in source code comments

- s/conditons/conditions/
- s/unconditonally/unconditionally/

(cherry picked from commit 15b5c347f1916d14e84765ae68921755ee930612)

2 years agoTWL: Fix a typo in a source code comment
Gordon Bergling [Fri, 19 Nov 2021 18:26:34 +0000 (19:26 +0100)]
TWL: Fix a typo in a source code comment

- s/maxium/maximum/

(cherry picked from commit 8b11850f9d04c096d8ed3647db512f8feceefaf4)

2 years agomkimg: zero entry in vhdx_write_metadata
Ed Maste [Sun, 21 Nov 2021 00:29:11 +0000 (19:29 -0500)]
mkimg: zero entry in vhdx_write_metadata

Otherwise _reserved might contain uninitialized data.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 036af1053acd6cae68c5fb6bed30508f2e40be13)

2 years agoFix coredump_phnum test with ASLR enabled
Ed Maste [Sun, 21 Nov 2021 17:17:20 +0000 (12:17 -0500)]
Fix coredump_phnum test with ASLR enabled

coredump_phnum intends to generate a core file with many PT_LOAD
segments.  Previously it called mmap() in a loop with alternating
protections, relying on each mapping following the previous, to produce
a core file with many page-sized PT_LOAD segments.  With ASLR on we no
longer have this property of each mmap() following the previous.

Instead, perform a single allocation, and then use mprotect() to set
alternating pages to PROT_READ.

PR: 259970
Reported by: lwhsu, mw
Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33070

(cherry picked from commit 8ec4c5dae32765701ac70811455084efd1570c32)

2 years agong_h4: add deprecation notice
Ed Maste [Thu, 25 Nov 2021 16:55:34 +0000 (11:55 -0500)]
ng_h4: add deprecation notice

It is already gone in FreeBSD 14.

Sponsored by: The FreeBSD Foundation

2 years agoicee: allow configuration via hints on FDT-based systems
Andriy Gapon [Thu, 4 Nov 2021 11:56:22 +0000 (13:56 +0200)]
icee: allow configuration via hints on FDT-based systems

On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.

(cherry picked from commit 01e3492337cb48484e03be38340cc67ac5e30a5b)

2 years agods1307: allow configuration via hints on FDT-based systems
Andriy Gapon [Thu, 4 Nov 2021 11:55:35 +0000 (13:55 +0200)]
ds1307: allow configuration via hints on FDT-based systems

On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.

(cherry picked from commit 27645265c4e49ad7eaa25847a280307acb138da8)

2 years agosddadone: 'error' gets assigned only errno codes, never MMC_ERR codes
Andriy Gapon [Fri, 9 Jul 2021 14:28:40 +0000 (17:28 +0300)]
sddadone: 'error' gets assigned only errno codes, never MMC_ERR codes

(cherry picked from commit e17b58ecbcb644f76cceda4ca7ff08f7677b5dfd)

2 years agopNFS: Add nfsstats counters for number of Layouts
Rick Macklem [Sat, 13 Nov 2021 01:32:55 +0000 (17:32 -0800)]
pNFS: Add nfsstats counters for number of Layouts

For pNFS, Layouts are issued by the server to indicate
where a file's data resides on the DS(s).  This patch
adds counters for how many layouts are allocated to
the nfsstatsv1 structure, using two reserved fields.

(cherry picked from commit ce9676de86f267986f61979151101e3d8a6d61bc)

2 years agoofwfb: fix vga/hdmi console with ASMEDIA during boot on powerpc64(le)
Alfredo Dal'Ava Junior [Wed, 3 Nov 2021 16:42:28 +0000 (13:42 -0300)]
ofwfb: fix vga/hdmi console with ASMEDIA during boot on powerpc64(le)

On recent OpenBMC firmware, the onboard ASMEDIA video card framebuffer
address was removed from device tree for security purposes (value is set
to zero to avoid leaking the address).

This patch works around the problem by taking framebuffer base address
from the "ranges" property of a parent node.

Reviewed by: luporl, jhibbits (on IRC)
MFC after: 2 weeks
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D30626

(cherry picked from commit b042d10cdc71ddd6ef3449261d712b05c648746e)

2 years agolibpfct: be consistent with u_int vs. uint
Kristof Provost [Fri, 5 Nov 2021 08:37:56 +0000 (09:37 +0100)]
libpfct: be consistent with u_int vs. uint

Always use uint64_t over u_int64_t, for the sake of consistency.

No functional change.

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 7bb3c927f7d9c48b356b4d20907b813f9b83273b)

2 years agolagg: fix unused-but-set-variable
Kristof Provost [Fri, 19 Nov 2021 16:22:48 +0000 (17:22 +0100)]
lagg: fix unused-but-set-variable

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 3142d4f622d2f95da5c7c52f60ce840411a07b0a)

2 years agopf tests: basic test for ridentifier
Kristof Provost [Fri, 29 Oct 2021 15:52:59 +0000 (17:52 +0200)]
pf tests: basic test for ridentifier

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D32751

(cherry picked from commit 508161111dc23cee0a41fa70de865743c694502f)

2 years agopf: Introduce ridentifier
Kristof Provost [Fri, 29 Oct 2021 15:40:53 +0000 (17:40 +0200)]
pf: Introduce ridentifier

Allow users to set a number on rules which will be exposed as part of
the pflog header.
The intent behind this is to allow users to correlate rules across
updates (remember that pf rules continue to exist and match existing
states, even if they're removed from the active ruleset) and pflog.

Obtained from: pfSense
MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D32750

(cherry picked from commit 76c5eecc3490d89a9a3492ed2354802b69d69602)

2 years agoUpdate deprecation version for drivers removed in main
Ed Maste [Thu, 25 Nov 2021 16:47:03 +0000 (11:47 -0500)]
Update deprecation version for drivers removed in main

Removal of the amr, esp, iir, mly and twa drivers was planned before
FreeBSD 13, but did not happen before the branch.  Update the
depreciation notices to indicate that they are gone in FreeBSD 14.

Sponsored by: The FreeBSD Foundation

2 years agocloudabi: add deprecation notice in stable branches
Ed Maste [Thu, 25 Nov 2021 16:45:59 +0000 (11:45 -0500)]
cloudabi: add deprecation notice in stable branches

It has been removed from main before 14.0.

Sponsored by: The FreeBSD Foundation

2 years agobridge(4): Use American spelling of "behavior"
Guangyuan Yang [Mon, 22 Nov 2021 02:41:49 +0000 (21:41 -0500)]
bridge(4): Use American spelling of "behavior"

Fixes: 8406182dbeb972698775e2468902bc5f6e593d72
Reported by: Pau Amma <pauamma@gundo.com>

(cherry picked from commit 28ba36c65db8b4d95abcd543b97f2ec5161cdae5)

2 years agokmod_syms.awk: fix removal of the export list from the symbol table
Konstantin Belousov [Sun, 7 Nov 2021 09:00:07 +0000 (11:00 +0200)]
kmod_syms.awk: fix removal of the export list from the symbol table

(cherry picked from commit 0d7a6199b61d55caf0a682ef072bdd107472ab49)

2 years agoFix some modules to export more used symbols
Konstantin Belousov [Sun, 7 Nov 2021 08:42:24 +0000 (10:42 +0200)]
Fix some modules to export more used symbols

(cherry picked from commit 5bb3134a8c21cb87b30e135ef168483f0333dabb)

2 years agoUPDATING: Add an entry for commit 6e8e261f0d4e
Rick Macklem [Thu, 25 Nov 2021 00:47:03 +0000 (16:47 -0800)]
UPDATING: Add an entry for commit 6e8e261f0d4e

This is a direct commit.

2 years agoparam.h: Bump __FreeBSD_version to 1300522
Rick Macklem [Thu, 25 Nov 2021 00:39:52 +0000 (16:39 -0800)]
param.h: Bump __FreeBSD_version to 1300522

Commit 6e8e261f0d4e changed the internal KAPI between the NFS modules.
Bump __FreeBSD_version to 1300522.

This is a direct commit.

2 years agonfscl: Add a LayoutError RPC for NFSv4.2 pNFS mounts
Rick Macklem [Thu, 11 Nov 2021 23:43:58 +0000 (15:43 -0800)]
nfscl: Add a LayoutError RPC for NFSv4.2 pNFS mounts

If a pNFS server's DS runs out of disk space, it replies
NFSERR_NOSPC to the client doing writing.  For the Linux
client, it then sends a LayoutError RPC to the MDS server to
tell it about the error.  This patch adds the same to the
FreeBSD NFSv4.2 pNFS client, to maintain Linux compatible
behaviour, particlularily for non-FreeBSD pNFS servers.

(cherry picked from commit 44744f75386e2102584acbca24fbe67de16051ca)

2 years agonfsd: Fix the NFSv4.2 pNFS MDS server for NFSERR_NOSPC via LayoutError
Rick Macklem [Mon, 8 Nov 2021 23:58:00 +0000 (15:58 -0800)]
nfsd: Fix the NFSv4.2 pNFS MDS server for NFSERR_NOSPC via LayoutError

If a pNFS server's DS runs out of disk space, it replies
NFSERR_NOSPC to the client doing writing.  For the Linux
client, it then sends a LayoutError RPC to the MDS server to
tell it about the error and keeps retrying, doing repeated
LayoutGets to the MDS and Write RPCs to the DS.  The Linux client is
"stuck" until disk space on the DS is free'd up unless
a subsequent LayoutGet request is sent a NFSERR_NOSPC
reply.
The looping problem still occurs for NFSv4.1 mounts, but no
fix for this is known at this time.

This patch changes the pNFS MDS server to reply to LayoutGet
operations with NFSERR_NOSPC once a LayoutError reports the
problem, until the DS has available space.  This keeps the Linux
NFSv4.2 from looping.

Found during recent testing because of issues w.r.t. a DS
being out of space found during a recent IEFT NFSv4 working
group testing event.

(cherry picked from commit f8dc06303bac39be53872de7429aa54694b3f86a)