]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agopkg(7): indentation fixes
Baptiste Daroussin [Tue, 27 Apr 2021 02:07:05 +0000 (04:07 +0200)]
pkg(7): indentation fixes

Non functional changes

(cherry picked from commit f648d757b76d70d58bbda7c3ed3ff79261d24d0f)

3 years agopkg(7): when bootstrapping first search for pkg.pkg file then pkg.
Baptiste Daroussin [Fri, 12 Mar 2021 17:36:30 +0000 (18:36 +0100)]
pkg(7): when bootstrapping first search for pkg.pkg file then pkg.

The package extension is going to be changed to .pkg to be among other
things resilient to the change of compression format used and reduce
the impact of all third party tool of that change.

Ensure the bootstrap knows about it

Reviewed by: manu
Differential revision: https://reviews.freebsd.org/D29232

(cherry picked from commit a2aac2f5e5642740507a3cadb98046f3dd434ce4)
(cherry picked from commit c244b1d8a38731041d0f3ff4191192a85dd8608b)

3 years agopkg(7): add an -r reponame option for bootstrap and add
Kyle Evans [Fri, 12 Feb 2021 00:58:26 +0000 (18:58 -0600)]
pkg(7): add an -r reponame option for bootstrap and add

This is limited to bootstrap/add because some real pkg(8) commands
have -r flags with an incompatible meaning/usage, e.g., pkg-audit.
pkg(7) will still commence the search as it has, but it will ignore any
repo objects without the given name so that overrides and whatnot still
work as expected.

The use of it for add is noted in the manpage; notably, that the
signature config for that repository will be used over global config if
it's specified. i.e., pkg(7) should assume that the given pkg did come
from that repository and treat it appropriately.

Reviewed by: bapt, manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28524

3 years agousr.sbin/pkg: Don't re-define roundup2
Alex Richardson [Thu, 28 Jan 2021 17:25:50 +0000 (17:25 +0000)]
usr.sbin/pkg: Don't re-define roundup2

The file already includes sys/param.h and should use that definition.
I found this while testing D28332.

Reviewed By: bapt
Differential Revision: https://reviews.freebsd.org/D28331

3 years agopkg(7): rework the arguments handling
Baptiste Daroussin [Wed, 6 Jan 2021 10:35:22 +0000 (11:35 +0100)]
pkg(7): rework the arguments handling

Rework the arguments handling around using getopt_long:
* add long option support
* add -4 and -6 support to enforce ipv4 or ipv6

While here fix a regression which occured between FreeBSD 12.1 and
FreeBSD 12.2 where pkg bootstrap -y stopped working

PR: 252270
Submitted by: evilham <contact@evilham.com>
Differential Revision: https://reviews.freebsd.org/D27860

(cherry picked from commit ae994fdc5bd2ccc0ac0b8745fd1f1be67ad6e071)

3 years agoUse asprintf instead of sbuf
Baptiste Daroussin [Mon, 19 Oct 2020 07:26:42 +0000 (07:26 +0000)]
Use asprintf instead of sbuf

3 years agofix up docs, if signature checking is enabled, the file MUST exist...
John-Mark Gurney [Fri, 6 Nov 2020 22:11:05 +0000 (22:11 +0000)]
fix up docs, if signature checking is enabled, the file MUST exist...

(cherry picked from commit e771d590741ea39be83558bda72854c65e1084ae)

3 years agopw(8): use open_memstream(3) instead of sbuf(9)
Baptiste Daroussin [Tue, 27 Apr 2021 03:05:13 +0000 (05:05 +0200)]
pw(8): use open_memstream(3) instead of sbuf(9)

open_memstream(3) is a standard function that brings here the same
functionnality what we were doing with sbuf(9).

(cherry picked from commit 0cd4b781a6fa1ed4ca04a7b642f41652e25bbc9b)

3 years agolibedit: vendor import libedit 2021-03-28
Baptiste Daroussin [Mon, 22 Mar 2021 14:34:14 +0000 (15:34 +0100)]
libedit: vendor import libedit 2021-03-28

(cherry picked from commit f9a159da2a292968cd5c37b56a6c43b6af8c5eed)
(cherry picked from commit 19318a62d7f8cfe2f0f5c24178fa33e8844ae5d1)

3 years agolibucl: vendor import snapshort 20210314
Baptiste Daroussin [Mon, 22 Mar 2021 14:13:02 +0000 (15:13 +0100)]
libucl: vendor import snapshort 20210314

(cherry picked from commit a0409676120c1e558d0ade943019934e0f15118d)

3 years agoMake pkg(7) use environment variables specified in pkg.conf
Moritz Schmitt [Tue, 27 Apr 2021 01:59:12 +0000 (03:59 +0200)]
Make pkg(7) use environment variables specified in pkg.conf

Modify /usr/sbin/pkg to use environment variables specified in pkg.conf.
This allows control over underlying libraries like fetch(3), which can
be configured by setting HTTP_PROXY.

Differential Revision: https://reviews.freebsd.org/D29820

(cherry picked from commit e869d3c60147bbb226b5ad97d2ef73391aeebafa)

3 years agosh: improve emacs mode
Baptiste Daroussin [Tue, 30 Mar 2021 09:37:29 +0000 (11:37 +0200)]
sh: improve emacs mode

In emacs mode, force ^R to backware search the history
This behaviour is the default in emacs mode for most of the other shells

Note: Note that this can still be overridden via $EDITRC, ~/.editrc or a
bind command after set -o emacs.

Approved by: jilles
Reviewed by: jilles, arichardson, pstef
Differential Revision: https://reviews.freebsd.org/D29494

(cherry picked from commit 660045fb5360d328da199ae78c89d5cc15b6d1ca)

3 years agoarcmsr(4): Fix SCSI command timeout on ARC-1886.
Xin LI [Wed, 21 Apr 2021 08:03:54 +0000 (01:03 -0700)]
arcmsr(4): Fix SCSI command timeout on ARC-1886.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by: 黃清隆 <ching2048 areca com tw>

(cherry picked from commit 438b5532070f7c52e88f514380ee8662de1f600b)

