]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoRestore the '-q' flag to the 'git pull' command.
gjb [Sat, 29 Aug 2020 21:46:34 +0000 (21:46 +0000)]
Restore the '-q' flag to the 'git pull' command.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoRemove the VCSUPDATE command, because git is too stupid to have
gjb [Sat, 29 Aug 2020 21:42:59 +0000 (21:42 +0000)]
Remove the VCSUPDATE command, because git is too stupid to have
the '-C <directory>' after the subcommand.

Meanwhile, hard-code 'git -C <...> pull' for now.

Reported by: Michael Butler
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agozalloc_malloc:Free hexdump preceeding buffer when we detect overflow
sjg [Sat, 29 Aug 2020 21:05:43 +0000 (21:05 +0000)]
zalloc_malloc:Free hexdump preceeding buffer when we detect overflow

Move hexdump from stand/common/misc.c to stand/libsa/hexdump.c
(svn cp)
Disable use of pager - causes linking issue for boot1
can be re-enabled by defining HEXDUMP_PAGER.

Reviewed by: stevek, imp
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D26235

3 years agoLinuxKPI: Implement ksize() function.
wulf [Sat, 29 Aug 2020 19:26:31 +0000 (19:26 +0000)]
LinuxKPI: Implement ksize() function.

In Linux, ksize() gets the actual amount of memory allocated for a given
object. This commit adds malloc_usable_size() to FreeBSD KPI which does
the same. It also maps LinuxKPI ksize() to newly created function.

ksize() function is used by drm-kmod.

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

3 years agoRefine the VCSUPDATE logic further:
gjb [Sat, 29 Aug 2020 16:04:02 +0000 (16:04 +0000)]
Refine the VCSUPDATE logic further:
- Look for the .git directory instead of top-level directory.
- Use 'git -C' instead of cd(1).

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoAdd a VCSUPDATE command to run 'git pull' instead of 'git clone'
gjb [Sat, 29 Aug 2020 15:50:27 +0000 (15:50 +0000)]
Add a VCSUPDATE command to run 'git pull' instead of 'git clone'
if the tree already exists.

Reported by: Michael Butler
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoIndentation fixes. No functional changes.
gjb [Sat, 29 Aug 2020 15:31:23 +0000 (15:31 +0000)]
Indentation fixes.  No functional changes.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoAvoid the build from falling over if devel/git is not installed
gjb [Sat, 29 Aug 2020 15:30:21 +0000 (15:30 +0000)]
Avoid the build from falling over if devel/git is not installed
on the system.  Set a null branch/hash in this case, to avoid
undefined GITREV/GITBRANCH variables from falling over in other
areas.

Reported by: many
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoInstall devel/git from packages if NOPORTS is set in the release.sh
gjb [Sat, 29 Aug 2020 15:13:07 +0000 (15:13 +0000)]
Install devel/git from packages if NOPORTS is set in the release.sh
configuration file.

Reported by: Michael Butler
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoRevert uma zone alignemnt cache unadvertenly committed in r364950.
melifaro [Sat, 29 Aug 2020 12:04:13 +0000 (12:04 +0000)]
Revert uma zone alignemnt cache unadvertenly committed in r364950.

3 years agoWe don't need to INCLUDENUL, so turn it off to avoid assertion...
imp [Sat, 29 Aug 2020 11:46:50 +0000 (11:46 +0000)]
We don't need to INCLUDENUL, so turn it off to avoid assertion...

sbuf_new_for_sysctl turns on INCLUDENUL, but we don't need it. And we assert for
it in the new bus_pnpinfo_sb and bus_location_sb strings.

3 years agoFix arm64 build after r364927
manu [Sat, 29 Aug 2020 11:39:53 +0000 (11:39 +0000)]
Fix arm64 build after r364927

Reported by: jenkins, dch
Pointy hat to: manu

3 years agoUse sbuf_cat instead of sbuf_cpy
imp [Sat, 29 Aug 2020 11:18:10 +0000 (11:18 +0000)]
Use sbuf_cat instead of sbuf_cpy

sbuf_cpy doesn't work with sysctl sbufs because of the drain function.

3 years agoFix build with RADIX_MPATH.
melifaro [Sat, 29 Aug 2020 11:04:24 +0000 (11:04 +0000)]
Fix build with RADIX_MPATH.

Reported by: Hartmann, O <ohartmann@walstatt.org>

3 years agoAvoid NULL pointer dereferences
imp [Sat, 29 Aug 2020 09:59:52 +0000 (09:59 +0000)]
Avoid NULL pointer dereferences

Add back NULL pointer checks accidentally dropped in r364946. We need
to append a NUL character when that happens.

3 years agoMove to using sbuf for some sysctl in newbus
imp [Sat, 29 Aug 2020 04:30:12 +0000 (04:30 +0000)]
Move to using sbuf for some sysctl in newbus

Convert two different sysctl to using sbuf. First, for all the default
sysctls we implement for each device driver that's attached. This is a
pure sbuf conversion.

