]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agozfs: merge openzfs/zfs@bc3f12bfa (master) into main
Martin Matuska [Tue, 29 Mar 2022 10:07:34 +0000 (12:07 +0200)]
zfs: merge openzfs/zfs@bc3f12bfa (master) into main

Notable upstream pull request merges:
  #12083 libzfs: FreeBSD doesn't resize partitions for you
  #13106 add physical device size to SIZE column in 'zpool list -v'
  #13158 Allow zfs send to exclude datasets
  #13190 module: zfs: zio_inject: zio_match_handler: don't << -1
  #13219 FreeBSD: add missing replay check to an assert in zfs_xvattr_set
  #13220 module: freebsd: avoid a taking a destroyed lock in zfs_zevent bits
  #13221 Fix ACL checks for NFS kernel server

Obtained from: OpenZFS
OpenZFS commit: bc3f12bfac152a0c28951cec92340ba14f9ccee9

2 years agouudecode: move the new uudecode test from uuencode/ to uudecode/
Piotr Pawel Stefaniak [Mon, 28 Mar 2022 21:18:24 +0000 (23:18 +0200)]
uudecode: move the new uudecode test from uuencode/ to uudecode/

I don't know how that happened.

Fixes: 9f3203c00314 "uudecode: correct error message"

2 years agompr/mps/mpt: verify cfg page ioctl lengths
Ed Maste [Mon, 28 Mar 2022 13:33:54 +0000 (09:33 -0400)]
mpr/mps/mpt: verify cfg page ioctl lengths

*_CFG_PAGE ioctl handlers in the mpr, mps, and mpt drivers allocated a
buffer of a caller-specified size, but copied to it a fixed size header.
Add checks that the size is at least the required minimum.

Note that the device nodes are owned by root:operator with 0640
permissions so the ioctls are not available to unprivileged users.

This change includes suggestions from scottl, markj and mav.

Two of the mpt cases were reported by Lucas Leong (@_wmliang_) of
Trend Micro Zero Day Initiative; scottl reported the third case in mpt.
Same issue found in mpr and mps after discussion with imp.

Reported by: Lucas Leong (@_wmliang_), Trend Micro Zero Day Initiative
Reviewed by: imp, mav
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34692

2 years agosctp: get rid of stcb send lock
Michael Tuexen [Mon, 28 Mar 2022 23:50:17 +0000 (01:50 +0200)]
sctp: get rid of stcb send lock

Just use the stcb lock instead to simplify locking.

Reported by: syzbot+d00b202063150f85b110@syzkaller.appspotmail.com
Reported by: syzbot+87f268a0a6d2d6383306@syzkaller.appspotmail.com
MFC after: 3 days

2 years agonfscl: Fix IO_APPEND writes from kernel space
Rick Macklem [Mon, 28 Mar 2022 22:11:52 +0000 (15:11 -0700)]
nfscl: Fix IO_APPEND writes from kernel space

Commit 867c27c23a5c modified the NFS client so that
it did IO_APPEND writes directly to the NFS server
bypassing the buffer cache, via a call to
nfs_directio_write().  Unfortunately, this (very old)
function assumed that the uio iov was for user space
addresses.  As such, a IO_APPEND VOP_WRITE() that
was for system space, such as ktrace(1) does, would
write bogus data.

This patch fixes nfs_directio_write() so that it
handles kernel space uio iovs.

Reported by: bz
Tested by: bz
MFC after: 2 weeks

2 years agouudecode: use SRCDIR in the regression test
Piotr Pawel Stefaniak [Mon, 28 Mar 2022 18:50:40 +0000 (20:50 +0200)]
uudecode: use SRCDIR in the regression test

Fixes: 9f3203c00314 "uudecode: correct error message"

2 years agosysent: regen for syscallarg_t
Brooks Davis [Mon, 28 Mar 2022 18:43:03 +0000 (19:43 +0100)]
sysent: regen for syscallarg_t

2 years agosyscallarg_t: Add a type for system call arguments
Brooks Davis [Mon, 28 Mar 2022 18:43:03 +0000 (19:43 +0100)]
syscallarg_t: Add a type for system call arguments

This more clearly differentiates system call arguments from integer
registers and return values. On current architectures it has no effect,
but on architectures where pointers are not integers (CHERI) and may
not even share registers (CHERI-MIPS) it is necessiary to differentiate
between system call arguments (syscallarg_t) and integer register values
(register_t).