3 years agoSet PCIe device's Max_Payload_Size to match PCIe root's.
Alexander Motin [Mon, 5 Apr 2021 14:34:40 +0000 (10:34 -0400)]
Set PCIe device's Max_Payload_Size to match PCIe root's.

Usually on boot the MPS is already configured by BIOS.  But we've
found that on hot-plug it is not true at least for our Supermicro
X11 boards.  As result, mismatch between root's configuration of
256 bytes and device's default of 128 bytes cause problems for some
devices, while others seem to work fine.

MFC after: 1 month
Sponsored by: iXsystems, Inc.

(cherry picked from commit 5a898b2b78ce04d608bbaaa0813424b11f921ae7)

3 years agopf tests: Test using '<ifgroup>:network' in tables
Kristof Provost [Sun, 25 Apr 2021 10:18:48 +0000 (12:18 +0200)]
pf tests: Test using '<ifgroup>:network' in tables

MFC after: 1 week

(cherry picked from commit daa5350d0e0c5fbe42c5a057dd37b9d22df91bb7)

3 years agopfctl: Revert "pfctl: Another set skip <group> fix"
Kristof Provost [Mon, 26 Apr 2021 08:07:07 +0000 (10:07 +0200)]
pfctl: Revert "pfctl: Another set skip <group> fix"

This reverts commit 0c156a3c32cd0d9168570da5686ddc96abcbbc5a.
This fix broke using '<ifgroup>:network' in tables.

MFC after: 1 week

(cherry picked from commit d5b08e13dd6beb3436e181ff1f3e034cc8186584)

3 years agonfscommon: fix function name in comment
Rick Macklem [Tue, 20 Apr 2021 03:09:46 +0000 (20:09 -0700)]
nfscommon: fix function name in comment

(cherry picked from commit 78ffcb86d98fc9c27ac7a723c65621667036c42d)

3 years agonfsd: fix stripe size reply for the File Layout pNFS server
Rick Macklem [Tue, 20 Apr 2021 00:51:07 +0000 (17:51 -0700)]
nfsd: fix stripe size reply for the File Layout pNFS server

At a recent testing event I found out that I had misinterpreted
RFC5661 where it describes the stripe size in the File Layout's
nfl_util field. This patch fixes the pNFS File Layout server
so that it returns the correct value to the NFSv4.1/4.2 pNFS
enabled client.

This affects almost no one, since pNFS server configurations
are rare and the extant pNFS aware NFS clients seemed to
function correctly despite the erroneous stripe size.
It *might* be needed for correct behaviour if a recent
Linux client mounts a FreeBSD pNFS server configuration
that is using File Layout (non-mirrored configuration).

(cherry picked from commit 5a89498d19863d0c4cb074f9b93862a70040bf1b)

3 years agogpioc_detach: fix freeing of wrong pointers
Andriy Gapon [Tue, 23 Mar 2021 10:45:18 +0000 (12:45 +0200)]
gpioc_detach: fix freeing of wrong pointers

MFC after: 1 week

(cherry picked from commit 3c6b59567f61277ed487320aa9ad130c6894ad7a)

3 years agoimgact_elf: Ensure that the return value in parse_notes is initialized
Mark Johnston [Mon, 26 Apr 2021 18:53:16 +0000 (14:53 -0400)]
imgact_elf: Ensure that the return value in parse_notes is initialized

parse_notes relies on the caller-supplied callback to initialize "res".
Two callbacks are used in practice, brandnote_cb and note_fctl_cb, and
the latter fails to initialize res.  Fix it.

In the worst case, the bug would cause the inner loop of check_note to
examine more program headers than necessary, and the note header usually
comes last anyway.

Reviewed by: kib
Reported by: KMSAN
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29986

(cherry picked from commit 409ab7e109c692014e3484a74af248dd7a4746e8)

3 years agoe1000: Fix register name in reg_dump sysctl
Kevin Bowling [Mon, 26 Apr 2021 16:30:54 +0000 (09:30 -0700)]
e1000: Fix register name in reg_dump sysctl

The correct name of this register is CTRL_EXT.

Approved by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29967

(cherry picked from commit ba7b31b3e967a57c0269330d4e5aacf541d1b479)

3 years agoe1000: Add support for [Tiger, Alder, Meteor] Lake
Kevin Bowling [Mon, 19 Apr 2021 02:11:27 +0000 (19:11 -0700)]
e1000: Add support for [Tiger, Alder, Meteor] Lake

Add support for current and future client platform PCI IDs. These are
all I219 variants and have no known driver changes versus previous
generation client platform I219 variants.

Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29801

(cherry picked from commit 59690eab572dde1176886bff7ed0c506df974e5e)

3 years agoconnectat(2): clarify that the s argument is socket
Konstantin Belousov [Wed, 28 Apr 2021 15:47:31 +0000 (18:47 +0300)]
connectat(2): clarify that the s argument is socket

(cherry picked from commit 07f229d20c0cd6285c5ddf1df45eb69bbea4445b)

3 years agoFix mismerge in 00f85e3f264d665b30f0ce2a.
Konstantin Belousov [Sat, 1 May 2021 13:42:27 +0000 (16:42 +0300)]
Fix mismerge in 00f85e3f264d665b30f0ce2a.

nfslock is still needed on stable/12.
This is the direct commit to the stable/12 branch.

Noted by: rmacklem
Sponsored by: The FreeBSD Foundation

3 years agonfs client: depend on xdr
Konstantin Belousov [Tue, 13 Apr 2021 11:47:20 +0000 (14:47 +0300)]
nfs client: depend on xdr

(cherry picked from commit 8cca7b7f28feaf0c5e2dfedb985ae334a4013ef6)

3 years agoStyle.
Konstantin Belousov [Thu, 18 Mar 2021 10:40:20 +0000 (12:40 +0200)]
Style.

(cherry picked from commit 42be0a7b10b14113ba9c4e4a738e8f20e235b736)

3 years agovn_open_vnode(): handle error when fp == NULL
Konstantin Belousov [Mon, 19 Apr 2021 10:25:30 +0000 (13:25 +0300)]
vn_open_vnode(): handle error when fp == NULL

PR: 255119

(cherry picked from commit 54f98c4dbf9b1203a4e3e1b13fd0738441226991)