Second, convert sysctl_devices to fill its buffer with sbuf rather
than a hand-rolled crappy thing I wrote years ago.

Reviewed by: cem, markj
Differential Revision: https://reviews.freebsd.org/D26206

3 years agoRetire devctl_notify_f()
imp [Sat, 29 Aug 2020 04:30:06 +0000 (04:30 +0000)]
Retire devctl_notify_f()

devctl_notify_f isn't needed, so retire it. The flags argument is now
unused, so rather than keep it around, retire it. Convert all old
users of it to devctl_notify(). This path no longer sleeps, so is safe
to call from any context. Since it doesn't sleep, it doesn't need to
know if it is OK to sleep or not.

Reviewed by: markj@
Differential Revision: https://reviews.freebsd.org/D26140

3 years agodevctl: move to using a uma zone
imp [Sat, 29 Aug 2020 04:29:53 +0000 (04:29 +0000)]
devctl: move to using a uma zone

Convert the memory management of devctl.  Rewrite if to make better
use of memory. This eliminates several mallocs (5? worse case) needed
to send a message. It's now possible to always send a message, though
if things are really backed up the oldest message will be dropped to
free up space for the newest.

Add a static bus_child_{location,pnpinfo}_sb to start migrating to
sbuf instead of buffer + length. Use it in the new code.  Other code
will be converted later (bus_child_*_str is only used inside of
subr_bus.c, though implemented in ~100 places in the tree).

Reviewed by: markj@
Differential Revision: https://reviews.freebsd.org/D26140

3 years agocarrot: update bundle
kevans [Sat, 29 Aug 2020 02:46:25 +0000 (02:46 +0000)]
carrot: update bundle

Stats:
- Seven (7) removed
- Four (4) added

MFC after: 3 days

3 years agoMove fib_rte_to_nh_flags() from net/route_var.h to net/route/nhop_ctl.c.
melifaro [Fri, 28 Aug 2020 23:01:56 +0000 (23:01 +0000)]
Move fib_rte_to_nh_flags() from net/route_var.h to net/route/nhop_ctl.c.

No functional changes.
Initially this function was created to perform runtime flag conversions
 for the previous incarnation of fib lookup functions. As these functions
 got deprecated, move the function to the file with the only remaining
 caller. Lastly, rename it to convert_rt_to_nh_flags() to follow the
 naming notation.

3 years agoMove net/route/shared.h definitions to net/route/route_var.h.
melifaro [Fri, 28 Aug 2020 22:50:20 +0000 (22:50 +0000)]
Move net/route/shared.h definitions to net/route/route_var.h.

No functional changes.

net/route/shared.h was created in the inital phases of nexthop conversion.
It was intended to serve the same purpose as route_var.h - share definitions
 of functions and structures between the routing subsystem components. At
 that time route_var.h was included by many files external to the routing
 subsystem, which largerly defeats its purpose.

As currently this is not the case anymore and amount of route_var.h includes
 is roughly the same as shared.h, retire the latter in favour of the former.

3 years agoFurther split nhop creation and rtable operations.
melifaro [Fri, 28 Aug 2020 21:59:10 +0000 (21:59 +0000)]
Further split nhop creation and rtable operations.

As nexthops are immutable, some operations such as route attribute changes
 require nexthop fetching, forking, modification and route switching.
These operations are not atomic, so they may need to be retried multiple
 times in presence of multiple speakers changing the same route.

This change introduces "synchronisation" primitive: route_update_conditional(),
 simplifying logic for route changes and upcoming multipath operations.

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

3 years agoFix a regression with the explicit EOR mode I introduced in r364268.
tuexen [Fri, 28 Aug 2020 20:05:18 +0000 (20:05 +0000)]
Fix a regression with the explicit EOR mode I introduced in r364268.
A short MFC time as discussed with the secteam.

Reported by: Taylor Brandstetter
MFC after: 1 day

3 years agolib: add libnetmap
vmaffione [Fri, 28 Aug 2020 20:03:54 +0000 (20:03 +0000)]
lib: add libnetmap

This changeset introduces the new libnetmap library for writing
netmap applications.
Before libnetmap, applications could either use the kernel API
directly (e.g. NIOCREGIF/NIOCCTRL) or the simple header-only-library
netmap_user.h (e.g. nm_open(), nm_close(), nm_mmap() etc.)

The new library offers more functionalities than netmap_user.h:
  - Support for complex netmap options, such as external memory
    allocators or per-buffer offsets. This opens the way to future
    extensions.
  - More flexibility in the netmap port bind options, such as
    non-numeric names for pipes, or the ability to specify the netmap
    allocator that must be used for a given port.
  - Automatic tracking of the netmap memory regions in use across the
    open ports.

At the moment there is no man page, but the libnetmap.h header file
has in-depth documentation.

Reviewed by: hrs
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D26171