Obtained from: CheriBSD

Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D33780

2 years agoshare/mk: Remove obsolete reference to LINTLIBDIR
Brooks Davis [Mon, 28 Mar 2022 18:43:03 +0000 (19:43 +0100)]
share/mk: Remove obsolete reference to LINTLIBDIR

Lint support was removed in 1cbb58886a477cf282072eaa331d8122e36e9952,
but this entry (accidently added in an unrelated commit) wasn't
removed.

2 years agoxen(4): Fix a few typos in source code comments
Gordon Bergling [Sun, 27 Mar 2022 16:05:58 +0000 (18:05 +0200)]
xen(4): Fix a few typos in source code comments

- s/querried/queried/

MFC after: 3 days

2 years agoffs(3): Fix a common typo in source code comments
Gordon Bergling [Sun, 27 Mar 2022 16:03:16 +0000 (18:03 +0200)]
ffs(3): Fix a common typo in source code comments

- s/quadradically/quadratically/

Obtained from: NetBSD
MFC after: 3 days

2 years agogpart(8): Fix two typos in source code comments
Gordon Bergling [Sun, 27 Mar 2022 16:01:55 +0000 (18:01 +0200)]
gpart(8): Fix two typos in source code comments

- s/partiton/partition/

MFC after: 3 days

2 years agomlx5en(4): Fix a few typos in source code comments
Gordon Bergling [Sun, 27 Mar 2022 15:59:43 +0000 (17:59 +0200)]
mlx5en(4): Fix a few typos in source code comments

- s/persistant/persistent/

MFC after: 3 days

2 years agobfe(4): Fix a typo in a comment
Gordon Bergling [Sun, 27 Mar 2022 15:57:04 +0000 (17:57 +0200)]
bfe(4): Fix a typo in a comment

2 years agocamcontrol(8): Fix typo in a source code comment
Gordon Bergling [Mon, 7 Feb 2022 17:25:51 +0000 (18:25 +0100)]
camcontrol(8): Fix typo in a source code comment

- s/querried/queried/

MFC after: 3 days

2 years agopfctl(8): Fix a typo in a comment
Gordon Bergling [Sun, 27 Mar 2022 15:55:55 +0000 (17:55 +0200)]
pfctl(8): Fix a typo in a comment

- s/steping/stepping/

MFC after: 3 days

2 years agovxlan(4): Fix two typos in sysctl descriptions
Gordon Bergling [Mon, 7 Feb 2022 17:23:35 +0000 (18:23 +0100)]
vxlan(4): Fix two typos in sysctl descriptions

- s/fowarding/forwarding/

MFC after: 3 days

2 years agofstyp(8): Fix a few typos in source code comments
Gordon Bergling [Mon, 7 Feb 2022 17:20:48 +0000 (18:20 +0100)]
fstyp(8): Fix a few typos in source code comments

- s/mmaping/mapping/
- s/filesytem/filesystem/

MFC after: 3 days

2 years agomount(8): Fix a typo in source code comments
Gordon Bergling [Mon, 7 Feb 2022 17:15:34 +0000 (18:15 +0100)]
mount(8): Fix a typo in source code comments

- s/filesytem/filesystem/

MFC after: 3 days

2 years agoextra_tcp_stacks: Fix two typos in source code comments
Gordon Bergling [Mon, 7 Feb 2022 17:14:22 +0000 (18:14 +0100)]
extra_tcp_stacks: Fix two typos in source code comments

- s/recusive/recursive/

MFC after: 3 days

2 years agostand: Fix a common typo in source code comments
Gordon Bergling [Mon, 7 Feb 2022 17:12:58 +0000 (18:12 +0100)]
stand: Fix a common typo in source code comments

- s/existance/existence/

MFC after: 3 days

2 years agolibc: Fix a typo in a source code comment
Gordon Bergling [Sun, 6 Feb 2022 16:25:59 +0000 (17:25 +0100)]
libc: Fix a typo in a source code comment

- s/compnent/component/

MFC after: 3 days

2 years agocxgbetool(8): Fix a typo in the man page
Gordon Bergling [Sun, 27 Mar 2022 16:58:52 +0000 (18:58 +0200)]
cxgbetool(8): Fix a typo in the man page

- s/begining/beginning/

MFC after: 3 days