3 years agoAT_RESOLVE_BENEATH is bsd-specific
Konstantin Belousov [Thu, 11 Mar 2021 15:07:02 +0000 (17:07 +0200)]
AT_RESOLVE_BENEATH is bsd-specific

(cherry picked from commit d51b4b0aac43d9d25f7eb3f17b2d3034a5c851d8)

3 years agob_vflags update requries bufobj lock
Konstantin Belousov [Tue, 13 Apr 2021 10:22:56 +0000 (13:22 +0300)]
b_vflags update requries bufobj lock

(cherry picked from commit e3d675958539eee899d42438f5b46a26f3c64902)

3 years agopseudofs: limit writes to 1M
Konstantin Belousov [Tue, 13 Apr 2021 19:48:44 +0000 (22:48 +0300)]
pseudofs: limit writes to 1M

(cherry picked from commit 5edf7227ec339f651c7328e63df323f6ef10345f)

3 years agoBump pseudofs size limit from 128kB to 1MB.
Edward Tomasz Napierala [Fri, 16 Oct 2020 09:58:10 +0000 (09:58 +0000)]
Bump pseudofs size limit from 128kB to 1MB.

PR: 237883

(cherry picked from commit ce764cbd1c725c54966315949fe93eb3994c1b5e)

3 years agosbuf_uionew(): sbuf_new() takes int as length
Konstantin Belousov [Tue, 13 Apr 2021 19:12:19 +0000 (22:12 +0300)]
sbuf_uionew(): sbuf_new() takes int as length

(cherry picked from commit 116f26f947b8bbf868dcd85d79226406029a45ee)

3 years agox86: use x86_clear_dbregs() on fork
Konstantin Belousov [Fri, 9 Apr 2021 23:20:55 +0000 (02:20 +0300)]
x86: use x86_clear_dbregs() on fork

(cherry picked from commit 290b0d123ae2136ad84b268cd1884b1624d1d37f)

3 years agox86: clear %db registers in new process
Konstantin Belousov [Tue, 30 Mar 2021 15:40:02 +0000 (18:40 +0300)]
x86: clear %db registers in new process

(cherry picked from commit 8223717ce62c1ad0becc34ce69fe2d1771f3ba05)

3 years agoamd64 linux64: use x86_clear_dbregs()
Konstantin Belousov [Fri, 9 Apr 2021 23:22:48 +0000 (02:22 +0300)]
amd64 linux64: use x86_clear_dbregs()

(cherry picked from commit 2f1588474768f61f3a983af207e753bd0340a9e7)

3 years agoamd64: clear debug registers on execing 32bit native binary
Konstantin Belousov [Fri, 9 Apr 2021 23:23:54 +0000 (02:23 +0300)]
amd64: clear debug registers on execing 32bit native binary

(cherry picked from commit d50adfec9ee73e88e8d365525f1acef2c1db798a)

3 years agoamd64: clear debug registers on execing 32bit Linux binary
Konstantin Belousov [Fri, 9 Apr 2021 23:25:06 +0000 (02:25 +0300)]
amd64: clear debug registers on execing 32bit Linux binary

(cherry picked from commit 94172affa43af15fe3b50293a96c292eca30c386)

3 years agox86: add x86_clear_dbregs() helper
Konstantin Belousov [Fri, 9 Apr 2021 23:19:23 +0000 (02:19 +0300)]
x86: add x86_clear_dbregs() helper

(cherry picked from commit a8b75a57c9b2cb3388746f097a55086a0f8c5d38)

3 years agolink(2): correct descriptor name in AT_RESOLVE_BENEATH description
Konstantin Belousov [Tue, 30 Mar 2021 21:56:28 +0000 (00:56 +0300)]
link(2): correct descriptor name in AT_RESOLVE_BENEATH description

(cherry picked from commit c78e124535febc6c0bc7c0756b42d6b845428d2e)

3 years agoptrace: restructure comments around reparenting on PT_DETACH
Konstantin Belousov [Sun, 11 Apr 2021 09:06:21 +0000 (12:06 +0300)]
ptrace: restructure comments around reparenting on PT_DETACH

(cherry picked from commit a091c353235e0ee97d2531e80d9d64e1648350f4)

3 years agoptrace: remove dead call to FIX_SSTEP()
Konstantin Belousov [Sun, 11 Apr 2021 09:02:34 +0000 (12:02 +0300)]
ptrace: remove dead call to FIX_SSTEP()

(cherry picked from commit 9d7e450b64f1e605c718fba0f357d49541c8147b)

3 years agolinuxkpi: remove erronously committed diff save file
Konstantin Belousov [Tue, 6 Apr 2021 00:42:13 +0000 (03:42 +0300)]
linuxkpi: remove erronously committed diff save file

(cherry picked from commit 5b3b19db7305f8255f021d6f8d94d17ab778660f)

3 years agolinuxkpi: drop single-use variable
Konstantin Belousov [Tue, 30 Mar 2021 08:46:42 +0000 (11:46 +0300)]
linuxkpi: drop single-use variable

(cherry picked from commit 8011fb795baa59ba14371d6db5ab661a5db77615)

3 years agolinuxkpi: avoid counting per-thread use for the embedded linux cdevs
Konstantin Belousov [Tue, 30 Mar 2021 08:45:24 +0000 (11:45 +0300)]
linuxkpi: avoid counting per-thread use for the embedded linux cdevs

(cherry picked from commit f6b108837e7df7d7bfb35ec447f7cb62afa79441)

3 years agolinuxkpi: do not destroy/free embedded linux cdevs
Konstantin Belousov [Tue, 30 Mar 2021 08:44:19 +0000 (11:44 +0300)]
linuxkpi: do not destroy/free embedded linux cdevs

(cherry picked from commit 7f9867f8c65b1b3e590dba4dc432a4bc8cf01f68)

3 years agolinuxkpi: rename cdev to ldev
Konstantin Belousov [Tue, 30 Mar 2021 08:43:21 +0000 (11:43 +0300)]
linuxkpi: rename cdev to ldev

(cherry picked from commit 28b482e2baf43cdd30e8b9bd090e6d9f405cf4b3)