3 years agovm_pageout_scan_active: ensure ps_delta is initialized
vangyzen [Fri, 28 Aug 2020 19:59:02 +0000 (19:59 +0000)]
vm_pageout_scan_active: ensure ps_delta is initialized

Reported by: Coverity
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26212

3 years agomemstat_kvm_uma: fix reading of uma_zone_domain structures
vangyzen [Fri, 28 Aug 2020 19:50:40 +0000 (19:50 +0000)]
memstat_kvm_uma: fix reading of uma_zone_domain structures

Coverity flagged the scaling by sizeof(uzd).  That is the type
of the pointer, so the scaling was already done by pointer arithmetic.
However, this was also passing a stack frame pointer to kvm_read,
so it was doubly wrong.

Move ZDOM_GET into the !_KERNEL section and use it in libmemstat.

Reported by: Coverity
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D26213

3 years agoAllow slow USB devices to be given more time to return their USB descriptors,
hselasky [Fri, 28 Aug 2020 19:21:11 +0000 (19:21 +0000)]
Allow slow USB devices to be given more time to return their USB descriptors,
like Logitech HD Pro Webcam C920.

PR: 248926
MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agoZFS: add to arm64 NOTES to minimize potential for missing symbols
mmacy [Fri, 28 Aug 2020 19:02:05 +0000 (19:02 +0000)]
ZFS: add to arm64 NOTES to minimize potential for missing symbols

3 years agoZFS: MFV 2.0-rc1-ga00c61
mmacy [Fri, 28 Aug 2020 18:53:45 +0000 (18:53 +0000)]
ZFS: MFV 2.0-rc1-ga00c61

3 years agoupdate vendor openzfs to a00c61 (2.0-rc1)
mmacy [Fri, 28 Aug 2020 18:41:28 +0000 (18:41 +0000)]
update vendor openzfs to a00c61 (2.0-rc1)

3 years agoarm: allwinner: clk: Add printfs when we cannot set the correct freq
manu [Fri, 28 Aug 2020 18:25:45 +0000 (18:25 +0000)]
arm: allwinner: clk: Add printfs when we cannot set the correct freq

For some unknown reason this seems to fix this function when we printf
the best variable. This isn't a delay problem as doing a printf without
it doesn't solve this problem.
This is way above my pay grade so add some printf that shouldn't be printed
in 99% of the case anyway.
Fix booting on most Allwinner boards as the mmc IP uses a NM clock.

Reported by: Alexander Mishin <mishin@mh.net.ru>
MFC after: 3 days
X-MFC-With: 363887

3 years agoTreat the boot loader as the same as the kernel for what's visible
imp [Fri, 28 Aug 2020 17:55:54 +0000 (17:55 +0000)]
Treat the boot loader as the same as the kernel for what's visible

The boot loader will be growing some (limited) support for some kernel
interfaces for some of the timekeeping routines to support zstd code.
Allow the declarations for them to be visible when compiling for the
boot loader, rather than treating it like a user-space environment
(which stand.h already provides to a limited degree).

3 years agoAllow the pseudo-errnos to be returned as well in boot loader
imp [Fri, 28 Aug 2020 17:49:56 +0000 (17:49 +0000)]
Allow the pseudo-errnos to be returned as well in boot loader

Expose the pseudo-errno values in _STANDALONE is defined so that code
in the boot loader can make use of them. Nothing uses them today, but
the zstd support that's coming will need them.

3 years agoCreate CFLAGS_EARLY.file for boot loader.
imp [Fri, 28 Aug 2020 17:36:14 +0000 (17:36 +0000)]
Create CFLAGS_EARLY.file for boot loader.

Some external code requires a specific set of include paths to work
properly since it emulates the typical environment the code is used
in. Enable this by creating a CFLAGS_EARLY.file variable that can be
used to build this stack. Otherwise the include stack we build for
stand programs may get in the way. Code that uses this feature has to
tolerate the normal stack of inclues being last on the list (and
presumably unused), though.

Generally, it it should only be used for the specific include
directories. Defines and that sort of thing should be done in the
normal CFLAGS variable. There is a global CFLAGS_EARY hook as well for
everything in a Makefile.

3 years agoZFS: clarify dependencies for static linking
mmacy [Fri, 28 Aug 2020 17:06:35 +0000 (17:06 +0000)]
ZFS: clarify dependencies for static linking

3 years agoUpdate outdated comment
imp [Fri, 28 Aug 2020 17:05:06 +0000 (17:05 +0000)]
Update outdated comment

There is no splnet anymore, so update the comment to drop references
to it.

3 years agoRemove splclock(). It's not useful to keep.
imp [Fri, 28 Aug 2020 16:40:33 +0000 (16:40 +0000)]
Remove splclock(). It's not useful to keep.

splclock is used in one driver (spkr) to control access to
timer_spkr_* routines.  However, nothing else does. So it shows no
useful locking info to someone that would want to lock spkr.