2 years agopkgbase: Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 16:56:58 +0000 (18:56 +0200)]
pkgbase: Fix a typo in a source code comment

- s/begining/beginning/

MFC after: 3 days

2 years agoxen(3): Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 16:54:13 +0000 (18:54 +0200)]
xen(3): Fix a typo in a source code comment

- s/mmaping/mapping/

MFC after: 3 days

2 years agopmc(3): Fix a common typo in json descriptions
Gordon Bergling [Sun, 6 Feb 2022 16:17:57 +0000 (17:17 +0100)]
pmc(3): Fix a common typo in json descriptions

- s/from from/from/

MFC after: 3 days

2 years agonetinet6: Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 16:52:38 +0000 (18:52 +0200)]
netinet6: Fix a typo in a source code comment

- s/maping/mapping/

MFC after: 3 days

2 years agonetgraph(3): Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 16:50:45 +0000 (18:50 +0200)]
netgraph(3): Fix a typo in a source code comment

- s/failes/fails/

MFC after: 3 days

2 years agoqlnxe(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 16:45:13 +0000 (18:45 +0200)]
qlnxe(4): Fix a typo in a source code comment

- s/existance/existence/

MFC after: 3 days

2 years agoisci(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 16:42:11 +0000 (18:42 +0200)]
isci(4): Fix a typo in a source code comment

- s/recored/recorded/

MFC after: 3 days

2 years agoexca(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 16:39:36 +0000 (18:39 +0200)]
exca(4): Fix a typo in a source code comment

- s/maping/mapping/

MFC after: 3 days

2 years agodrm2: Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 16:36:32 +0000 (18:36 +0200)]
drm2: Fix a typo in a source code comment

- s/mmaping/mapping/

MFC after: 3 days

2 years agoipfilter(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 16:33:25 +0000 (18:33 +0200)]
ipfilter(4): Fix a typo in a source code comment

- s/existance/existence/

MFC after: 3 days

2 years agocxgbe(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 16:32:19 +0000 (18:32 +0200)]
cxgbe(4): Fix a typo in a source code comment

- s/begining/beginning/

MFC after: 3 days

2 years agogeom(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 16:31:00 +0000 (18:31 +0200)]
geom(4): Fix a typo in a source code comment

- s/comand/command/

MFC after: 3 days

2 years agolibefivar(3): Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 16:29:32 +0000 (18:29 +0200)]
libefivar(3): Fix a typo in a source code comment

- s/partiton/partition/

MFC after: 3 days

2 years agoconfig: user: check for <aio.h>
наб [Mon, 28 Mar 2022 17:24:22 +0000 (19:24 +0200)]
config: user: check for <aio.h>

And always zpool_read_label_slow() on non-conformant libcs

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: José Luis Salvador Rufo <salvador.joseluis@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13207
Closes #13254