3 years agolinuxkpi: copy ldev into local to test and free the same pointer
Konstantin Belousov [Tue, 30 Mar 2021 08:41:00 +0000 (11:41 +0300)]
linuxkpi: copy ldev into local to test and free the same pointer

(cherry picked from commit 7b0125cbec1579a0a1bf38f7abe583b5f6fd79e7)

3 years agoUPDATING: add an entry for commit 0a1fdb867c72
Rick Macklem [Fri, 30 Apr 2021 23:35:39 +0000 (16:35 -0700)]
UPDATING: add an entry for commit 0a1fdb867c72

3 years agoparam.h: bump __FreeBSD_version to 1202506 for commit 0a1fdb867c72
Rick Macklem [Fri, 30 Apr 2021 23:28:46 +0000 (16:28 -0700)]
param.h: bump __FreeBSD_version to 1202506 for commit 0a1fdb867c72

Commit 0a1fdb867c72 changed the internal KAPI between the krpc
and NFS.  As such, the krpc, nfscommon and nfscl modules must
all be rebuilt from sources.

3 years agonfsv4 client: do the BindConnectionToSession as required
Rick Macklem [Sun, 11 Apr 2021 21:34:57 +0000 (14:34 -0700)]
nfsv4 client: do the BindConnectionToSession as required

During a recent testing event, it was reported that the NFSv4.1
server erroneously bound the back channel to a new TCP connection.
RFC5661 specifies that the fore channel is implicitly bound to a
new TCP connection when an RPC with Sequence (almost any of them)
is done on it.  For the back channel to be bound to the new TCP
connection, an explicit BindConnectionToSession must be done as
the first RPC on the new connection.

Since new TCP connections are created by the "reconnect" layer
(sys/rpc/clnt_rc.c) of the krpc, this patch adds an optional
upcall done by the krpc whenever a new connection is created.
The patch also adds the specific upcall function that does a
BindConnectionToSession and configures the krpc to call it
when required.

This is necessary for correct interoperability with NFSv4.1
servers when the nfscbd daemon is running.

If doing NFSv4.1 mounts without this patch, it is
recommended that the nfscbd daemon not be running and that
the "pnfs" mount option not be specified.

PR: 254840

(cherry picked from commit 7763814fc9c27a98fefcbf582d7a936ea43af23a)

3 years agoUPDATING: dereference portupgrade(8)
Glen Barber [Fri, 9 Apr 2021 00:26:41 +0000 (20:26 -0400)]
UPDATING: dereference portupgrade(8)

Make the UPDATING file less tool-specific regarding upgrading
third-party software.

Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 6dadf78f115cbdcb17dff8974a2044dd5129f7dc)

3 years agoMerge commit 'bd136720030ebb0b31e6d5a2236b9d0ddac71b94'
Stefan Eßer [Sun, 25 Apr 2021 06:42:31 +0000 (08:42 +0200)]
Merge commit 'bd136720030ebb0b31e6d5a2236b9d0ddac71b94'

usr.bin/bc: update to version 4.0.1

This update adds a flush() of the output buffer to the bc print command.

(cherry picked from commit 8ea9013512494c9f035afa1ffa1e199b44c7904f)

This commit included a change to .gitattributes for an already
checked-in file, which caused an inconsistency in the repository.

This was fixed by Michael Gmelin with a follow-up commit:

Synch index of contrib/bc with what is in workdir after cloning.

From a workdir perspective this should be a no-op.

See also:
https://lists.freebsd.org/pipermail/freebsd-current/2021-April/079569.html

(cherry picked from commit a0358e3d5184950b4316f105eb292cbafdea208b)

3 years agoe1000: Restore VF interface random MAC
Kevin Bowling [Thu, 15 Apr 2021 18:45:02 +0000 (11:45 -0700)]
e1000: Restore VF interface random MAC

Restore 525e07418c77 after the iflib conversion of igb(4). This
reenables random MAC address generation when attaching to a VF with a
zeroed MAC.

PR: 253535
Reported by: Balaev PA <mail@void.so>
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29785

(cherry picked from commit 68a46f11eadab48a1da9e3d3900569a6a1ce142e)

3 years agolibfetch: Retry with proxy auth when server returns 407
Renato Botelho [Thu, 1 Apr 2021 21:02:57 +0000 (18:02 -0300)]
libfetch: Retry with proxy auth when server returns 407

PR: 220468
Submitted by: Egil Hasting <egil.hasting@higen.org> (based on)
Reviewed by: kevans, kp
Approved by: kp
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29533

(cherry picked from commit 345c30a94f6425954163f1e0b075a75f603d27cd)

3 years agoA few more cases where strcasecmp() is no longer required.
Dag-Erling Smørgrav [Tue, 27 Nov 2018 11:22:19 +0000 (11:22 +0000)]
A few more cases where strcasecmp() is no longer required.

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

(cherry picked from commit ceedec4bce2161062ffcacf7f07e364c8cfe09bc)

3 years agoImprove URL parsing. In particular, convert scheme and host to lowercase.
Dag-Erling Smørgrav [Tue, 27 Nov 2018 10:45:14 +0000 (10:45 +0000)]
Improve URL parsing.  In particular, convert scheme and host to lowercase.

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

(cherry picked from commit 8d9de5b10a24bd2d79ed99f139c0ac28c09b15ca)

3 years agoSupport proxying FTP over HTTPS, not just HTTP.
Dag-Erling Smørgrav [Tue, 27 Nov 2018 10:06:41 +0000 (10:06 +0000)]
Support proxying FTP over HTTPS, not just HTTP.

There is probably a PR for this, but I can't find this, or remember who
submitted it.  The patch got lost in the noise of another that wasn't
ready to commit.

MFC after: 3 days
Approved by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit b68815f0886031fcccb426b85484b18a282d1b8c)

3 years agopf tests: Test cases for the 'kill state(s)' feature
Kristof Provost [Fri, 16 Apr 2021 15:33:17 +0000 (17:33 +0200)]
pf tests: Test cases for the 'kill state(s)' feature

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29796

(cherry picked from commit 065b5c7fb26eb4239e9bd513dde5a55ef78e45c4)

3 years agopf: Refactor state killing
Kristof Provost [Fri, 16 Apr 2021 14:34:21 +0000 (16:34 +0200)]
pf: Refactor state killing