NOTE: I think there's races with timer_spkr_{acquire,release} since
there's no interlock in those routines, despite there being a spin
lock to protect the clock. Current other users appear to use no extra
locking protocol, though they themselves appear to be at least
attempting to make sure that only a single thread calls these
routines. I suspect the right answer is to update these routines to
take/release the clock spin lock since they are short and to the
point, but that's beyond the scope of this commit.

3 years agosh: Keep ignored SIGINT/SIGQUIT after set in a background job
jilles [Fri, 28 Aug 2020 15:35:45 +0000 (15:35 +0000)]
sh: Keep ignored SIGINT/SIGQUIT after set in a background job

If job control is not enabled, a background job (... &) ignores SIGINT and
SIGQUIT, but this can be reverted using the trap builtin in the same shell
environment.

Using the set builtin to change options would also revert SIGINT and SIGQUIT
to their previous dispositions.

This broke due to r317298. Calling setsignal() reverts the effect of
ignoresig().

Reported by: bdrewery
MFC after: 1 week

3 years agoremove splbio and splcam
imp [Fri, 28 Aug 2020 15:09:43 +0000 (15:09 +0000)]
remove splbio and splcam

splbio and splcan have been completely removed from the tree. We can
now remove their definitions here. They've been nops for a long time
and were only preserved to give hints on how to lock drivers. All
drivers have been deleted or converted, so they can be deleted now.

3 years agoDeclare time()
imp [Fri, 28 Aug 2020 05:40:02 +0000 (05:40 +0000)]
Declare time()

Time is used and was accidentally brought in through header
pollution. Declare it in stand.h directly instead.

3 years agoAdd a new line to force a commit to verify if lwhsu did indeed
gjb [Fri, 28 Aug 2020 02:09:10 +0000 (02:09 +0000)]
Add a new line to force a commit to verify if lwhsu did indeed
fix the jenkins build by adding git to the dependency list.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoAdd flags to enable NFS over TLS to the NFS client and server.
rmacklem [Thu, 27 Aug 2020 23:57:30 +0000 (23:57 +0000)]
Add flags to enable NFS over TLS to the NFS client and server.

An Internet Draft titled "Towards Remote Procedure Call Encryption By Default"
(soon to be an RFC I think) describes how Sun RPC is to use TLS with NFS
as a specific application case.
Various commits prepared the NFS code to use KERN_TLS, mainly enabling use
of ext_pgs mbufs for large RPC messages.
r364475 added TLS support to the kernel RPC.

This commit (which is the final one for kernel changes required to do
NFS over TLS) adds support for three export flags:
MNT_EXTLS - Requires a TLS connection.
MNT_EXTLSCERT - Requires a TLS connection where the client presents a valid
            X.509 certificate during TLS handshake.
MNT_EXTLSCERTUSER - Requires a TLS connection where the client presents a
            valid X.509 certificate with "user@domain" in the otherName
            field of the SubjectAltName during TLS handshake.
Without these export options, clients are permitted, but not required, to
use TLS.

For the client, a new nmount(2) option called "tls" makes the client do
a STARTTLS Null RPC and TLS handshake for all TCP connections used for the
mount. The CLSET_TLS client control option is used to indicate to the kernel RPC
that this should be done.

Unless the above export flags or "tls" option is used, semantics should
not change for the NFS client nor server.

For NFS over TLS to work, the userspace daemons rpctlscd(8) { for client }
or rpctlssd(8) daemon { for server } must be running.

3 years agoAdd a comment to clarify when and why cached names are deleted
mckusick [Thu, 27 Aug 2020 22:14:58 +0000 (22:14 +0000)]
Add a comment to clarify when and why cached names are deleted
during pathname lookup.

Reviewed by:  kib
MFC after:    3 days
Sponsored by: Netflix

3 years agoZFS: remove duplicate "com.datto:encryption" from loader
mmacy [Thu, 27 Aug 2020 21:37:35 +0000 (21:37 +0000)]
ZFS: remove duplicate "com.datto:encryption" from loader

3 years agoMerge the projects/release-git branch to head.
gjb [Thu, 27 Aug 2020 21:19:16 +0000 (21:19 +0000)]
Merge the projects/release-git branch to head.
This allows building 13.x from Git instead of Subversion.

No MFC to stable branches is planned at this time. [1]

Discussed with: git working group [1]
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoMFH
gjb [Thu, 27 Aug 2020 20:25:33 +0000 (20:25 +0000)]
MFH

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoFix tiny style nit.
imp [Thu, 27 Aug 2020 17:46:13 +0000 (17:46 +0000)]
Fix tiny style nit.

3 years agoFix writing of the final block of encrypted, compressed kernel dumps.
markj [Thu, 27 Aug 2020 17:36:06 +0000 (17:36 +0000)]
Fix writing of the final block of encrypted, compressed kernel dumps.

Previously any residual data in the final block of a compressed kernel
dump would be written unencrypted.  Note, such a configuration already
does not work properly when using AES-CBC since the compressed data is
typically not a multiple of the AES block length in size and EKCD does
not implement any padding scheme.  However, EKCD more recently gained
support for using the ChaCha20 cipher, which being a stream cipher does
not have this problem.