2 years agoman: zfs-rename.8: import examples from zfs.8
наб [Wed, 16 Mar 2022 18:01:08 +0000 (19:01 +0100)]
man: zfs-rename.8: import examples from zfs.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zfs-snapshot.8: import examples from zfs.8
наб [Wed, 16 Mar 2022 17:53:59 +0000 (18:53 +0100)]
man: zfs-snapshot.8: import examples from zfs.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zfs-promote.8: import examples from zfs.8
наб [Wed, 16 Mar 2022 17:50:53 +0000 (18:50 +0100)]
man: zfs-promote.8: import examples from zfs.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zfs-create.8: import examples from zfs.8
наб [Wed, 16 Mar 2022 17:49:31 +0000 (18:49 +0100)]
man: zfs-create.8: import examples from zfs.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zfs-destroy.8: import examples from zfs.8
наб [Wed, 16 Mar 2022 17:48:01 +0000 (18:48 +0100)]
man: zfs-destroy.8: import examples from zfs.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zfs-rollback.8: import examples from zfs.8
наб [Wed, 16 Mar 2022 17:44:25 +0000 (18:44 +0100)]
man: zfs-rollback.8: import examples from zfs.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zfs-clone.8: import examples from zfs.8
наб [Wed, 16 Mar 2022 17:43:33 +0000 (18:43 +0100)]
man: zfs-clone.8: import examples from zfs.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zfs-list.8: import examples from zfs.8
наб [Wed, 16 Mar 2022 17:33:41 +0000 (18:33 +0100)]
man: zfs-list.8: import examples from zfs.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zfs-send.8, zfs-receive.8: import examples from zfs.8
наб [Wed, 16 Mar 2022 17:31:42 +0000 (18:31 +0100)]
man: zfs-send.8, zfs-receive.8: import examples from zfs.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zfs-diff.8: import examples from zfs.8
наб [Wed, 16 Mar 2022 17:27:44 +0000 (18:27 +0100)]
man: zfs-diff.8: import examples from zfs.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zfs-bookmark.8: import examples from zfs.8
наб [Wed, 16 Mar 2022 17:25:36 +0000 (18:25 +0100)]
man: zfs-bookmark.8: import examples from zfs.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zfs-set.8: import examples from zfs.8
наб [Wed, 16 Mar 2022 17:23:19 +0000 (18:23 +0100)]
man: zfs-set.8: import examples from zfs.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zfs-allow.8: import examples from zfs.8
наб [Wed, 16 Mar 2022 17:20:22 +0000 (18:20 +0100)]
man: zfs-allow.8: import examples from zfs.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zpool-iostat.8: import examples from zpool.8
наб [Wed, 16 Mar 2022 17:04:41 +0000 (18:04 +0100)]
man: zpool-iostat.8: import examples from zpool.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zpool-remove.8: import examples from zpool.8
наб [Wed, 16 Mar 2022 17:04:32 +0000 (18:04 +0100)]
man: zpool-remove.8: import examples from zpool.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zpool-upgrade.8: import examples from zpool.8
наб [Wed, 16 Mar 2022 17:04:23 +0000 (18:04 +0100)]
man: zpool-upgrade.8: import examples from zpool.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zpool-import.8: import examples from zpool.8
наб [Wed, 16 Mar 2022 17:03:56 +0000 (18:03 +0100)]
man: zpool-import.8: import examples from zpool.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zpool-export.8: import examples from zpool.8
наб [Wed, 16 Mar 2022 17:03:47 +0000 (18:03 +0100)]
man: zpool-export.8: import examples from zpool.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zpool-destroy.8: import examples from zpool.8
наб [Wed, 16 Mar 2022 17:03:27 +0000 (18:03 +0100)]
man: zpool-destroy.8: import examples from zpool.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zpool-list.8: import examples from zpool.8
наб [Wed, 16 Mar 2022 17:03:13 +0000 (18:03 +0100)]
man: zpool-list.8: import examples from zpool.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zpool-add.8: import examples from zpool.8
наб [Wed, 16 Mar 2022 17:02:42 +0000 (18:02 +0100)]
man: zpool-add.8: import examples from zpool.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zpool-create.8: import examples from zpool.8
наб [Wed, 16 Mar 2022 16:47:06 +0000 (17:47 +0100)]
man: zpool-create.8: import examples from zpool.8

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228
Closes #13140

2 years agoman: Examples: use subsections instead of lists
наб [Wed, 16 Mar 2022 16:46:32 +0000 (17:46 +0100)]
man: Examples: use subsections instead of lists

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zpool.8: Examples: unmirrored -> non-redundant
наб [Wed, 16 Mar 2022 16:37:18 +0000 (17:37 +0100)]
man: zpool.8: Examples: unmirrored -> non-redundant

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agoman: zpool.8: Examples: use Pa for disks and scripts
наб [Wed, 16 Mar 2022 16:36:03 +0000 (17:36 +0100)]
man: zpool.8: Examples: use Pa for disks and scripts

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13228

2 years agomodule: zfs: dsl_bookmark: silence false-positive maybe-uninitialised
наб [Mon, 28 Mar 2022 17:03:13 +0000 (19:03 +0200)]
module: zfs: dsl_bookmark: silence false-positive maybe-uninitialised

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13247
Closes #13258

2 years agozfs-dkms rpm: simplify scriptlets, fix uninstall
Jeremy Visser [Mon, 28 Mar 2022 16:55:57 +0000 (03:55 +1100)]
zfs-dkms rpm: simplify scriptlets, fix uninstall

Two problems led to unexpected behaviour of the scriptlets:

1) Newer DKMS versions change the formatting of "dkms status":

   (old) zfs, 2.1.2, 5.14.10-300.fc35.x86_64, x86_64: installed
   (new) zfs/2.1.2, 5.14.10-300.fc35.x86_64, x86_64: installed

   Which broke a conditional determining whether to uninstall.