Extract the state killing code from pfioctl() and rephrase the filtering
conditions for readability.

No functional change intended.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29795

(cherry picked from commit 586aab9e0aa6c811758c19fb03831fc1e7305252)

3 years agoipfw: do not use sleepable malloc in callout context.
Andrey V. Elsukov [Fri, 16 Apr 2021 07:22:44 +0000 (10:22 +0300)]
ipfw: do not use sleepable malloc in callout context.

Use M_NOWAIT flag when hash growing is called from callout.

PR:             255041
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D29772

(cherry picked from commit 9bacbf1ae243de43d642c3ac0b7318ae0e5c5235)

3 years agolibkiconv: address memory leak in not-found cases
Ed Maste [Wed, 21 Apr 2021 17:45:27 +0000 (13:45 -0400)]
libkiconv: address memory leak in not-found cases

Found in "Understanding and Detecting Disordered Error Handling with
Precise Function Pairing" by Qiushi Wu et al.

Reviewed by: imp, jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29896

(cherry picked from commit 3cfd08c1c74058451a02bac35307bf7fa509c617)

3 years agoaesni: Avoid modifying session keys in hmac_update()
Mark Johnston [Tue, 27 Apr 2021 00:04:25 +0000 (20:04 -0400)]
aesni: Avoid modifying session keys in hmac_update()

Otherwise aesni_process() is not thread-safe for AES+SHA-HMAC
transforms, since hmac_update() updates the caller-supplied key directly
to create the derived key.  Use a buffer on the stack to store a copy of
the key used for computing inner and outer digests.

This is a direct commit to stable/12 as the bug is not present in later
branches.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D30001

3 years agowlanstats: fix build
Sofian Brabez [Tue, 20 Apr 2021 18:31:48 +0000 (18:31 +0000)]
wlanstats: fix build

Add -Wno-cast-align to the CFLAGS to fix the build of wlanstats

Approved by: adrian
MFC after: 1 week

(cherry picked from commit b8be8094958a01255f5430bd6a36ff936bdd53c3)

3 years agoiwnstats: fix build with clang and allow install under /usr/local/sbin
Sofian Brabez [Tue, 20 Apr 2021 17:58:46 +0000 (17:58 +0000)]
iwnstats: fix build with clang and allow install under /usr/local/sbin

iwnstats was not compiling because of some issues raised by the clang
compiler due to -Werror. As a tool it is not connected to world build.

Add missing field "barker_mrc" initialization in struct
iwn_sensitivity_limits for -Wmissing-field-initializers, remove unused
pointer *is on iwn_stats_*_print functions and unused variables for
-Wunused-parameter and -Wunused-variable.

The value for field "barker_mrc" of struct iwn2030_sensitivity_limits
was obtained from linux 3.2 wireless/iwlwifi driver code (iwl-2000.c:115
.barker_corr_th_min_mrc = 390).

Also set BINDIR in Makefile to make it possible to install under
/usr/local/sbin/iwnstats as it require super user.

Reviewed by: adrian
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29800

(cherry picked from commit 561d34d70596b455c6a513431f8ad007076f90c5)

3 years agoFix race in case of device destruction.
Alexander Motin [Tue, 13 Apr 2021 15:19:10 +0000 (11:19 -0400)]
Fix race in case of device destruction.

During device destruction it is possible that open() succeed, but
fdevname() return NULL, that can't be assigned to string variable.
Fix that by adding explicit NULL check.

Also while there switch from fdevname() to fdevname_r().

Sponsored by: iXsystems, Inc.
MFC after: 2 weeks

(cherry picked from commit e49d3eb40324eaffaa13b93f2c4173dfa04dfa34)

3 years agoFix zgrep --version
Mateusz Piotrowski [Tue, 13 Apr 2021 10:12:53 +0000 (12:12 +0200)]
Fix zgrep --version

"zgrep --version" is expected to print the version information in the
same way as "zgrep -V". However, the case handling the --version flag
is never reached, so "zgrep --version" prints:
    zgrep: missing pattern
instead of:
    grep (BSD grep, GNU compatible) 2.6.0-FreeBSD

Reviewed by: yuripv
Approved by: yuripv (src)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29813

(cherry picked from commit 16e0391f8e2124eb85af984204548cf841648db5)

3 years agoixgbe: Clarify index name in ixgbe_mc_filter_apply
Kevin Bowling [Sat, 17 Apr 2021 01:17:43 +0000 (18:17 -0700)]
ixgbe: Clarify index name in ixgbe_mc_filter_apply

"It looks like it would be less confusing to rename 'count' to
something like 'idx', since that's what it's used for in this
function."

Reviewed by: erj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29798

(cherry picked from commit 21afed4b1d18578aa8c9fa31e9e677971f8b4300)

3 years agonfsd: fix replies from session cache for multiple retries
Rick Macklem [Sat, 10 Apr 2021 22:50:25 +0000 (15:50 -0700)]
nfsd: fix replies from session cache for multiple retries

Recent testing of network partitioning a FreeBSD NFSv4.1
server from a Linux NFSv4.1 client identified problems
with both the FreeBSD server and Linux client.

Commit 05a39c2c1c18 fixed replying with the cached reply in
in the session slot if same session slot sequence#.
However, the code uses the reply and, as such,
will fail for a subsequent retry of the RPC.
A subsequent retry would be an extremely rare event,
but this patch fixes this, so long as m_copym(..M_NOWAIT)
does not fail, which should also be a rare event.

This fix affects the exceedingly rare case where a NFSv4
client retries a non-idempotent RPC, such as a lock
operation, multiple times.  Note that retries only occur
after the client has needed to create a new TCP connection,
with a new TCP connection for each retry.

PR: 254816

(cherry picked from commit 22cefe3d8378f58adcdbb2c7589b9f30c2a38315)

3 years agompt(4): Remove incorrect S/G segments limits.
Alexander Motin [Sat, 17 Apr 2021 14:41:35 +0000 (10:41 -0400)]
mpt(4): Remove incorrect S/G segments limits.

First, two of those four checks are unreachable.
Second, I don't believe there should be ">=" instead of ">".
Third, bus_dma(9) already returns the same EFBIG if ">".

