]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agolinux(4): Prevent integer overflow in futex_requeue.
Dmitry Chagin [Thu, 10 Jun 2021 11:23:11 +0000 (14:23 +0300)]
linux(4): Prevent integer overflow in futex_requeue.

To prevent a signed integer overflow in futex_requeue add a sanity check
to catch negative values of nrwake or nrrequeue.

MFC after: 2 weeks

2 years agolinux(4): Regen for futex system call.
Dmitry Chagin [Thu, 10 Jun 2021 11:16:40 +0000 (14:16 +0300)]
linux(4): Regen for futex system call.

MFC after: 2 weeks

2 years agolinux(4): Change Linux futex syscall definition to match Linux actual one.
Dmitry Chagin [Thu, 10 Jun 2021 11:00:00 +0000 (14:00 +0300)]
linux(4): Change Linux futex syscall definition to match Linux actual one.

MFC after: 2 weeks

2 years agolibcasper: fix descriptors numbers
Mariusz Zaborski [Wed, 9 Jun 2021 21:46:51 +0000 (23:46 +0200)]
libcasper: fix descriptors numbers

Casper services expect that the first 3 descriptors (stdin/stdout/stderr)
will point to /dev/null. Which Casper will ensure later. The Casper
services are forked from the original process. If the initial process
closes one of those descriptors, Casper may reuse one of them for it on
purpose. If this is the case, then renumarate the descriptors used by
Casper to higher numbers. This is done already after the fork, so it
doesn't break the parent process.

PR: 225343
Reported by: Borja Marcos <borjam (at) sarenet.es>
Tested by: jkim@

2 years agostress2: Exclude new syzkaller tests
Peter Holm [Thu, 10 Jun 2021 02:30:12 +0000 (04:30 +0200)]
stress2: Exclude new syzkaller tests

2 years agoinsetad -> instead
Warner Losh [Thu, 10 Jun 2021 02:17:22 +0000 (20:17 -0600)]
insetad -> instead

2 years agomk: WITH_FOO=no now generates a warning
Warner Losh [Thu, 10 Jun 2021 00:10:12 +0000 (18:10 -0600)]
mk: WITH_FOO=no now generates a warning

Many people are used to gnu configure's behavior of changing
--with-foo=no to --without-foo. At the same time, several folks have
WITH_FOO=no in their config files to enable this ironic form of the
option because of an old meme from IRC, a mailing list or the forums (I
forget which). Add a warning to allow to alert people w/o breaking POLA.

Reviewed by: allanjude, bdrewery, manu
MFC After: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30684

2 years agoLinuxKPI: add fault_flag_allow_retry_first
Greg V [Wed, 9 Jun 2021 23:09:16 +0000 (19:09 -0400)]
LinuxKPI: add fault_flag_allow_retry_first

Used by drm 5.7.

Reviewed by: bz, hselasky, nc
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30673

2 years agolinuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock()
Neel Chauhan [Wed, 9 Jun 2021 21:38:52 +0000 (14:38 -0700)]
linuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock()

In Linux, these are macros to locks in the kernel for scheduling purposes.
But as with other macros in this header, we aren't doing anything with them
so we are doing `do {} while (0)` for now.

This is needed by the drm-kmod 5.7 update.

Approved by: hselasky (src)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D30710

2 years agolinuxkpi: Add _RET_IP_ macro in kernel.h
Neel Chauhan [Wed, 9 Jun 2021 21:34:58 +0000 (14:34 -0700)]
linuxkpi: Add _RET_IP_ macro in kernel.h

This is needed by the drm-kmod 5.7 update.

Approved by: hselasky (src)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D30707

2 years agofreebsd-tips: Add fortune on kern.tty_info_kstacks
Michael Gmelin [Fri, 21 May 2021 16:10:26 +0000 (18:10 +0200)]
freebsd-tips: Add fortune on kern.tty_info_kstacks