2) zfs_config.h not packaged properly, but was attempted to be read
   in the %preun scriptlet:

   CONFIG_H="/var/lib/dkms/zfs/2.1.2/*/*/zfs_config.h"

   Which broke the uninstallation of the module, which left behind a
   dangling symlink, which broke DKMS entirely with this error:

     Error! Could not locate dkms.conf file.
     File: /var/lib/dkms/zfs/2.1.1/source/dkms.conf does not exist.

This change attempts to simplify life by:

*  Avoiding parsing anything (less prone to future breakage)
*  Uses %posttrans instead of %post for module installation, because
   %post happens before %preun, while %posttrans happens afterwards
*  Unconditionally reinstall module on upgrade, which is less
   efficient but the trade-off is that it's more reliable

Alternative approaches could involve fixing the existing parsing bugs
or improving the logic, but this comes at the cost of complexity and
possible future bugs.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jeremy Visser <jeremyvisser@google.com>
Closes #10463
Closes #13182

2 years agoLinux 5.18 compat: replace genhd.h with blkdev.h includes
наб [Thu, 24 Mar 2022 15:33:40 +0000 (16:33 +0100)]
Linux 5.18 compat: replace genhd.h with blkdev.h includes

blkdev.h includes genhd.h since dawn of upstream git, so this is
globally safe