This fixes false I/O errors in worst S/G cases with maxphys >= 2MB.

MFC after: 1 week

(cherry picked from commit 0f29396e493bd87ffa6a63fcb602b12e79d21a1e)

3 years agoFix leak in libc NFSv4 ACL flags parsing
Andrew Walker [Tue, 20 Apr 2021 19:34:44 +0000 (15:34 -0400)]
Fix leak in libc NFSv4 ACL flags parsing

Free memory allocated by strdup() in parse_flags_verbose().

Submitted by: Andrew Walker <walker.aj325_gmail.com>
Reported by: valgrind
Reviewed by: allanjude, freqlabs, rpokala
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D29871

(cherry picked from commit dd559118ab3f065ae230b324c3fe4bb1c9b7ca56)

3 years agopms(4): Limit maximum I/O size to 256KB instead of 1MB.
Alexander Motin [Fri, 16 Apr 2021 19:39:01 +0000 (15:39 -0400)]
pms(4): Limit maximum I/O size to 256KB instead of 1MB.

There is a weird limit of AGTIAPI_MAX_DMA_SEGS (128) S/G segments per
I/O since the initial driver import.  I don't know why it was added,
can only guess some hardware limitation, but in worst case it means
maximum I/O size of 508KB.  Respect it to be safe, rounding to 256KB.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

(cherry picked from commit 3e347834200b5d91a33384e696793e4ac20a44d4)

3 years agopms(4): Do not return CAM_REQ_CMP on errors.
Alexander Motin [Fri, 16 Apr 2021 19:16:09 +0000 (15:16 -0400)]
pms(4): Do not return CAM_REQ_CMP on errors.

It is a direct request for data corruptions, one report of which we
have received.  I am very surprised that only one.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

(cherry picked from commit 8434a65ce49bd6bc6779f0e57b0ce0f4bc46f48e)

3 years agoRevert "stats.7: Add dwatch(1) to the list"
Fernando Apesteguía [Thu, 22 Apr 2021 17:55:01 +0000 (19:55 +0200)]
Revert "stats.7: Add dwatch(1) to the list"

As gbe@ notes, the stats(7) framework is not present in stable/12

This reverts commit 76b02b5cea1dc548d30b2ec5e95ce5a27deb16e3.

3 years agostats.7: Add dwatch(1) to the list
Fernando Apesteguía [Thu, 22 Apr 2021 13:54:45 +0000 (15:54 +0200)]
stats.7: Add dwatch(1) to the list

PR: 255303
Approved by: 0mp (mentor)
Differential Revision: https://reviews.freebsd.org/D29924

(cherry picked from commit 2e5929a75634504d388cc04d24e6a558840e18cb)

3 years agonfsd: fix replies from session cache for retried RPCs
Rick Macklem [Thu, 8 Apr 2021 21:04:22 +0000 (14:04 -0700)]
nfsd: fix replies from session cache for retried RPCs

Recent testing of network partitioning a FreeBSD NFSv4.1
server from a Linux NFSv4.1 client identified problems
with both the FreeBSD server and Linux client.

The FreeBSD server failec to reply using the cached
reply in the session slot when an RPC was retried on
the session slot, as indicated by same slot sequence#.

This patch fixes this.  It should also fix a similar
failure for NFSv4.0 mounts, when the sequence# in
the open/lock_owner requires a reply be done from
an entry locked into the DRC.

This fix affects the fairly rare case where a NFSv4
client retries a non-idempotent RPC, such as a lock
operation.  Note that retries only occur after the
client has needed to create a new TCP connection.

(cherry picked from commit 05a39c2c1c18cd0c4382a4f58e0952d3f77e7dfa)

3 years agoImprove size readability.
Michael Reifenberger [Mon, 15 Feb 2021 19:23:32 +0000 (20:23 +0100)]
Improve size readability.
Preserve more space for swap devise names.
Prevent line overflow with long devise name.
Don't draw a bar when swap is not used at all.
Simplify and optimize code.
Change the label to end at end of 100%.
PR: 251655
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27496

(cherry picked from commit 8d06c3e7a40831ac139d83b85b282206229b426f)

3 years agosafexcel: Fix the SHA-HMAC digest computation when AAD is present
Mark Johnston [Wed, 21 Apr 2021 18:50:48 +0000 (14:50 -0400)]
safexcel: Fix the SHA-HMAC digest computation when AAD is present

The driver would fail to include the AAD in the input stream, resulting
in incorrect digests for requests combining SHA-HMAC with AES-CBC or
-CTR.  Ensure that the AAD is included in the processor's input stream,
and fix the corresponding instruction sequence to include the AAD as
input to the digest computation.

This is a direct commit to stable/12 since the bug was introduced while
merging there and is not present in later branches.

3 years agospigen.4: Fix typos
Mateusz Piotrowski [Sun, 18 Apr 2021 07:45:18 +0000 (09:45 +0200)]
spigen.4: Fix typos

MFC after: 3 days

(cherry picked from commit 40277af7f23405c276edf02c3ddc8e770a06e3f6)

3 years agoExplain the newfs naming convention
Mateusz Piotrowski [Wed, 20 Jan 2021 10:40:20 +0000 (11:40 +0100)]
Explain the newfs naming convention

It might be unclear why newfs and newfs_msdos should cross-reference
each other. Add a note explaining it.

This is a follow-up to 74bd20769706041108a573601cf0b61c755bdc56.

Reported by: kib
Reviewed by:    imp, kib, rpokala
MFC after: 3 days

(cherry picked from commit 5b9b65e92fb40703038cbcf61feb4616c42e0b6e)

3 years agopf tests: Test multi-wan rdr
Kristof Provost [Tue, 6 Apr 2021 11:25:49 +0000 (13:25 +0200)]
pf tests: Test multi-wan rdr

This replicates an issue observed on pfSense: https://redmine.pfsense.org/issues/11436

In essence, reply-to is needed to ensure that connections always leave
the WAN interface they came in on, but this confused the state tracking.

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

(cherry picked from commit f37667e2359245ad123fd775c072fd82c81bc476)

3 years agopf: Do not short-circuit processing for REPLY_TO
Kristof Provost [Wed, 7 Apr 2021 13:46:44 +0000 (15:46 +0200)]
pf: Do not short-circuit processing for REPLY_TO