Add fortune explaining how to use `sysctl kern.tty_info_kstacks' to
alter the output of ^T (tty info).

Reviewed by: ceri
Differential Revision: https://reviews.freebsd.org/D30388

2 years agotcp: LRO timestamps have lost their previous precision
Randall Stewart [Wed, 9 Jun 2021 17:58:54 +0000 (13:58 -0400)]
tcp: LRO timestamps have lost their previous precision

Recently we had a rewrite to tcp_lro.c that was tested but one subtle change
was the move to a less precise timestamp. This causes all kinds of chaos
in tcp's that do pacing and needs to be fixed to use the more precise
time that was there before.

Reviewed by: mtuexen, gallatin, hselasky
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30695

2 years agonfscl: Add a "has acquired a delegation" flag for delegations
Rick Macklem [Wed, 9 Jun 2021 15:00:43 +0000 (08:00 -0700)]
nfscl: Add a "has acquired a delegation" flag for delegations

A problem was reported via email, where a large (130000+) accumulation
of NFSv4 opens on an NFSv4 mount caused significant lock contention
on the mutex used to protect the client mount's open/lock state.
Although the root cause for the accumulation of opens was not
resolved, it is obvious that the NFSv4 client is not designed to
handle 100000+ opens efficiently.

For a common case where delegations are not being issued by the
NFSv4 server, the code acquires the mutex lock for open/lock state,
finds the delegation list empty and just unlocks the mutex and returns.
This patch adds an NFS mount point flag that is set when a delegation
is issued for the mount.  Then the patched code checks for this flag
before acquiring the open/lock mutex, avoiding the need to acquire
the lock for the case where delegations are not being issued by the
NFSv4 server.
This change appears to be performance neutral for a small number
of opens, but should reduce lock contention for a large number of opens
for the common case where server is not issuing delegations.

This commit should not affect the high level semantics of delegation
handling.

MFC after:      2 weeks

2 years agoi386: Add "options HYPERV" to NOTES
Mark Johnston [Wed, 9 Jun 2021 12:58:45 +0000 (08:58 -0400)]
i386: Add "options HYPERV" to NOTES

This unbreaks the LINT build.

Fixes: 97993d1ebf
Reported by: mjg
MFC after: 13 days

2 years agotests/netgraph: Tests for ng_vlan_rotate
Lutz Donnerhacke [Sun, 6 Jun 2021 23:56:12 +0000 (01:56 +0200)]
tests/netgraph: Tests for ng_vlan_rotate

Test functionality of ng_vlan_rotate(4):
 - Rotate 1 to 9 stagged vlans in any possible direction and length
 - Rotate random combinations of ethertypes (8100, 88a8, 9100)
 - Automatic reverse rotating for backward data flow
 - Test too many and to few vlans

Reviewed by: kp (earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30670

2 years agotests/netgraph: Tests for ng_hub
Lutz Donnerhacke [Thu, 3 Jun 2021 22:22:29 +0000 (00:22 +0200)]
tests/netgraph: Tests for ng_hub

Test functionality of ng_hub(4):
 - replicting traffic to anything but the sending hook
 - persistence
 - an unrestricted loop
 - implementation limits with many hooks.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30633

2 years agotests/netgraph: Factor out univeral data counter functions
Lutz Donnerhacke [Tue, 8 Jun 2021 19:45:20 +0000 (21:45 +0200)]
tests/netgraph: Factor out univeral data counter functions

Factor out the data counter helpers for other tests to use.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30699

2 years agotests/netgraph: Fix style
Lutz Donnerhacke [Tue, 8 Jun 2021 08:46:18 +0000 (10:46 +0200)]
tests/netgraph: Fix style

Indent all files correctly

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30692

2 years agoFix syscall kld example
Fernando Apesteguía [Thu, 27 May 2021 12:09:39 +0000 (14:09 +0200)]
Fix syscall kld example

PR: 255936
Reported by: splitface@mailfence.com
Approved by: gbe (mentor), imp@, jilles@
Differential Revision: https://reviews.freebsd.org/D30498

2 years agork3328_cru: fix a typo in the SCLK_I2S2 gate definition
Andriy Gapon [Wed, 9 Jun 2021 07:44:41 +0000 (10:44 +0300)]
rk3328_cru: fix a typo in the SCLK_I2S2 gate definition

MFC after: 4 days

2 years agorc.d: liberate powerd from ACPI dependency
Andriy Gapon [Tue, 8 Jun 2021 17:08:10 +0000 (20:08 +0300)]
rc.d: liberate powerd from ACPI dependency

For instance, many non-ACPI ARM systems have CPU power / frequency
levels.

Discussed with: manu
MFC after: 1 week

2 years agoUPDATING: correct typo
Ed Maste [Wed, 9 Jun 2021 00:46:16 +0000 (20:46 -0400)]
UPDATING: correct typo

Sponsored by: The FreeBSD Foundation

2 years agolibspl: fix NO_CLEAN build
Warner Losh [Tue, 8 Jun 2021 23:56:15 +0000 (17:56 -0600)]
libspl: fix NO_CLEAN build

atomic.S moved to atomic.c, update the cleaup script to remove stale
dependencies for this.

Sponsored by: Netflix

2 years agozfs: unbreak build broken in 160388166
Martin Matuska [Tue, 8 Jun 2021 17:02:21 +0000 (19:02 +0200)]
zfs: unbreak build broken in 160388166

2 years agotip: Fix pointer-vs-integer confusion
Jessica Clarke [Tue, 8 Jun 2021 17:30:59 +0000 (18:30 +0100)]
tip: Fix pointer-vs-integer confusion

Currently IREMOTE assumes that every value is (initially) a pointer to a
long. This is true for NUMBERs, but false for STRINGs, which are instead
pointers to pointers, though on ILP32 and LP64 systems these happen to
have the same representation, but this is still a strict aliasing
violation, and of course breaks on systems where the representations are
not the same, such as CHERI. We do not currently have any BOOLs (short,
curiously) or CHARs used with IREMOTE, though the code should not be
relying on that.

This removes the unused setaddress macro, and the now-unused address
macro due to the above issue.

Reviewed by: imp, kib
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D30697

2 years agotip: Cast via intptr_t not long when casting between pointer and int
Jessica Clarke [Tue, 8 Jun 2021 17:30:59 +0000 (18:30 +0100)]
tip: Cast via intptr_t not long when casting between pointer and int

Whilst all FreeBSD architectures have the same representation for
intptr_t and long (even if the former is int on ILP32 architectures),
this is more general and correct, and on CHERI they are not the same so
warnings are generated by default for integer-to-pointer casts that
aren't via (u)intptr_t.

Reviewed by: imp, kib
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D30696

2 years agotests/netgraph: Attribute errors to the caller
Lutz Donnerhacke [Tue, 8 Jun 2021 17:19:35 +0000 (19:19 +0200)]
tests/netgraph: Attribute errors to the caller

Errors raised in the common util functions should raise the location
of their caller to be useful and include the errno description.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30671

2 years agoAdd ofw interface support to PCI
Marcin Wojtas [Thu, 27 May 2021 08:09:04 +0000 (10:09 +0200)]
Add ofw interface support to PCI

Some arm64 SoCs have nodes in their fdts that describe devices
connected to the internal PCI bus. One such SoC is Freescale LS1028A.
In order to access information stored in them we need to add ofw bus
support to pci. Pass devinfo request up to our parent, which
is responsible for parsing all the information.
It allows to use ofw interface on PCI devices that support it.
This method is similar to sys/dev/acpica/acpi_pci.c.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30181

2 years agopci_host_generic_fdt.c: Add support for mapping dts nodes to PCI devices
Marcin Wojtas [Thu, 27 May 2021 08:07:19 +0000 (10:07 +0200)]
pci_host_generic_fdt.c: Add support for mapping dts nodes to PCI devices

Some arm64 SoCs have nodes in their fdts that describe devices
connected to the internal PCI bus. One such SoC is Freescale LS1028A.
It expects the nodes to be mapped to devices enumerated using the standard
PCI method. Mapping is done by reading device and function ids from "reg"
property. Information is dts is used to describe MDIO/PHY connected
to a given interface.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30180

2 years agoRemove ThunderX PCIe FDT quirks from pci_host_generic_fdt.c
Marcin Wojtas [Thu, 27 May 2021 08:05:35 +0000 (10:05 +0200)]
Remove ThunderX PCIe FDT quirks from pci_host_generic_fdt.c

ThunderX is the only board known to use them.
Move them to the ThunderX PCIe driver.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30179

2 years agoupdating: add note about vendor/openzfs branch rename
Warner Losh [Tue, 8 Jun 2021 14:57:42 +0000 (08:57 -0600)]
updating: add note about vendor/openzfs branch rename

Add a pointer to
https://lists.freebsd.org/archives/freebsd-current/2021-June/000153.html
to explain how to pull a new tree due to the vendor/openzfs branch
being renamed.

Reviewed by: lwhsu@
Sponsored by: Netflix

2 years agozfs: merge openzfs/zfs@75b4cbf62 (master) into main
Martin Matuska [Tue, 8 Jun 2021 14:48:37 +0000 (16:48 +0200)]
zfs: merge openzfs/zfs@75b4cbf62 (master) into main

Notable upstream pull request merges:
  #11710 Allow zfs to send replication streams with missing snapshots
  #11751 Avoid taking global lock to destroy zfsdev state
  #11786 Ratelimit deadman zevents as with delay zevents
  #11803 ZFS traverse_visitbp optimization to limit prefetch
  #11813 Allow pool names that look like Solaris disk names
  #11822 Atomically check and set dropped zevent count
  #11822 Don't scale zfs_zevent_len_max by CPU count
  #11833 Refactor zfsdev state init/destroy to share common code
  #11837 zfs get -p only outputs 3 columns if "clones" property is empty
  #11843 libzutil: zfs_isnumber(): return false if input empty
  #11849 Use dsl_scan_setup_check() to setup a scrub
  #11861 Improvements to the 'compatibility' property
  #11862 cmd/zfs receive: allow dry-run (-n) to check property args
  #11864 receive: don't fail inheriting (-x) properties on wrong dataset type
  #11877 Combine zio caches if possible
  #11881 FreeBSD: use vnlru_free_vfsops if available
  #11883 FreeBSD: add support for lockless symlink lookup
  #11884 FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr
  #11896 Fix crash in zio_done error reporting
  #11905 zfs-send(8): Restore sorting of flags
  #11926 FreeBSD: damage control racing .. lookups in face of mkdir/rmdir
  #11930 vdev_mirror: don't scrub/resilver devices that can't be read
  #11938 Fix AVX512BW Fletcher code on AVX512-but-not-BW machines
  #11955 zfs get: don't lookup mount options when using "-s local"
  #11956 libzfs: add keylocation=https://, backed by fetch(3) or libcurl
  #11959 vdev_id: variable not getting expanded under map_slot()
  #11966 Scale worker threads and taskqs with number of CPUs
  #11994 Clean up use of zfs_log_create in zfs_dir
  #11997 FreeBSD: Don't force xattr mount option
  #11997 FreeBSD: Implement xattr=sa
  #11997 FreeBSD: Use SET_ERROR to trace xattr name errors
  #11998 Simplify/fix dnode_move() for dn_zfetch
  #12003 FreeBSD: Initialize/destroy zp->z_lock
  #12010 Fix dRAID self-healing short columns
  #12033 Revert "Fix raw sends on encrypted datasets when copying back snapshots"
  #12040 Reinstate the old zpool read label logic as a fallback
  #12046 Improve scrub maxinflight_bytes math
  #12049 FreeBSD: avoid memory allocation in arc_prune_async
  #12052 FreeBSD: incorporate changes to the VFS_QUOTACTL(9) KPI
  #12061 Fix dRAID sequential resilver silent damage handling
  #12072 Let zfs diff be more permissive
  #12077 FreeBSD: Retry OCF ENOMEM errors.
  #12088 Propagate vdev state due to invalid label corruption
  #12091 libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat
  #12097 FreeBSD: Update dataset_kstats for zvols in dev mode
  #12104 FreeBSD boot code reminder after zpool upgrade
  #12114 Introduce write-mostly sums

Obtained from: OpenZFS
OpenZFS commit: 75b4cbf62590c23fac3667537961a2a75fdc2cc3

2 years agozfs: merge openzfs/zfs@3522f57b6 (master) to main
Martin Matuska [Tue, 8 Jun 2021 14:23:50 +0000 (16:23 +0200)]
zfs: merge openzfs/zfs@3522f57b6 (master) to main

This changes branch tracking of sys/contrib/openzfs to a new
direct-import branch vendor/openzfs/master.

No functional changes.

OpenZFS tag: 2.1.0-rc1

2 years agohyperv: Fix vmbus after the i386 4/4 split
Mark Johnston [Tue, 8 Jun 2021 13:40:30 +0000 (09:40 -0400)]
hyperv: Fix vmbus after the i386 4/4 split

The vmbus ISR needs to live in a trampoline.  Dynamically allocating a
trampoline at driver initialization time poses some difficulties due to
the fact that the KENTER macro assumes that the offset relative to
tramp_idleptd is fixed at static link time.  Another problem is that
native_lapic_ipi_alloc() uses setidt(), which assumes a fixed trampoline
offset.

Rather than fight this, move the Hyper-V ISR to i386/exception.s.  Add a
new HYPERV kernel option to make this optional, and configure it by
default on i386.  This is sufficient to make use of vmbus(4) after the
4/4 split.  Note that vmbus cannot be loaded dynamically and both the
HYPERV option and device must be configured together.  I think this is
not too onerous a requirement, since vmbus(4) was previously
non-functional.

Reported by: Harry Schmalzbauer <freebsd@omnilan.de>
Tested by: Harry Schmalzbauer <freebsd@omnilan.de>
Reviewed by: whu, kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30577

2 years agolibzfs: On FreeBSD, use MNT_NOWAIT with getfsstat
Alan Somers [Tue, 8 Jun 2021 13:36:43 +0000 (07:36 -0600)]
libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat

`getfsstat(2)` is used to retrieve the list of mounted file systems,
which libzfs uses when fetching properties like mountpoint, atime,
setuid, etc.  The `mode` parameter may be `MNT_NOWAIT`, which uses
information in the VFS's cache, or `MNT_WAIT`, which effectively does a
`statfs` on every single mounted file system in order to fetch the most
up-to-date information.  As far as I can tell, the only fields that
libzfs cares about are the filesystem's name, mountpoint, fstypename,
and mount flags.  Those things are always updated on mount and unmount,
so they will always be accurate in the VFS's mount cache except in two
circumstances:

1) When a file system is busy unmounting
2) When a ZFS file system changes the value of a mount-overridable
   property like atime or setuid, but doesn't remount the file system.
   Right now that only happens when the property is changed by an
   unprivileged user who has delegated authority to change the property
   but not to mount the dataset.  But perhaps libzfs could choose to do
   it for other reasons in the future.

Switching to `MNT_NOWAIT` will greatly improve speed with no downside,
as long as we explicitly update the mount cache whenever we change a
mount-overridable property.

For comparison, Illumos gets this information using the native
`getmntany` and `getmntent` functions, which also use cached
information.  The illumos function that would refresh the cache,
`resetmnttab`, is never called by libzfs.

And on GNU/Linux, `getmntany` and `getmntent` don't even communicate
with the kernel directly.  They simply parse the file they are given,
which is usually /etc/mtab or /proc/mounts.  Perhaps the implementation
of /proc/mounts is synchronous, ala MNT_WAIT; I don't know.

Sponsored-by: Axcient
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alan Somers <asomers@gmail.com>
Closes: #12091
2 years agotests/netgraph: Tests for ng_bridge
Lutz Donnerhacke [Fri, 4 Jun 2021 10:59:00 +0000 (12:59 +0200)]
tests/netgraph: Tests for ng_bridge

Test functionality of ng_bridge(4):
 - replicating traffic to anything but the sending hook
 - persistence
 - detect loops
 - unicast to only one link of many
 - stretch to implementation limits on broadcast

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30647

2 years agoAdd a virtio-input device emulation.
Corvin Köhne [Tue, 8 Jun 2021 08:56:43 +0000 (18:56 +1000)]
Add a virtio-input device emulation.

This will be used to inject keyboard/mouse input events into a guest.
The command line syntax is:
   -s <slot>,virtio-input,/dev/input/eventX

Reviewed by: jhb (bhyve), grehan
Obtained from: Corvin Köhne <C.Koehne@beckhoff.com>
MFC after: 3 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D30020

2 years agotests/netgraph: Allow receiving answers to messages
Lutz Donnerhacke [Sat, 5 Jun 2021 22:37:22 +0000 (00:37 +0200)]
tests/netgraph: Allow receiving answers to messages

Add msg_handler in order to receive messages from netgraph nodes to be
tested.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30657

2 years agolinux: make sure to zero the l_siginfo structure for ptrace(2)
Edward Tomasz Napierala [Tue, 8 Jun 2021 09:18:29 +0000 (10:18 +0100)]
linux: make sure to zero the l_siginfo structure for ptrace(2)

Reported By: dchagin
Sponsored By: EPSRC

2 years agolinux: implement statx(2)
Philippe Michaud-Boudreault [Tue, 8 Jun 2021 08:24:10 +0000 (09:24 +0100)]
linux: implement statx(2)

PR: 252106
Reviewed By: dchagin
Differential Revision: https://reviews.freebsd.org/D30466

2 years agoFix copyright, remove "all rights reserved".
Dmitry Chagin [Tue, 8 Jun 2021 05:18:00 +0000 (08:18 +0300)]
Fix copyright, remove "all rights reserved".

The eventfd code was written by me, rdivacky@ copyrigth applicable only
to epoll part of the Linuxulator code. Roman is ok to retire his copyright
from sys/kern/sys_eventfd.c and 'All rights reserved.' lines from
sys/compat/linux/linux_event.[c|h] and sys/kern/sys_eventfd.c files.

Reviewed by: kib, emaste
Approved by: rdivacky
Differential Revision: https://reviews.freebsd.org/D30677
MFC after: 2 weeks

2 years agotests/file_check: remove unused variable
наб [Thu, 3 Jun 2021 16:33:37 +0000 (18:33 +0200)]
tests/file_check: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agomodule/zfs: vdev_removal: spa_vdev_remove_thread: remove unused variable
наб [Thu, 3 Jun 2021 16:33:01 +0000 (18:33 +0200)]
module/zfs: vdev_removal: spa_vdev_remove_thread: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agomodule/zfs: vdev_indirect: vdev_indirect_repair: remove unused variable
наб [Thu, 3 Jun 2021 16:32:38 +0000 (18:32 +0200)]
module/zfs: vdev_indirect: vdev_indirect_repair: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agomodule/zfs: dbuf: dbuf_read_impl: remove unused variable
наб [Thu, 3 Jun 2021 16:31:58 +0000 (18:31 +0200)]
module/zfs: dbuf: dbuf_read_impl: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agomodule/zfs: arc: arc_hdr_realloc_crypt: remove unused variables
наб [Thu, 3 Jun 2021 16:31:21 +0000 (18:31 +0200)]
module/zfs: arc: arc_hdr_realloc_crypt: remove unused variables

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agolibzfs: zfs_send: remove unused variable
наб [Thu, 3 Jun 2021 16:30:23 +0000 (18:30 +0200)]
libzfs: zfs_send: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agozdb: zdb_decompress_block: don't needlessly set buf
наб [Thu, 3 Jun 2021 16:29:45 +0000 (18:29 +0200)]
zdb: zdb_decompress_block: don't needlessly set buf

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agolibzutil: zpool_find_config: remove unused variable
наб [Thu, 3 Jun 2021 15:10:41 +0000 (17:10 +0200)]
libzutil: zpool_find_config: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

2 years agolinuxkpi: Fix build from redefined pr_err_once()
Neel Chauhan [Mon, 7 Jun 2021 23:37:21 +0000 (16:37 -0700)]
linuxkpi: Fix build from redefined pr_err_once()

2 years agolinuxkpi: Include pr_err_once() in printk.h
Neel Chauhan [Mon, 7 Jun 2021 22:52:37 +0000 (15:52 -0700)]
linuxkpi: Include pr_err_once() in printk.h

Approved by: bz (src), hselasky (src)
Differential Reivison: https://reviews.freebsd.org/D30687

2 years agolinuxkpi: Add rom and romlen to struct pci_dev
Neel Chauhan [Mon, 7 Jun 2021 22:50:46 +0000 (15:50 -0700)]
linuxkpi: Add rom and romlen to struct pci_dev

Approved by: bz (src), hselasky (src)
Differential Reivison: https://reviews.freebsd.org/D30686

2 years agoCirrus-CI: Use the default Git history depth
Fedor Korotkov [Fri, 29 Jan 2021 14:22:54 +0000 (09:22 -0500)]
Cirrus-CI: Use the default Git history depth

Which is `50`.  I saw a few errors like
`Failed to force reset to SHA: object not found!` which seems is
happening because the SHA is not available because there were two
commits pushed almost simultaneously and the second from the top fails
with this error because the SHA is not in the history.

Pull Request: https://github.com/freebsd/freebsd-src/pull/454

Comments on re-commit from emaste:

Originally committed as fcb4797c90f3 and reverted in 80a840b8ba03 due
to the clone operation taking significantly longer.  However, I have
seen many failures due to the "object not found" issue recently.
7 of 37 recent runs failed because of this, and intermittent failures
like this makes CI much less useful.

Prefer longer-running runs to intermittent failures.

2 years agonfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems
Rick Macklem [Mon, 7 Jun 2021 20:48:25 +0000 (13:48 -0700)]
nfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems

Pre-r318997 the code looked like:
if (vp->v_mount->mnt_stat.f_fsid.val[0] != (uint32_t)np->n_vattr.na_filesid[0])
         vap->va_fsid = (uint32_t)np->n_vattr.na_filesid[0];
Doing this assignment got lost by r318997 and, as such, NFSv4 mounts
of servers with trees of file systems on the server is broken, due to duplicate
fileno values for the same st_dev/va_fsid.

Although I could have re-introduced the assignment, since the value of
na_filesid[0] is not guaranteed to be unique across the server file systems,
I felt it was better to always do the hash for na_filesid[0,1].
Since dev_t (st_dev/va_fsid) is now 64bits, I switched to a 64bit hash.

There is a slight chance of a hash conflict where 2 different na_filesid
values map to same va_fsid, which will be documented in the BUGS
section of the man page for mount_nfs(8).  Using a table to keep track
of mappings to catch conflicts would not easily scale to 10,000+ server file
systems and, when the conflict occurs, it only results in fts(3) reporting
a "directory cycle" under certain circumstances.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D30660

2 years agoFix handling of D_GIANTOK
Mark Johnston [Mon, 7 Jun 2021 18:25:26 +0000 (14:25 -0400)]
Fix handling of D_GIANTOK

It was meant to suppress only the printf(), not the subsequent injection
of Giant-protected thunks for various file operations.

Fixes: fbeb4ccac9
Reported by: pho
Tested by: pho
MFC after: 6 days
Pointy hat: markj

2 years agoModernise/fix/rewrite unlinted manpages
наб [Mon, 7 Jun 2021 19:41:54 +0000 (21:41 +0200)]
Modernise/fix/rewrite unlinted manpages

zpool-destroy.8: flatten, fix description
zfs-wait.8: flatten, fix description, use list for events
zpool-reguid.8: flatten, fix description
zpool-history.8: flatten, fix description
zpool-export.8: flatten, fix description, remove -f "unmount" reference
  AFAICT no such command exists even in Illumos (as of today, anyway),
  and we definitely don't call it
zpool-labelclear.8: flatten, fix description
zpool-features.5: modernise
spl-module-parameters.5: modernise
zfs-mount-generator.8: rewrite
zfs-module-parameters.5: modernise

Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12169

2 years agoForce --enable-debug on FreeBSD if INVARIANTS is set
Rich Ercolani [Mon, 7 Jun 2021 19:29:27 +0000 (15:29 -0400)]
Force --enable-debug on FreeBSD if INVARIANTS is set

There's already logic to force INVARIANTS on for building if it's
present in the running kernel; however, not having DEBUG enabled
when DEBUG and INVARIANTS are can cause strange panics.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #12185
Closes #12163

2 years agoLivelist logic should handle dedup blkptrs
Serapheim Dimitropoulos [Mon, 7 Jun 2021 19:09:07 +0000 (12:09 -0700)]
Livelist logic should handle dedup blkptrs

Update the logic to handle the dedup-case of consecutive
FREEs in the livelist code. The logic still ensures that
all the FREE entries are matched up with a respective
ALLOC by keeping a refcount for each FREE blkptr that we
encounter and ensuring that this refcount gets to zero
by the time we are done processing the livelist.

zdb -y no longer panics when encountering double frees

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Don Brady <don.brady@delphix.com>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #11480
Closes #12177

2 years agoMore aggsum optimizations
Alexander Motin [Mon, 7 Jun 2021 16:02:47 +0000 (12:02 -0400)]
More aggsum optimizations

- Avoid atomic_add() when updating as_lower_bound/as_upper_bound.
Previous code was excessively strong on 64bit systems while not
strong enough on 32bit ones.  Instead introduce and use real
atomic_load() and atomic_store() operations, just an assignments
on 64bit machines, but using proper atomics on 32bit ones to avoid
torn reads/writes.

 - Reduce number of buckets on large systems.  Extra buckets not as
much improve add speed, as hurt reads.  Unlike wmsum for aggsum
reads are still important.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12145

2 years agoLinuxKPI: add pr_err_once
Greg V [Mon, 7 Jun 2021 14:30:18 +0000 (10:30 -0400)]
LinuxKPI: add pr_err_once

Reviewed by: hselasky, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30672

2 years agousr.bin/calendar: do not treat // in text as comment
Stefan Eßer [Mon, 7 Jun 2021 13:46:24 +0000 (15:46 +0200)]
usr.bin/calendar: do not treat // in text as comment

The C++-style comment marker "//" has been added with the rewrite of
the preprocessor features. Since this character sequence occurs in
ULRS, the reminder of the URL was considered a comment and stripped
from the calendar line.

Change parsing of "//" to only start a comment at the begin of a line
or when preceeded by a white-space character.

PR: 256455
Reported by: Philippe Michel (philippe.michel7 at free.fr)
MFC after: 3 days

2 years agoInstall the linux(4) man page also for aarch64
Edward Tomasz Napierala [Mon, 7 Jun 2021 10:50:25 +0000 (11:50 +0100)]
Install the linux(4) man page also for aarch64

Previously it was only installed on i386 and amd64.

Reviewed By: emaste, gbe (manpages)
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D30546

2 years agolinux: improve FUSE support
Edward Tomasz Napierala [Mon, 7 Jun 2021 09:43:23 +0000 (10:43 +0100)]
linux: improve FUSE support

This fixes a number of AppImages; tested with
scribus-1.5.6.1-linux-x86_64.AppImage.

Reported By: @probonopd
Reviewed By: asomers, emaste
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D30606

2 years agofifolog: Rename yyparse() to getdate_yyparse().
Poul-Henning Kamp [Mon, 7 Jun 2021 06:30:34 +0000 (06:30 +0000)]
fifolog: Rename yyparse() to getdate_yyparse().

Remove config file for obsolete static analyzer FlexeLint

2 years agostress2: Added two test scenarios based on Bug 256205
Peter Holm [Mon, 7 Jun 2021 05:35:10 +0000 (07:35 +0200)]
stress2: Added two test scenarios based on Bug 256205

2 years agostress2: Added a few syzkaller reproducers
Peter Holm [Mon, 7 Jun 2021 05:33:32 +0000 (07:33 +0200)]
stress2: Added a few syzkaller reproducers

2 years agongatm: Handle errors from uni_msg_extend()
Mark Johnston [Sun, 6 Jun 2021 20:42:16 +0000 (16:42 -0400)]
ngatm: Handle errors from uni_msg_extend()

uni_msg_extend() may fail due to a memory allocation failure.  In this
case, though, the message is freed, so callers shouldn't touch it.

PR: 255861
Reviewed by: harti
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30611

2 years agoarm: Remove last_fault_code
Mark Johnston [Sun, 6 Jun 2021 20:42:13 +0000 (16:42 -0400)]
arm: Remove last_fault_code

It is unused since the removal of pmap-v4.c in commit b88b275145.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agoiwn: adjust EEPROM read timeout for Intel 4965AGN M2
Radosław Chmielarz [Sun, 6 Jun 2021 20:42:10 +0000 (16:42 -0400)]
iwn: adjust EEPROM read timeout for Intel 4965AGN M2

Reading EEPROM from Intel 4965AGN M2 takes 60 us which was causing panic
on system startup.

PR: 255465
Reviewed by: markj
MFC after: 1 week

2 years agoriscv: Rename pmap_fault_fixup() to pmap_fault()
Mark Johnston [Sun, 6 Jun 2021 20:42:00 +0000 (16:42 -0400)]
riscv: Rename pmap_fault_fixup() to pmap_fault()

This is consistent with other platforms, specifically arm and arm64.  No
functional change intended.

Reviewed by: jrtc27
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30645

2 years agoriscv: Handle hardware-managed dirty bit updates in pmap_promote_l2()
Mark Johnston [Sun, 6 Jun 2021 20:41:35 +0000 (16:41 -0400)]
riscv: Handle hardware-managed dirty bit updates in pmap_promote_l2()

pmap_promote_l2() failed to handle implementations which set the
accessed and dirty flags.  In particular, when comparing the attributes
of a run of 512 PTEs, we must handle the possibility that the hardware
will set PTE_D on a clean, writable mapping.

Following the example of amd64 and arm64, change riscv's
pmap_promote_l2() to downgrade clean, writable mappings to read-only, so
that updates are synchronized by the pmap lock.

Fixes: f6893f09d
Reported by: Nathaniel Filardo <nwf20@cl.cam.ac.uk>
Tested by: Nathaniel Filardo <nwf20@cl.cam.ac.uk>
Reviewed by: jrtc27, alc, Nathaniel Filardo
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30644

2 years agoarm64: Fix pmap_copy()'s handling of 2MB mappings
Mark Johnston [Sun, 6 Jun 2021 20:40:45 +0000 (16:40 -0400)]
arm64: Fix pmap_copy()'s handling of 2MB mappings

When copying mappings from parent to child, we clear the accessed and
dirty bits.  This is done for both 4KB and 2MB PTEs.  However,
pmap_demote_l2() asserts that writable superpages must be dirty.  This
is to avoid races with the MMU setting the dirty bit during promotion
and demotion.  pmap_copy() can create clean, writable superpage
mappings, so it violates this assertion.

Modify pmap_copy() to preserve the accessed and dirty bits when copying
2MB mappings, like we do on amd64.

Fixes: ca2cae0b4dd
Reported by: Jenkins via mhorne
Reviewed by: alc, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30643

2 years agoarm64: Use the right PTE when downgrading perms in pmap_promote_l2()
Mark Johnston [Sun, 6 Jun 2021 20:40:29 +0000 (16:40 -0400)]
arm64: Use the right PTE when downgrading perms in pmap_promote_l2()

When promoting a run of small mappings to a superpage, we have to
downgrade clean, writable mappings to read-only, to handle the
possibility that the MMU will concurrently mark one of the mappings as
dirty.

The code which performed this operation for the first PTE in the run
used the wrong PTE pointer.  As a result, the comparison would always
fail, aborting the promotion.  This only occurs when promoting writable,
clean mappings.

Fixes: ca2cae0b4dd
Reviewed by: alc, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30642

2 years agostand: Fix __elfN(loadimage) return value
Mark Johnston [Sun, 6 Jun 2021 20:40:25 +0000 (16:40 -0400)]
stand: Fix __elfN(loadimage) return value

Caller functions expect __elfN(loadimage) to return a value of zero on
failure and the file size on success.

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

2 years agoSuppress D_NEEDGIANT warnings for some drivers
Mark Johnston [Sun, 6 Jun 2021 20:40:19 +0000 (16:40 -0400)]
Suppress D_NEEDGIANT warnings for some drivers

During boot we warn that the kbd and openfirm drivers are Giant-locked
and may be deleted.  Generally, the warning helps signal that certain
old drivers are not being maintained and are subject to removal, but
this doesn't really apply to certain drivers which are harder to
detangle from Giant.

Add a flag, D_GIANTOK, that devices can specify to suppress the
misleading warning.  Use it in the kbd and openfirm drivers.

Reviewed by: imp, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30649

2 years agoChange the return type of sv__setid_allowed from bool to int
Konstantin Belousov [Sun, 6 Jun 2021 20:38:48 +0000 (23:38 +0300)]
Change the return type of sv__setid_allowed from bool to int

to please some userspace code using sys/sysent.h.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 years agolinuxolator: Add compat.linux.setid_allowed knob
Konstantin Belousov [Thu, 14 Jan 2021 13:51:52 +0000 (15:51 +0200)]
linuxolator: Add compat.linux.setid_allowed knob

PR: 21463
Reported by: kris
Reviewed by: dchagin
Tested by: trasz
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28154

2 years agosysent: allow ABI to disable setid on exec.
Konstantin Belousov [Thu, 14 Jan 2021 13:38:29 +0000 (15:38 +0200)]
sysent: allow ABI to disable setid on exec.

Reviewed by: dchagin
Tested by: trasz
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28154

2 years agokern_exec.c: Add execve_nosetid() helper
Konstantin Belousov [Thu, 14 Jan 2021 13:36:15 +0000 (15:36 +0200)]
kern_exec.c: Add execve_nosetid() helper

Reviewed by: dchagin
Tested by: trasz
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28154

2 years agolinux(4): Fix clock_nanosleep return value for unsupported clockid.
Dmitry Chagin [Mon, 7 Jun 2021 03:22:25 +0000 (06:22 +0300)]
linux(4): Fix clock_nanosleep return value for unsupported clockid.

The Linux clock_nanosleep() returns ENOTSUP for CLOCK_THREAD_CPUTIME_ID.
This silence one of the LTP clock_nanosleep tests.

MFC after: 2 weeks

2 years agolinux(4): optimize ksiginfo to siginfo conversion.
Dmitry Chagin [Mon, 7 Jun 2021 03:06:17 +0000 (06:06 +0300)]
linux(4): optimize ksiginfo to siginfo conversion.

Retire ksiginfo_to_lsiginfo function, use siginfo_to_lsiginfo instead.
Convert rt_sigtimedwait siginfo variables to well known names.

MFC after: 2 weeks

2 years agolinux(4): Properly convert linux siginfo to native siginfo
Dmitry Chagin [Mon, 7 Jun 2021 02:55:34 +0000 (05:55 +0300)]
linux(4): Properly convert linux siginfo to native siginfo
add input validation.

MFC after: 2 weeks

2 years agoRegen for ('0f8dab45404f347752470579feccc6d2739b9570') Linux
Dmitry Chagin [Mon, 7 Jun 2021 02:39:29 +0000 (05:39 +0300)]
Regen for ('0f8dab45404f347752470579feccc6d2739b9570') Linux
rt_sigtimedwait system call.

MFC after: 2 weeks

2 years agolinux(4): Fix timeout parameter of rt_sigtimedwait syscall, which is
Dmitry Chagin [Mon, 7 Jun 2021 02:35:35 +0000 (05:35 +0300)]
linux(4): Fix timeout parameter of rt_sigtimedwait syscall, which is
timespec not a timeval.

MFC after: 2 weeks

2 years agoRegen for ('6501370a7dfb358daf07555136742bc064e68cb7') Linux
Dmitry Chagin [Mon, 7 Jun 2021 02:29:27 +0000 (05:29 +0300)]
Regen for ('6501370a7dfb358daf07555136742bc064e68cb7') Linux
clock_nanosleep_time64 system call.

MFC after: 2 weeks

2 years agolinux(4): Implement clock_nanosleep_time64 system call.
Dmitry Chagin [Mon, 7 Jun 2021 02:26:48 +0000 (05:26 +0300)]
linux(4): Implement clock_nanosleep_time64 system call.

MFC after: 2 weeks

2 years agoRegen for ('187715a420237e1ed94dd5aef158eada7dcdc559') Linux
Dmitry Chagin [Mon, 7 Jun 2021 02:21:48 +0000 (05:21 +0300)]
Regen for ('187715a420237e1ed94dd5aef158eada7dcdc559') Linux
clock_getres_time64 system call.

MFC after: 2 weeks

2 years agolinux(4): Implement clock_getres_time64 system call.
Dmitry Chagin [Mon, 7 Jun 2021 02:21:32 +0000 (05:21 +0300)]
linux(4): Implement clock_getres_time64 system call.

MFC after: 2 weeks

2 years agoMake LINT NOINET and NOIP kernel builds warning free.
Bjoern A. Zeeb [Sun, 6 Jun 2021 14:03:06 +0000 (14:03 +0000)]
Make LINT NOINET and NOIP kernel builds warning free.

Apply #ifdef INET or #if defined(INET6) || defined(INET) to make
universe NOINET and NOIP LINT kernels warning free as well again.

2 years agoRegen for ('19f9a0e4df54f8d1e99234146024422bdcfa09ce') Linux
Dmitry Chagin [Mon, 7 Jun 2021 02:14:04 +0000 (05:14 +0300)]
Regen for ('19f9a0e4df54f8d1e99234146024422bdcfa09ce') Linux
clock_settime64 system call.

MFC after: 2 weeks

2 years agolinux(4): Implement clock_settime64 system call.
Dmitry Chagin [Mon, 7 Jun 2021 02:11:25 +0000 (05:11 +0300)]
linux(4): Implement clock_settime64 system call.

MFC after: 2 weeks

2 years agoRegen for ('99b6f430698fa00a33184dd61591d8b6518ed9d3') Linux
Dmitry Chagin [Mon, 7 Jun 2021 02:08:11 +0000 (05:08 +0300)]
Regen for ('99b6f430698fa00a33184dd61591d8b6518ed9d3') Linux
clock_gettime64 system call.

MFC after: 2 weeks

2 years agolinux(4): Implement clock_gettime64 system call.
Dmitry Chagin [Mon, 7 Jun 2021 02:04:42 +0000 (05:04 +0300)]
linux(4): Implement clock_gettime64 system call.

MFC after: 2 weeks

2 years agoRegen for ('e4bffb80bbc6a2e4b3be89aefcbd5bb2c2fc0ba0') Linux
Dmitry Chagin [Mon, 7 Jun 2021 01:56:58 +0000 (04:56 +0300)]
Regen for ('e4bffb80bbc6a2e4b3be89aefcbd5bb2c2fc0ba0') Linux
utimensat_time64 syscall.

MFC after: 2 weeks

2 years agolinux(4): Implement utimensat_time64 system call.
Dmitry Chagin [Mon, 7 Jun 2021 01:54:30 +0000 (04:54 +0300)]
linux(4): Implement utimensat_time64 system call.

MFC after: 2 weeks

2 years agolinux(4): add struct timespec64 definition and conversion routine for
Dmitry Chagin [Mon, 7 Jun 2021 01:47:12 +0000 (04:47 +0300)]
linux(4): add struct timespec64 definition and conversion routine for
future use.

MFC after: 2 weeks

2 years agopowerpc64le/pmap: Fix superpage promotions
Justin Hibbits [Sun, 6 Jun 2021 02:45:15 +0000 (21:45 -0500)]
powerpc64le/pmap: Fix superpage promotions

The page table is always big endian.  Without byte swapping on LE, the
promotion ability checks were invalid, and superpage promotions always
failed.

2 years agoAdd a generic mechanism for preventing forced unmount
Jason A. Harmening [Mon, 17 May 2021 22:47:27 +0000 (15:47 -0700)]
Add a generic mechanism for preventing forced unmount

This is aimed at preventing stacked filesystems like nullfs and unionfs
from "losing" their lower mounts due to forced unmount.  Otherwise,
VFS operations that are passed through to the lower filesystem(s) may
crash or otherwise cause unpredictable behavior.

Introduce two new functions: vfs_pin_from_vp() and vfs_unpin().
which are intended to be called on the lower mount(s) when the stacked
filesystem is mounted and unmounted, respectively.
Much as registration in the mnt_uppers list previously did, pinning
will prevent even forced unmount of the lower FS and will allow the
stacked FS to freely operate on the lower mount either by direct
use of the struct mount* or indirect use through a properly-referenced
vnode's v_mount field.

vfs_pin_from_vp() is modeled after vfs_ref_from_vp() in that it uses
the mount interlock coupled with re-checking vp->v_mount to ensure
that it will fail in the face of a pending unmount request, even if
the concurrent unmount fully completes.

Adopt these new functions in both nullfs and unionfs.

Reviewed By: kib, markj
Differential Revision: https://reviews.freebsd.org/D30401

2 years agonfsd: Fix when NFSERR_WRONGSEC may be replied to NFSv4 clients
Rick Macklem [Sat, 5 Jun 2021 23:53:07 +0000 (16:53 -0700)]
nfsd: Fix when NFSERR_WRONGSEC may be replied to NFSv4 clients

Commit d224f05fcfc1 pre-parsed the next operation number for
the put file handle operations.  This patch uses this next
operation number, plus the type of the file handle being set by
the put file handle operation, to implement the rules in RFC5661
Sec. 2.6 with respect to replying NFSERR_WRONGSEC.

This patch also adds a check to see if NFSERR_WRONGSEC should be
replied when about to perform Lookup, Lookupp or Open with a file
name component, so that the NFSERR_WRONGSEC reply is done for
these operations, as required by RFC5661 Sec. 2.6.

This patch does not have any practical effect for the FreeBSD NFSv4
client and I believe that the same is true for the Linux client,
since NFSERR_WRONGSEC is considered a fatal error at this time.

MFC after: 2 weeks

2 years agoarm64/rk805: remove RTC Set logging
Bjoern A. Zeeb [Thu, 20 May 2021 16:40:10 +0000 (16:40 +0000)]
arm64/rk805: remove RTC Set logging

When ntpd is synchronizing the system time, it also periodically (30m)
syncs the the RTC time.  Remove printf in rk805_settime which triggers
every 30m, as settime_task_func() will log errors under bootverbose.
We leave the RTC Read logging, which should happen only once at boot.

Commit message by: imp
Reviewed by: manu, imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D30361