Submitted by: sigsys@gmail.com
Reviewed by: cem
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26188

3 years agoAdd note about NO_CLEAN build.
imp [Thu, 27 Aug 2020 17:30:57 +0000 (17:30 +0000)]
Add note about NO_CLEAN build.

NO_CLEAN doesn't quite work for some scenarios when rebuilding older
kernels, but the kernels build w/o NO_CLEAN.

3 years agoDisregard jails in jail.conf that have bad parameters (parameter/variable
jamie [Thu, 27 Aug 2020 17:04:55 +0000 (17:04 +0000)]
Disregard jails in jail.conf that have bad parameters (parameter/variable
clash, or redefining name/jid).  The current behvaior, of merely warning
and moving on, can lead to unexpected behavior when a jail is created
without the offending parameter defined at all.

3 years agosnd_ich(4): Handle errors from ich_init() properly during resume.
markj [Thu, 27 Aug 2020 16:36:07 +0000 (16:36 +0000)]
snd_ich(4): Handle errors from ich_init() properly during resume.

ich_init() returns an errno value or 0, but ich_pci_resume() was
comparing the return value with -1 to determine whether an error had
occurred.

PR: 248941
Submitted by: Tong Zhang <ztong0001@gmail.com>
MFC after: 1 week

3 years agofdc(4): Handle errors from fdc_in() properly.
markj [Thu, 27 Aug 2020 16:34:33 +0000 (16:34 +0000)]
fdc(4): Handle errors from fdc_in() properly.

fdc_in() returns only 0 and 1, some callers were checking incorrectly
for failure.

PR: 248940
Submitted by: Tong Zhang <ztong0001@gmail.com>
MFC after: 1 week

3 years agoasmc(4): Handle errors from asmc_key_read() properly.
markj [Thu, 27 Aug 2020 16:34:20 +0000 (16:34 +0000)]
asmc(4): Handle errors from asmc_key_read() properly.

asmc_key_read() returns only 0 and 1, some callers were checking
incorrectly for failure.

PR: 248939
Submitted by: Tong Zhang <ztong0001@gmail.com>
MFC after: 1 week

3 years agoCorrect the conditional evaluating if git exists.
gjb [Thu, 27 Aug 2020 14:36:00 +0000 (14:36 +0000)]
Correct the conditional evaluating if git exists.

Pointyhat to: gjb (myself)
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years ago/etc/zfs/zpool.cache is the preferred (and new) location of zpool.cache.
cy [Thu, 27 Aug 2020 14:33:46 +0000 (14:33 +0000)]
/etc/zfs/zpool.cache is the preferred (and new) location of zpool.cache.
Check for it first. Only use /boot/zfs/zpool.cache if the /etc/zfs
version is not found and good.

Reported by: avg
Suggested by: avg, kevans

3 years agoDo not unconditionally build git from ports if it already exists.
gjb [Thu, 27 Aug 2020 14:29:06 +0000 (14:29 +0000)]
Do not unconditionally build git from ports if it already exists.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoAdjust the logic to locating GIT_CMD.
gjb [Thu, 27 Aug 2020 13:33:21 +0000 (13:33 +0000)]
Adjust the logic to locating GIT_CMD.
Use 'git -C' instead of cd(1). [1]

Suggested by: garga [1]
Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agolibzfs: Also add the crypto dependency to Makefile.inc1
freqlabs [Thu, 27 Aug 2020 13:26:36 +0000 (13:26 +0000)]
libzfs: Also add the crypto dependency to Makefile.inc1

Reported by: kevans
Discussed with: kevans
Sponsored by: iXsystems, Inc.

3 years agoFix passing OPTIONS_UNSET with multiple options to make(1).
gjb [Thu, 27 Aug 2020 13:25:24 +0000 (13:25 +0000)]
Fix passing OPTIONS_UNSET with multiple options to make(1).
While here, adjust the copyright.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agolibzfs: Add missing crypto dependency
freqlabs [Thu, 27 Aug 2020 13:05:41 +0000 (13:05 +0000)]
libzfs: Add missing crypto dependency

libzfs_crypto.c uses PKCS5_PBKDF2_HMAC_SHA1 from libcrypto.

Reported by: John Kennedy
Sponsored by: iXsystems, Inc.

3 years agoImplement extensible arrays API using the existing radix tree implementation
hselasky [Thu, 27 Aug 2020 10:28:12 +0000 (10:28 +0000)]
Implement extensible arrays API using the existing radix tree implementation
in the LinuxKPI.

Differential Revision: https://reviews.freebsd.org/D25101
Reviewed by: kib @
MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agoarm: ti: Fix Beaglebone black MMC after DTS update
manu [Thu, 27 Aug 2020 08:08:49 +0000 (08:08 +0000)]
arm: ti: Fix Beaglebone black MMC after DTS update

After DTS sync with Linux kernel 5.8 this patch was included:
"ARM: dts: Move am33xx and am43xx mmc nodes to sdhci-omap driver"
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/am33xx-l4.dtsi?h=v5.9-rc2&id=0b4edf111870b83ea77b1d7e16b8ceac29f9f388

Current will not load any driver for MMC and not mount the rootfs.
Simple patch add "ti,am335-sdhci" to compability strings in ti_sdhci.c

Submitted by: oskar.holmlund@ohdata.se
Reported by: phk
X-MFC-With: 363853

3 years agocache: don't update timestmaps on found entry
mjg [Thu, 27 Aug 2020 06:31:55 +0000 (06:31 +0000)]
cache: don't update timestmaps on found entry

3 years agocache: assorted clean ups
mjg [Thu, 27 Aug 2020 06:31:27 +0000 (06:31 +0000)]
cache: assorted clean ups

In particular remove spurious comments, duplicate assertions and the
inconsistently done KTR support.

3 years agocache: ncp = NULL early to account for sdt probes in ailure path
mjg [Thu, 27 Aug 2020 06:30:40 +0000 (06:30 +0000)]
cache: ncp = NULL early to account for sdt probes in ailure path

CID: 1432106

3 years agoImplement FLUSHO
imp [Thu, 27 Aug 2020 05:11:15 +0000 (05:11 +0000)]
Implement FLUSHO

Turn FLUSHO on/off with ^O (or whatever VDISCARD is). Honor that to
throw away output quickly. This tries to remain true to 4.4BSD
behavior (since that was the origin of this feature), with any
corrections NetBSD has done. Since the implemenations are a little
different, though, some edge conditions may be handled differently.

Reviewed by: kib, kevans
Differential Review: https://reviews.freebsd.org/D26148

3 years agoUpdate Hong Kong Liberation Day (hah!)
grog [Thu, 27 Aug 2020 03:50:34 +0000 (03:50 +0000)]
Update Hong Kong Liberation Day (hah!)

3 years agoDon't allow jail.conf variables to have the same names as jail parameters.
jamie [Thu, 27 Aug 2020 00:17:17 +0000 (00:17 +0000)]
Don't allow jail.conf variables to have the same names as jail parameters.
It was already not allowed in many cases, but crashed instead of giving an
error.

PR: 248444

3 years agoName the on-stack union of compat thunks.
jhb [Wed, 26 Aug 2020 22:36:08 +0000 (22:36 +0000)]
Name the on-stack union of compat thunks.

C does not permit an anonymous union at a top-level scope.

Pointy hat to: jhb

3 years agoFix a "v_seqc_users == 0 not met" panic when VFS_STATFS() fails during mount.
rmacklem [Wed, 26 Aug 2020 21:49:43 +0000 (21:49 +0000)]
Fix a "v_seqc_users == 0 not met" panic when VFS_STATFS() fails during mount.

r363210 introduced v_seqc_users to the vnodes.  This change requires
a vn_seqc_write_end() to match the vn_seqc_write_begin() in
vfs_cache_root_clear().
mjg@ provided this patch which seems to fix the panic.

Tested for an NFS mount where the VFS_STATFS() call will fail.

Submitted by: mjg
Reviewed by: mjg
Differential Revision: https://reviews.freebsd.org/D26160

3 years agoAdd freebsd32 compat support for CIOCCRYPTAEAD.
jhb [Wed, 26 Aug 2020 21:28:47 +0000 (21:28 +0000)]
Add freebsd32 compat support for CIOCCRYPTAEAD.

Reviewed by: markj (earlier version)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D26179

3 years agoSimplify compat shims for /dev/crypto.
jhb [Wed, 26 Aug 2020 21:17:18 +0000 (21:17 +0000)]
Simplify compat shims for /dev/crypto.

- Make session handling always use the CIOGSESSION2 structure.
  CIOGSESSION requests use a thunk similar to COMPAT_FREEBSD32 session
  requests.  This permits the ioctl handler to use the 'crid' field
  unconditionally.

- Move COMPAT_FREEBSD32 handling out of the main ioctl handler body
  and instead do conversions in/out of thunk structures in dedicated
  blocks at the start and end of the ioctl function.

Reviewed by: markj (earlier version)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D26178

3 years agofuse: unbreak after r364814
mjg [Wed, 26 Aug 2020 21:13:36 +0000 (21:13 +0000)]
fuse: unbreak after r364814

Reported by: kevans

3 years agoAdd MNT_EXTLSxxx flags that will be used for NFS over TLS exports.
rmacklem [Wed, 26 Aug 2020 20:56:05 +0000 (20:56 +0000)]
Add MNT_EXTLSxxx flags that will be used for NFS over TLS exports.

These flags are not currently used, but will be used by future commits to
implement export(5) requirements for the use of NFS over TLS by clients.

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

3 years agoTo avoid breakage for those who build/install without ZFS only
cy [Wed, 26 Aug 2020 20:30:00 +0000 (20:30 +0000)]
To avoid breakage for those who build/install without ZFS only
rely on rc.d/zpool's BEFORE specification.

Reported by: rpokala

3 years agoEach entry in UPDATING needs a date
imp [Wed, 26 Aug 2020 19:32:28 +0000 (19:32 +0000)]
Each entry in UPDATING needs a date

It's rare for there to be two updating entries on the same day (once a
decade or so), but we have that here. Add the date to the second one
since devd and zfs are unrelated.