When we find a state for packets that was created by a reply-to rule we
still need to process the packet. The state may require us to modify the
packet (e.g. in rdr or nat cases), which we won't do with the shortcut.

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

(cherry picked from commit 6d786845cf63c8bf57174e3e43b0b5c5eca75be3)

3 years agopf: Add static DTrace probe points
Kristof Provost [Fri, 2 Apr 2021 13:53:34 +0000 (15:53 +0200)]
pf: Add static DTrace probe points

These two have proven to be useful during debugging. We may as well keep
them permanently.
Others will be added as their utility becomes clear.

Reviewed by: gnn
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29555

(cherry picked from commit f4c02909167b6f791df470afddfe31cabf009c4d)

3 years agopf: change pf_route so pf only runs when packets enter and leave the stack.
Kristof Provost [Fri, 2 Apr 2021 10:23:42 +0000 (12:23 +0200)]
pf: change pf_route so pf only runs when packets enter and leave the stack.

before this change pf_route operated on the semantic that pf runs
when packets go over an interface, so when pf_route changed which
interface the packet was on it would run pf_test again. this change
changes (restores) the semantic that pf is only supposed to run
when packets go in or out of the network stack, even if route-to
is responsibly for short circuiting past the network stack.

just to be clear, for normal packets (ie, those not touched by
route-to/reply-to/dup-to), there isn't a difference between running
pf when packets enter or leave the stack, or having pf run when a
packet goes over an interface.

the main reason for this change is that running the same packet
through pf multiple times creates confusion for the state table.
by default, pf states are floating, meaning that packets are matched
to states regardless of which interface they're going over. if a
packet leaving on em0 is rerouted out em1, both traversals will end
up using the same state, which at best will make the accounting
look weird, or at worst fail some checks in the state and get
dropped.

another reason for this commit is is to make handling of the changes
that route-to makes consistent with other changes that are made to
packet. eg, when nat is applied to a packet, we don't run pf_test
again with the new addresses.

the main caveat with this diff is you can't have one rule that
pushes a packet out a different interface, and then have a rule on
that second interface that NATs the packet. i'm not convinced this
ever worked reliably or was used much anyway, so we don't think
it's a big concern.

discussed with many, with special thanks to bluhm@, sashan@ and
sthen@ for weathering most of that pain.
ok claudio@ sashan@ jmatthew@

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

(cherry picked from commit 829a69db855b48ff7e8242b95e193a0783c489d9)

3 years agonfsd: make the server repeat CB_RECALL every couple of seconds
Rick Macklem [Mon, 5 Apr 2021 01:15:54 +0000 (18:15 -0700)]
nfsd: make the server repeat CB_RECALL every couple of seconds

Commit 01ae8969a9ee stopped the NFSv4.1/4.2 server from implicitly
binding the back channel to a new TCP connection so that it
conforms to RFC5661, for NFSv4.1/4.2. An effect of this
for the Linux NFS client is that it will do a
BindConnectionToSession when it sees NFSV4SEQ_CBPATHDOWN
set in a sequence reply. This will fix the back channel, but the
first attempt at a callback like CB_RECALL will already have
failed. Without this patch, a CB_RECALL will not be retried
and that can result in a 5 minute delay until the delegation
times out.

This patch modifies the code so that it will retry the
CB_RECALL every couple of seconds, often avoiding the
5 minute delay.

This is not critical for correct behaviour, but avoids
the 5 minute delay for the case where the Linux client
re-binds the back channel via BindConnectionToSession.

(cherry picked from commit 7a606f280a3e174dcdd12736b7b976903809eb9c)

3 years agoEnsure that the mount command shows "with quotas" when quotas are enabled.
Kirk McKusick [Wed, 14 Apr 2021 22:22:12 +0000 (15:22 -0700)]
Ensure that the mount command shows "with quotas" when quotas are enabled.

(cherry picked from commit 14d0cd7225e250015eb6d9c79a7eb4e944211b23)

3 years agoWhen we are about to send down to the driver layer
Randall Stewart [Wed, 27 Jan 2021 18:32:52 +0000 (13:32 -0500)]
When we are about to send down to the driver layer
we need to make sure that the m_nextpkt field is NULL
else the lower layers may do unwanted things.

Reviewed By:  gallatin, melifaro
Differential Revision: https://reviews.freebsd.org/D28377
PR: 253587

(cherry picked from commit 24a8f6d369962f189ad808f538029179b1e7dc2f)

3 years agonfsd: fix BindConnectionToSession so that it clears "cb path down"
Rick Macklem [Sun, 4 Apr 2021 22:05:39 +0000 (15:05 -0700)]
nfsd: fix BindConnectionToSession so that it clears "cb path down"

Commit 01ae8969a9ee stopped the NFSv4.1/4.2 server from implicitly
binding the back channel to a new TCP connection so that it
conforms to RFC5661, for NFSv4.1/4.2. An effect of this
for the Linux NFS client is that it will do a
BindConnectionToSession when it sees NFSV4SEQ_CBPATHDOWN
set in a sequence reply. It will do this for every RPC
reply until it no longer sees the flag.
Without that patch, this will happen until the client does
an Open, which will clear LCL_CBDOWN.

This patch clears LCL_CBDOWN right away, so that
NFSV4SEQ_CBPATHDOWN will no longer be sent to the client
in Sequence replies and the Linux client will not repeat
the BindConnectionToSession RPCs.

This is not critical for correct behaviour, but reduces
RPC overheads for cases where the Open will not be done
for a while.

(cherry picked from commit 6f2addd838810ce33c7e9ad9543827d45e0b491c)

3 years agosystat.1: Remove Tn macros
Mateusz Piotrowski [Sat, 6 Feb 2021 13:14:20 +0000 (14:14 +0100)]
systat.1: Remove Tn macros

They are no longer supported by mdoc(7).

MFC after: 1 week

(cherry picked from commit fcbaf46b763a91bb41fe68afdcf59a7d210bc2f7)

3 years agosystat.1: Fix synopsis
Mateusz Piotrowski [Wed, 10 Feb 2021 17:02:14 +0000 (18:02 +0100)]
systat.1: Fix synopsis