Upstream-commit: 322cbb50de711814c42fb088f6d31901502c711a ("block:
 remove genhd.h")

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13251

2 years agoLinux 5.18 compat: 4-argument bio_alloc()
наб [Thu, 24 Mar 2022 14:22:53 +0000 (15:22 +0100)]
Linux 5.18 compat: 4-argument bio_alloc()

  bio_alloc(gfp_t gfp_mask, unsigned short nr_iovecs)

became

  bio_alloc(struct block_device *bdev, unsigned short nr_vecs,
            unsigned int opf, gfp_t gfp_mask)
passing NULL/0 continues previous behaviour

Upstream-commit: 07888c665b405b1cd3577ddebfeb74f4717a84c4 ("block:
 pass a block_device and opf to bio_alloc")

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13251

2 years agoBump __FreeBSD_version after linuxkpi updates
Emmanuel Vadot [Mon, 28 Mar 2022 16:31:02 +0000 (18:31 +0200)]
Bump __FreeBSD_version after linuxkpi updates

2 years agolinuxkpi: Change irq_work_queue to return a bool
Emmanuel Vadot [Mon, 28 Mar 2022 13:27:27 +0000 (15:27 +0200)]
linuxkpi: Change irq_work_queue to return a bool

This was changed in Linux v5.10

MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co .KG

2 years agolibc: Check for readdir(2) errors in fts(3)
Ganael LAPLANCHE [Mon, 28 Mar 2022 14:54:02 +0000 (10:54 -0400)]
libc: Check for readdir(2) errors in fts(3)

Previously, such errors were not distinguished from the end-of-directory
condition.

With improvements from Mahmoud Abumandour <ma.mandourr@gmail.com>.

Reviewed by: markj
PR: 262038
MFC after: 2 weeks

2 years agolibc: Restore fp state upon flush error in fputc
Mark Johnston [Fri, 25 Mar 2022 14:46:24 +0000 (10:46 -0400)]
libc: Restore fp state upon flush error in fputc

This is akin to commit bafaa70b6f9098d83d074968c8e6747ecec1e118.

Reported by: Guy Yur <guyyur@gmail.com>
Fixes: 86a16ada1ea6
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

2 years agoaudit: Initialize vattr fields before calling VOP_GETATTR
Mark Johnston [Sun, 20 Mar 2022 01:59:13 +0000 (21:59 -0400)]
audit: Initialize vattr fields before calling VOP_GETATTR

Some filesystems do not fill out certain optional vattr fields.  To
ensure that they do not get copied out to userspace uninitialized, use
VATTR_NULL to provide default values.

Reported by: KMSAN
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

2 years agohpet: Allow a MMIO window smaller than 1K
John F. Carr [Sat, 19 Mar 2022 22:51:43 +0000 (18:51 -0400)]
hpet: Allow a MMIO window smaller than 1K

Some new AMD systems provide a HPET MMIO region smaller than the 1KB
specified, and a correspondingly small number of timers.  Handle this in
the HPET driver rather than requiring a 1KB window.  This allows the
HPET driver to attach on such systems.

PR: 262638
Reviewed by: markj
MFC after: 1 month

2 years agodevd: Add rtw to wireless list
Warner Losh [Mon, 28 Mar 2022 14:16:14 +0000 (08:16 -0600)]
devd: Add rtw to wireless list

rtw88 and rtw89 are coming soon, so add them here now

Sponsored by: Netflix
MFC After: 1 day

2 years agolinuxkpi: Add llnode member in struct irq_work
Emmanuel Vadot [Mon, 28 Mar 2022 12:48:28 +0000 (14:48 +0200)]
linuxkpi: Add llnode member in struct irq_work

This was added in Linux v5.8 and started to be used in drm code in v5.9

MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agopf: add a rule rb tree
Mateusz Guzik [Mon, 28 Feb 2022 20:17:32 +0000 (21:17 +0100)]
pf: add a rule rb tree

with md5 sum used as key.

This gets rid of the quadratic rule traversal when "keep_counters" is
set.

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

2 years agopf: pre-compute rule hash
Mateusz Guzik [Fri, 25 Feb 2022 17:50:56 +0000 (18:50 +0100)]
pf: pre-compute rule hash

Makes it cheaper to compare rules when "keep_counters" is set.
This also sets up keeping them in a RB tree.

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

2 years agopf: add pf_config_lock
Mateusz Guzik [Fri, 25 Feb 2022 17:56:45 +0000 (18:56 +0100)]
pf: add pf_config_lock

For now only protects rule creation/destruction, but will allow
gradually reducing the scope of rules lock when changing the
rules.

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

2 years agopf: include anchor path when hashing a rule
Mateusz Guzik [Mon, 21 Mar 2022 16:34:42 +0000 (16:34 +0000)]
pf: include anchor path when hashing a rule

Otherwise all anchors hash to the same value.

Note this can result in checksum mismatches between pfsynced hosts,
but it has to be sorted out as the previously computed checksum
would fail to indicate changed anchors.

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

2 years agorouting: copy nexthop fib when changing existing nexthop
Alexander V. Chernikov [Mon, 28 Mar 2022 11:31:23 +0000 (11:31 +0000)]
routing: copy nexthop fib when changing existing nexthop

MFC after: 1 day

2 years agoFix a sign mismatch warning in the physmem code
Andrew Turner [Mon, 28 Mar 2022 10:29:42 +0000 (11:29 +0100)]
Fix a sign mismatch warning in the physmem code

Make sure both sides of a comparison are unsigned. As the values being
compared are size_t make the the value in the for loop size_t too.

Sponsored by: The FreeBSD Foundation

2 years agouudecode: add missing test files to Makefile
Piotr Pawel Stefaniak [Mon, 28 Mar 2022 09:49:22 +0000 (11:49 +0200)]
uudecode: add missing test files to Makefile

Fixes: 9f3203c00314 "uudecode: correct error message"

2 years agoTreat cache write as a read in arm64 data faults
Andrew Turner [Sat, 26 Mar 2022 15:59:34 +0000 (15:59 +0000)]
Treat cache write as a read in arm64 data faults

On arm64 we can ask the hardware to perform cache operations from
userspace. These require read permission however when the memory is
unmapped the kernel will receive a write exception. Add a check to
see if the cause of the exception is from the cache and pass a memory
read fault type to the vm subsystem.

PR: 262836
Reported by: dch
Sponsored by: The FreeBSD Foundation

2 years agostress2: Enable four quota tests, which now seems to run without issues
Peter Holm [Mon, 28 Mar 2022 08:44:51 +0000 (10:44 +0200)]
stress2: Enable four quota tests, which now seems to run without issues

2 years agouudecode: correct error message
Piotr Pawel Stefaniak [Mon, 8 Nov 2021 14:31:03 +0000 (15:31 +0100)]
uudecode: correct error message

PR: 153276
Reported by: David Brennan

2 years agouu{encode,decode}: improve style
Piotr Pawel Stefaniak [Mon, 8 Nov 2021 14:31:01 +0000 (15:31 +0100)]
uu{encode,decode}: improve style

2 years agosh: fix autocompletion for commands that share name with a directory
Piotr Pawel Stefaniak [Sat, 12 Mar 2022 11:08:05 +0000 (12:08 +0100)]
sh: fix autocompletion for commands that share name with a directory

Provide libedit a special function making it always add a space after
the autocompleted command. The default one adds a slash if the word is
also a name of a directory in the current working directory, but this is
wrong for commands.

Reviewed by: bapt, jilles
Differential Revision: https://reviews.freebsd.org/D34544

2 years agoMFV 45916e7c91ce: libbsdxml (expat) 2.4.7
Xin LI [Mon, 28 Mar 2022 05:22:07 +0000 (22:22 -0700)]
MFV 45916e7c91ce: libbsdxml (expat) 2.4.7
Update contrib/expat from 2.4.6 to 2.4.7.

MFC after: 2 weeks
Relnotes: yes

2 years agoVendor import of expat 2.4.7.
Xin LI [Mon, 28 Mar 2022 05:19:28 +0000 (22:19 -0700)]
Vendor import of expat 2.4.7.

2 years agoDescribe modern time zone handling.
Greg Lehey [Mon, 28 Mar 2022 03:57:37 +0000 (14:57 +1100)]
Describe modern time zone handling.
Reviewed by: peterj@
MFC after: 2 weeks

2 years agosys/stdatomic.h: be nicer to c++
Konstantin Belousov [Sun, 27 Mar 2022 21:16:15 +0000 (00:16 +0300)]
sys/stdatomic.h: be nicer to c++

Use of stdatomic.h is undefined in C++, even the C++ 2020 standard does not
list stdatomic.h as a C library header supported by the language.  More,
there are some subtle differences between the <atomic> C++ header, and
C11+ stdatomic.h provided features.

Nonetheless, it is a quality of the implementation aspect, so let mis-users
mis-use stdatomic.h as they want, by making a compat shim for _Bool.

PR: 262683
Reported by: yuri
Reviewed by: dim, emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34686

2 years agoypbind(8): Fix a typo in the man page
Gordon Bergling [Sun, 27 Mar 2022 18:42:24 +0000 (20:42 +0200)]
ypbind(8): Fix a typo in the man page

- s/ot/or/

MFC after: 3 days

2 years agonetgraph(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 18:08:44 +0000 (20:08 +0200)]
netgraph(4): Fix a typo in a source code comment

- s/shapshot/snapshot/

MFC after: 3 days

2 years agoclang: Skip attempts to access /proc/self/fd
Mateusz Guzik [Sun, 27 Mar 2022 18:01:38 +0000 (18:01 +0000)]
clang: Skip attempts to access /proc/self/fd

In contrast to Linux it does not provide entries which can be readlinked
-- these are just regular files, not giving the expected outcome. That's
on top of procfs not being mounted by default to begin with.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D34684

2 years agopf(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 17:57:49 +0000 (19:57 +0200)]
pf(4): Fix a typo in a source code comment

- s/seaching/searching/

MFC after: 3 days

2 years agomac_veriexec: Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 17:56:15 +0000 (19:56 +0200)]
mac_veriexec: Fix a typo in a source code comment

- s/seach/search/

MFC after: 3 days

2 years agolibmd: Fix a common typo in the license header
Gordon Bergling [Sun, 27 Mar 2022 17:46:32 +0000 (19:46 +0200)]
libmd: Fix a common typo in the license header

- s/rouines/routines/

Obtained from: NetBSD
MFC after: 3 days

2 years agoath: Fix a typo in a source code comment
Gordon Bergling [Sun, 27 Mar 2022 17:28:49 +0000 (19:28 +0200)]
ath: Fix a typo in a source code comment

- s/ony/only/

MFC after: 3 days

2 years agonfsclient: Fix a typos in source code comments
Gordon Bergling [Sun, 27 Mar 2022 17:27:05 +0000 (19:27 +0200)]
nfsclient: Fix a typos in source code comments

- s/ony/only/

Obtained from: NetBSD
MFC after: 3 days

2 years agovfs: add missing bits to vdropl_impl
Mateusz Guzik [Sun, 27 Mar 2022 14:00:09 +0000 (14:00 +0000)]
vfs: add missing bits to vdropl_impl

This completes the patch which was originally meant to go in.

Spotted by: mhorne
Fixes: c35ec1efdcb2978b ("vfs: [1/2] fix stalls in vnode reclaim by not
requeieing from vnlru")

2 years agovfs: assorted tidy ups to lookup
Mateusz Guzik [Sat, 26 Mar 2022 10:26:59 +0000 (10:26 +0000)]
vfs: assorted tidy ups to lookup

No functional changes.