3 years ago[PowerPC] Fix build failure in sec.c
bdragon [Wed, 26 Aug 2020 19:30:42 +0000 (19:30 +0000)]
[PowerPC] Fix build failure in sec.c

Fix a typo in r364799 that was breaking powerpc and powerpcspe build.

MFC with: 364799

3 years agoRemove whitespace which accidentaly snuck into r364831.
cperciva [Wed, 26 Aug 2020 19:28:30 +0000 (19:28 +0000)]
Remove whitespace which accidentaly snuck into r364831.

3 years agoAdd -w option to lockf(1).
cperciva [Wed, 26 Aug 2020 19:26:48 +0000 (19:26 +0000)]
Add -w option to lockf(1).

By default, lockf(1) opens its lock file O_RDONLY|O_EXLOCK.  On NFS, if the
file already exists, this is split into opening the file read-only and then
requesting an exclusive lock -- and the second step fails because NFS does
not permit exclusive locking on files which are opened read-only.

The new -w option changes the open flags to O_WRONLY|O_EXLOCK, allowing it
to work on NFS -- at the cost of not working if the file cannot be opened
for writing.

(Whether the traditional BSD behaviour of allowing exclusive locks to be
obtained on a file which cannot be opened for writing is a good idea is
perhaps questionable since it may allow less-privileged users to perform
a local denial of service; however this behaviour has been present for a
long time and changing it now seems like it would cause problems.)

Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D26005