systat does not have a "-display" flag. Use Ar to indicate that
"display" is meant to be substituted with an actual display command.

(cherry picked from commit e6f59be239aa17f80b44ded4779e29f5d5352b28)

3 years agotcp: Use sbuf_drain unconditionally
Richard Scheffenegger [Fri, 2 Apr 2021 18:26:48 +0000 (20:26 +0200)]
tcp: Use sbuf_drain unconditionally

After making sbuf_drain safe for external use,
there is no need to protect the call.

MFC after: 2 weeks
Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29545

(cherry picked from commit 38ea2bd0698e434ec531b97fa94b24db24e16629)
(cherry picked from commit a04906f0273fa6d80eb3ebf22b9b84e53e6b21e0)

3 years agotcp: Shouldn't drain empty sbuf
Richard Scheffenegger [Thu, 1 Apr 2021 15:18:04 +0000 (17:18 +0200)]
tcp: Shouldn't drain empty sbuf

MFC after: 2 weeks
Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29524

(cherry picked from commit 9aef4e7c2bd4371e526e4e3feb26064d361ad8ce)

3 years agotcp: For hostcache performance, use atomics instead of counters
Richard Scheffenegger [Thu, 1 Apr 2021 08:00:32 +0000 (10:00 +0200)]
tcp: For hostcache performance, use atomics instead of counters

As accessing the tcp hostcache happens frequently on some
classes of servers, it was recommended to use atomic_add/subtract
rather than (per-CPU distributed) counters, which have to be
summed up at high cost to cache efficiency.

PR: 254333
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Reviewed By: #transport, tuexen, jtl
Differential Revision: https://reviews.freebsd.org/D29522

(cherry picked from commit 529a2a0f2765f6c57c50a5af6be242c03bf714e3)

3 years agotcp: Make hostcache.cache_count MPSAFE by using a counter_u64_t
Richard Scheffenegger [Wed, 31 Mar 2021 17:30:20 +0000 (19:30 +0200)]
tcp: Make hostcache.cache_count MPSAFE  by using a counter_u64_t

Addressing the underlying root cause for cache_count to
show unexpectedly high  values, by protecting all arithmetic on
that global variable by using counter(9).

PR: 254333
Reviewed By: tuexen, #transport
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29510

(cherry picked from commit 95e56d31e348594973affd0ea81d8f8383bc3031)

3 years agotcp: drain tcp_hostcache_list in between per-bucket locks
Richard Scheffenegger [Wed, 31 Mar 2021 17:24:01 +0000 (19:24 +0200)]
tcp: drain tcp_hostcache_list in between per-bucket locks

Explicitly drain the sbuf after completing each hash bucket
to minimize the work performed while holding the hash
bucket lock.

PR: 254333
MFC after: 2 weeks
Reviewed By: tuexen, jhb, #transport
Sponsored by:  NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29483

(cherry picked from commit 869880463cc2ce64e2e6599eaec880a981f3ced6)

3 years agotcp: reduce memory footprint when listing tcp hostcache
Richard Scheffenegger [Sun, 28 Mar 2021 21:12:03 +0000 (23:12 +0200)]
tcp: reduce memory footprint when listing tcp hostcache

In tcp_hostcache_list, the sbuf used would need a large (~2MB)
blocking allocation of memory (M_WAITOK), when listing a
full hostcache. This may stall the requestor for an indeterminate
time.

A further optimization is to return the expected userspace
buffersize right away, rather than preparing the output of
each current entry of the hostcase, provided by: @tuexen.

This makes use of the ready-made functions of sbuf to work
with sysctl, and repeatedly drain the much smaller buffer.

PR: 254333
MFC after: 2 weeks
Reviewed By: #transport, tuexen
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29471

(cherry picked from commit cb0dd7e122b8936ad61a141e65ef8ef874bfebe5)

3 years agoMake sbuf_drain safe for external use
Richard Scheffenegger [Fri, 2 Apr 2021 18:11:45 +0000 (20:11 +0200)]
Make sbuf_drain safe for external use

While sbuf_drain was an internal function, two
KASSERTS checked the sanity of it being called.
However, an external caller may be ignorant if
there is any data to drain, or if an error has
already accumulated. Be nice and return immediately
with the accumulated error.

MFC after: 2 weeks
Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29544

(cherry picked from commit cad4fd0365a5e3235e715e072e6ee9dffaa7a3ab)

3 years agoExport sbuf_drain to orchestrate lock and drain action
Richard Scheffenegger [Wed, 31 Mar 2021 16:25:53 +0000 (18:25 +0200)]
Export sbuf_drain to orchestrate lock and drain action

While exporting large amounts of data to a sysctl
request, datastructures may need to be locked.

Exporting the sbuf_drain function allows the
coordination between drain events and held
locks, to avoid stalls.

PR: 254333
Reviewed By: jhb
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29481

(cherry picked from commit c804c8f2c58ba42d476de07fbceff9ac4dd95f0e)

3 years agoconfig(8): Mention the authors of a paper in the SEE ALSO section
Gordon Bergling [Fri, 9 Apr 2021 09:20:49 +0000 (11:20 +0200)]
config(8): Mention the authors of a paper in the SEE ALSO section

Obtained from: OpenBSD

(cherry picked from commit 2b59392cb0da804e825c63469beb1934ec4267db)

3 years agolpd(8): Mention the author of a paper in the SEE ALSO section
Gordon Bergling [Fri, 9 Apr 2021 09:29:18 +0000 (11:29 +0200)]
lpd(8): Mention the author of a paper in the SEE ALSO section

Obtained from: OpenBSD

(cherry picked from commit c07aa0a5878f55ef22b8d0ba5f66a728b1407427)

3 years agormlock(9): add an RM_DUPOK flag
Mitchell Horne [Thu, 8 Apr 2021 17:41:19 +0000 (14:41 -0300)]
rmlock(9): add an RM_DUPOK flag

Allows for duplicate locks to be acquired without witness complaining.
Similar flags exists already for rwlock(9) and sx(9).

Reviewed by: markj
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

(cherry picked from commit 2816bd8442bc323d50434d0e64cb4b7c10a195e8)