3 years agoMove zstd sources from libzfs to libzpool
freqlabs [Wed, 26 Aug 2020 19:03:15 +0000 (19:03 +0000)]
Move zstd sources from libzfs to libzpool

zstd is kernel code that was not supposed to be in libzfs.

libzpool provides userland shims for kernel code and is where the
zstd code needs to be included.

Reported by: John Kennedy
Discussed with: mmacy
Sponsored by: iXsystems, Inc.

3 years agoTidy up libzpool Makefile
freqlabs [Wed, 26 Aug 2020 19:00:17 +0000 (19:00 +0000)]
Tidy up libzpool Makefile

Sponsored by: iXsystems, Inc.

3 years agoBack out r364791 to unbreak jails. Lesson learned: "compile and test" means
jamie [Wed, 26 Aug 2020 18:35:32 +0000 (18:35 +0000)]
Back out r364791 to unbreak jails.  Lesson learned: "compile and test" means
running the test on the same executable that you just compiled.

PR: 248444
Pointy hat to: jamie

3 years agolibsa: only skein_block.c is using SKEIN_LOOP
tsoome [Wed, 26 Aug 2020 17:52:32 +0000 (17:52 +0000)]
libsa: only skein_block.c is using SKEIN_LOOP

Only use SKEIN_LOOP while compiling skein_block.c

3 years agoMake sbuf_setpos match the implementation.
imp [Wed, 26 Aug 2020 17:06:16 +0000 (17:06 +0000)]
Make sbuf_setpos match the implementation.

sbuf_setpos can only be used to truncate the buffer, never to make it
longer. Update the documentation to reflect this.

Reviewed By: allanjude, phk
Differential Revision: https://reviews.freebsd.org/D26198

3 years agoRegen X86 assembly files after r364822.
jkim [Wed, 26 Aug 2020 16:56:44 +0000 (16:56 +0000)]
Regen X86 assembly files after r364822.

3 years agoFix Clang version detection.
jkim [Wed, 26 Aug 2020 16:55:28 +0000 (16:55 +0000)]
Fix Clang version detection.

We prepend "FreeBSD" to Clang version string.  This broke compiler test for
AVX instruction support.

Reported by: jhb

3 years agoInstall zfs-events.5
freqlabs [Wed, 26 Aug 2020 15:43:44 +0000 (15:43 +0000)]
Install zfs-events.5

Sponsored by: iXsystems, Inc.

3 years agoUse a large kmem arena import size on NUMA systems.
markj [Wed, 26 Aug 2020 14:31:48 +0000 (14:31 +0000)]
Use a large kmem arena import size on NUMA systems.

This helps minimize internal fragmentation that occurs when 2MB imports
are interleaved across NUMA domains.  Virtually all KVA allocations on
direct map platforms consume more than one page, so the fragmentation
manifests as runs of 511 4KB page mappings in the kernel.

Reviewed by: alc, kib
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26050

3 years agovmem: Avoid allocating span tags when segments are never released.
markj [Wed, 26 Aug 2020 14:31:35 +0000 (14:31 +0000)]
vmem: Avoid allocating span tags when segments are never released.

vmem uses span tags to delimit imported segments, so that they can be
released if the segment becomes free in the future.  However, the
per-domain kernel KVA arenas never release resources, so the span tags
between imported ranges are unused when the ranges are contiguous.
Furthermore, such span tags prevent coalescing of free segments across
KVA_QUANTUM boundaries, resulting in internal fragmentation which
inhibits superpage promotion in the kernel map.

Stop allocating span tags in arenas that never release resources.  This
saves a small amount of memory and allows free segements to coalesce
across import boundaries.  This manifests as improved kernel superpage
usage during poudriere runs, which also helps to reduce physical memory
fragmentation by reducing the number of broken partially populated
reservations.

Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24548

3 years agoefibootmgr: wrong check for opts.order
tsoome [Wed, 26 Aug 2020 14:02:38 +0000 (14:02 +0000)]
efibootmgr: wrong check for opts.order

opts.order && !(opts.order) does not really make sense.

Reported by: swildner

3 years agoAs of r364746 (OpenZFS import) existing ZPOOLs are not imported
cy [Wed, 26 Aug 2020 13:13:57 +0000 (13:13 +0000)]
As of r364746 (OpenZFS import) existing ZPOOLs are not imported
prior to zvol and mountcritlocal resulting in ZVOLs (swap and
virtual machine UFS filesystems) being unavailable, leading to
boot failures.

We move the zpool import from zfs to a new zpool script, with the
-N option to avoid mounting datasets while making the ZPOOL's
datasets available for "legacy" mount (mountpoint=legacy) and ZVOLs
available for subsequent use for swap (in the zvol rc sript) or
for UFS or other filesystems in fstab(5), mounted by mountcritlocal.

Reviewed by: freqlabs (previous version)
Differential Revision: https://reviews.freebsd.org/D26185

3 years agocache: relock on failure in cache_zap_locked_vnode
mjg [Wed, 26 Aug 2020 12:54:18 +0000 (12:54 +0000)]
cache: relock on failure in cache_zap_locked_vnode

This gets rid of bogus scheme of yielding in hopes the blocking thread will
make progress.

3 years agocache: stop null checking in cache_free
mjg [Wed, 26 Aug 2020 12:53:16 +0000 (12:53 +0000)]
cache: stop null checking in cache_free

3 years agocache: make it mandatory to request both timestamps or neither
mjg [Wed, 26 Aug 2020 12:52:54 +0000 (12:52 +0000)]
cache: make it mandatory to request both timestamps or neither

3 years agocache: convert bucketlocks to a mutex
mjg [Wed, 26 Aug 2020 12:52:17 +0000 (12:52 +0000)]
cache: convert bucketlocks to a mutex

By now bucket locks are almost never taken for anything but writing and
converting to mutex simplifies the code.

3 years agocache: only evict negative entries on CREATE when ISLASTCN is set
mjg [Wed, 26 Aug 2020 12:50:57 +0000 (12:50 +0000)]
cache: only evict negative entries on CREATE when ISLASTCN is set

3 years agocache: decouple smr and locked lookup in the slowpath
mjg [Wed, 26 Aug 2020 12:50:10 +0000 (12:50 +0000)]
cache: decouple smr and locked lookup in the slowpath

Tested by: pho

3 years agocache: factor dotdot lookup out of cache_lookup
mjg [Wed, 26 Aug 2020 12:49:39 +0000 (12:49 +0000)]
cache: factor dotdot lookup out of cache_lookup

Tested by: pho

3 years agoAvoid recomputing COMPILER_/LINKER_ variables when set explicitly
arichardson [Wed, 26 Aug 2020 10:21:38 +0000 (10:21 +0000)]
Avoid recomputing COMPILER_/LINKER_ variables when set explicitly

I noticed that when we build libraries for a different ABI (in CheriBSD) we
were calling ${XCC}/${LD} --version for every directory. It turns out that
this was caused by bsd.compat.mk explicitly setting (X_)COMPILER variables
for that build stage and this stops the _can_export logic from working.
To fix this, we change the check to only set _can_export=no if the variable
is set and it is set to a different value than the cached value.
This noticeably speeds up the tree walk while building compat libraries.
During an upstream amd64 buildworld this also removes 8 --version calls.

Obtained from: CheriBSD
Reviewed By: brooks, emaste
Differential Revision: https://reviews.freebsd.org/D25986

3 years agoMove libsqlite3 to the top of the SUBDIR list
arichardson [Wed, 26 Aug 2020 09:19:49 +0000 (09:19 +0000)]
Move libsqlite3 to the top of the SUBDIR list

In parallel builds, this should allow sqlite to start building earlier and
increase parallelism when building lib/. Looking at htop output during
buildworld/tinderbox, there are long phases where only one CPU is active
optimizing the massive sqlite3.c file since the build of libsqlite3 is
started quite late.

Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D26169