SVNews

NOTE: This service is experimental and subject to change! Use at your own risk!

Year:   Month: - or - Filter committers: - or -
Filter paths:
Include diffs if smaller than lines.

2018 - 02 - 23   (today)
16:06:54 - r329866
( 1 minute ago)
by imp
Affects:  /head/sys/cam/cam_iosched.c
Use bool instead of int for predicate functions relating to work
available.
16:04:44 - r329865
( 3 minutes ago)
by asomers
Affects:  /svnadmin/conf/sizelimit.conf
Add myself to sizelimits, for the ZFS test suite import
11:20:59 - r329864
(4 hours 47 minutes ago)
by kib
Affects:  /head/sys/x86/x86/intr_machdep.c
Do not return out of bound pointers from intr_lookup_source().

This hardens the code against driver and upper level bugs causing
invalid indexes used, e.g. on msi release.

Reported by: gallatin
Reviewed by: gallatin, hselasky
Sponsored by: Mellanox Technologies
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D14470
11:17:16 - r329863
(4 hours 50 minutes ago)
by kib
Affects: 
(2 files)
/stable/11/sys/x86/x86/mp_x86.c
MFC r329416:
Remove unused symbols.
07:43:52 - r329862
(8 hours 24 minutes ago)
by wma
Affects:  /head/sys/powerpc/conf/GENERIC64
powerpc64: add NVMe to GENERIC64

NVMe support is ready and should be compiled-in
to the ppc64 kernel.

Submitted by: Wojciech Macek <wma@semihalf.org>
Obtained from: Semihalf
Sponsored by: IBM, QCM Technologies
04:12:19 - r329861
(11 hours 55 minutes ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
lualoader: Track effective line number, use it for drawing

Takes into account hidden entries, so that we don't draw blank lines in
place of a hidden item.
04:06:15 - r329860
(12 hours 1 minute ago)
by imp
Affects:  /head/stand/defs.mk
Floaty McFloatface is funnier...

Submitted by: emaste@
04:04:25 - r329859
(12 hours 3 minutes ago)
by imp
Affects: 
(13 files)
/head/*
Do not include float interfaces when using libsa.

We don't support float in the boot loaders, so don't include
interfaces for float or double in systems headers. In addition, take
the unusual step of spiking double and float to prevent any more
accidental seepage.
04:04:18 - r329858
(12 hours 3 minutes ago)
by imp
Affects:  /head/contrib/lua/src/llimits.h
/head/contrib/lua/src/lstrlib.c
When the LUA_FLOAT_TYPE != LUA_FLOAT_INT64, we can't reference float
or double so ifdef that code out when the numbers aren't float at all.

There's still references in the lmathlib.c, but we don't compile that
for the loader yet.

Differential Revision: https://reviews.freebsd.org/D14472
04:04:03 - r329857
(12 hours 4 minutes ago)
by imp
Affects:  /head/stand/liblua/Makefile
/head/stand/lua.mk
Centralize lua defines

We need to ensure that we defined Numbers as int64_t everywhere we
build for lua. Previously, we were compiling part of the code with
Numbers as int64_t and part as double. Move lua number definition to a
more-central location
04:03:07 - r329856
(12 hours 4 minutes ago)
by kevans
Affects: 
(5 files)
/head/stand/lua/*
lualoader: Use "local function x()" instead of "local x = function()"

The latter is good, but the former is more elegant and clear about what 'x'
is. Adopt it, preferably only using the latter kind of notation where needed
as values for tables.
03:36:24 - r329855
(12 hours 31 minutes ago)
by davidcs
Affects: 
(13 files)
/head/sys/dev/qlxgbe/*
1. Added support to offline a port if is error recovery on successful.
2. Sysctls to enable/disable driver_state_dump and error_recovery.
3. Sysctl to control the delay between hw/fw reinitialization and
  restarting the fastpath.
4. Stop periodic stats retrieval if interface has IFF_DRV_RUNNING flag off.
5. Print contents of PEG_HALT_STATUS1 and PEG_HALT_STATUS2 on heartbeat
  failure.
6. Speed up slowpath shutdown during error recovery.
7. link_state update using atomic_store.
8. Added timestamp information on driver state and minidump captures.
9. Added support for Slowpath event logging
10.Added additional failure injection types to simulate failures.
03:18:24 - r329854
(12 hours 49 minutes ago)
by kevans
Affects:  /head/stand/lua/core.lua
/head/stand/lua/menu.lua
lualoader: shallowCopyTable => deepCopyTable

I called it a shallow copy, but it wasn't really a shallow copy at all.
03:11:43 - r329853
(12 hours 56 minutes ago)
by asomers
Affects: 
(19 files)
/head/lib/libifconfig/*
/head/share/examples/libifconfig/*
/head/usr.sbin/wlandebug/wlandebug.c
libifconfig: multiple feature additions

Added the ability to:

* Create virtual interfaces
* Create vlan interfaces
* Get interface fib
* Get interface groups
* Get interface status
* Get nd6 info
* Get media status
* Get additional ifaddr info in a convenient struct
* Get vhids
* Get carp info
* Get lagg and laggport status
* Iterate over all interfaces and ifaddrs

And add more examples, too.

Note that this is a backwards-incompatible change. But that's ok, because it's
a private library.

MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D14463
02:53:50 - r329852
(13 hours 14 minutes ago)
by kevans
Affects:  /head/stand/lua/core.lua
Add copyright notice to core.lua

I've also made some not-insignificant changes/additions to this file, to
include the added constants, ACPI changes, boot environment listing, and
some utility functions.
02:51:35 - r329851
(13 hours 16 minutes ago)
by kevans
Affects: 
(9 files)
/head/stand/lua/*
Add SPDX tags to lua files
02:47:51 - r329850
(13 hours 20 minutes ago)
by kevans
Affects:  /head/stand/lua/loader.lua
lualoader: Drop unused return values; we'll only use the first
01:20:14 - r329849
(14 hours 47 minutes ago)
by jeff
Affects: 
(10 files)
/user/jeff/numa/sys/*
By default, round-robin assign interrupts only within the domain that the
device is connected to.
01:11:57 - r329848
(14 hours 56 minutes ago)
by pfg
Affects:  /head/lib/libc/stdio/xprintf_int.c
__printf_render_int(): small type change to match use.

Variable l is consistently used as an int rather than a char.
Sort names while here.

Obtained from: Apple's Libc-1244.30.3
MFC after: 5 days
00:38:42 - r329847
(15 hours 29 minutes ago)
by mav
Affects: 
(2 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
MFC r329091: Add sysctls for dnode block and indirect block shifts.
00:28:00 - r329846
(15 hours 40 minutes ago)
by pfg
Affects:  /head/lib/libc/gen/getpeereid.c
getpeereid(3): Fix behavior on failure to match documentation.

According to the getpeereid(3) documentation, on failure the value -1 is
returned and the global variable errno is set to indicate the error. We
were returning the error instead.

Obtained from: Apple's Libc-1244.30.3
MFC after: 5 days
00:17:50 - r329845
(15 hours 50 minutes ago)
by asomers
Affects: 
(5 files)
/head/usr.sbin/mptutil/*
Fix numerous Coverity issues in mptutil

Most are memory or file descriptor leaks. Three were unannotated
fallthroughs in a switch/case statement. One was an integer overflow before
widen.

Reported by: Coverity
CID: 1007463 1007462 1007461 1007460 1007459 1007458 1007457
CID: 1006855 1006854 1006853 1006852 1006851 1006850 1006849
CID: 1006848 1006845 1006844 1006843 1006842 1006841 1006840
CID: 1006839 1006838 1006837 1006836 1006835 1006834 1006833
CID: 1006832 1006831 1006831 1006830 1006829 1008334 1008170
CID: 1008169 1008168
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11013
00:12:51 - r329844
(15 hours 55 minutes ago)
by truckman
Affects:  /head/sys/kern/sched_ule.c
Decrease latency by not wrapping the idle loop's potentially lengthy
search for a thread to steal inside a critical section. Since this
allows the search to be preempted, restart the search if preemption
happens since the search results found earlier may no longer be
valid.

Decrease the latency of starting a thread that may be assigned to
this CPU during the search by polling for incoming threads during
the search and switching to that thread instead of continuing the
search.

Test for stale search results and restart the search before going
through the expense of calling tdq_lock_pair(). Retry some tests
after grabbing the locks since things may have changed while waiting
to get both locks.

Eliminate special case handling for stealing from an SMT peer that
uses 1 as the steal threshold. This can only succeed if a thread
has been assigned but our SMT peer has not yet started executing
it. This is quite rare and when it happens the other SMT thread
is generally waiting for the same tdq lock that we hold. Basically
both SMT threads are racing to grab the same spin lock.

Add the kern.sched.always_steal knob from a ULE patch by jeff@.

Incorporate another idea from Jeff's ULE patch. If the sched_switch()
detects that the CPU is about to go idle, try to steal a thread
before switching to the idle thread. Since the search for a thread
to steal has to be done inside a critical section in this context,
limit the impact on latency by adding the knob kern.sched.trysteal_limit
to limit the topological distance of the search and don't restart
the search if we detect stale results. If this search can't find
an stealable thread, the idle loop can do a more complete search.
Also poll for threads being assigned to this CPU during the search
and switch to them instead of continuing the search. This change
is responsibile for the majority of the improvement in parallel
buildworld times.

In sched_balance_group() change the minimum threshold from stealing
a thread from 1 to 2. Poaching a newly assigned thread from a CPU
that is waking up hasn't yet switched to that thread from idle is
likely very rare and is likely to have the same lock race as is
seen when stealing threads in the idle loop. Also use tdq_notify()
to kick the destintation CPU instead of always sending an IPI.
Update a stale comment, the number of transferable threads is not
calculated.

Reviewed by: kib (earlier version)
Comments by: avg, jeff, mav
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D12130
2018 - 02 - 22   (yesterday)
23:18:46 - r329843
(16 hours 49 minutes ago)
by rpokala
Affects: 
(10 files)
/head/share/man/man4/*
/head/sys/*
jedec_dimm(4): report asset info and temperatures for DDR3 and DDR4 DIMMs

A super-set of the functionality of jedec_ts(4). jedec_dimm(4) reports asset
information (Part Number, Serial Number) encoded in the "Serial Presence
Detect" (SPD) data on JEDEC DDR3 and DDR4 DIMMs. It also calculates and
reports the memory capacity of the DIMM, in megabytes. If the DIMM includes
a "Thermal Sensor On DIMM" (TSOD), the temperature is also reported.

Reviewed by: cem
MFC after: 1 week
Relnotes: yes
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D14392
Discussed with: avg, cem
Tested by: avg, cem (previous version, no semantic changes)
23:06:39 - r329842
(17 hours 1 minute ago)
by jeff
Affects:  /user/jeff/numa/sys/kern/kern_cpuset.c
/user/jeff/numa/sys/kern/kern_kthread.c
/user/jeff/numa/sys/sys/cpuset.h
Make a dedicated set for the kernel and all kernel threads so we can apply
policy independently.
22:25:26 - r329841
(17 hours 42 minutes ago)
by ian
Affects:  /head/sys/modules/imx/imx_i2c/Makefile
Add a missing line continuation.

How many commits does it take to get a simple module makefile working?
Apparently at least three.

Pointy hat to: ian
22:24:01 - r329840
(17 hours 44 minutes ago)
by asomers
Affects:  /projects/zfsd/head/tests/sys/cddl/zfs/tests/txg_integrity/make_patterns.py
apply PEP8 style to a python helper script

Sponsored by: Spectra Logic Corp
21:41:58 - r329839
(18 hours 26 minutes ago)
by asomers
Affects:  /projects/zfsd/head/etc/mtree/BSD.tests.dist
Fix an mtree error from r329291

Sponsored by: Spectra Logic Corp
20:48:02 - r329838
(19 hours 20 minutes ago)
by hselasky
Affects:  /stable/10/sys/conf/files
Fix for LINT kernel build.

This is a direct commit.

Discussed with: np@
Reported by: rpokala@
Sponsored by: Mellanox Technologies
20:39:25 - r329837
(19 hours 28 minutes ago)
by mjg
Affects:  /head/sys/kern/vfs_bio.c
Fix up sysctl vfs.buffercache broken in r329612

Sample problem:
top: sysctl(vfs.bufspace...) expected 8, got 4

Reported by: O. Hartmann <ohartmann walstatt.org>
20:10:23 - r329836
(19 hours 57 minutes ago)
by kevans
Affects:  /head/stand/lua/config.lua
/head/stand/lua/drawer.lua
/head/stand/lua/menu.lua
lualoader: Attend to some 80-col issues, pointed out by luacheck

Graphics have a tendency to cause 80-col issues, so make an exception to our
standard indentation guidelines for these graphics. This does not hamper
readability too badly.

Two 40-column strings of spaces is trivially replaced with
string.rep(" ", 80)
20:09:21 - r329835
(19 hours 58 minutes ago)
by hselasky
Affects:  /stable/10/sys/ofed/drivers/infiniband/core/addr.c
Fix for LINT-NOINET kernel build.

This is a direct commit.

Reported by: rpokala@
Sponsored by: Mellanox Technologies
19:40:03 - r329834
(20 hours 28 minutes ago)
by rpokala
Affects: 
(2 files)
/stable/10/sys/dev/mxge/if_mxge.c
MFC r329295:

Panasas discovered that ioctl(SIOCGLAGGPORT) returns ENOTTY for mxge(4) when
the NIC is not a member of a lagg. This came as a surprise, because the
SIOCGLAGGPORT handler in if_lagg.c only returns ENOENT (if run against the
laggX interface, rather than a physical port) or EINVAL (if run against a
non-member physical port). This behavior was not seen with other drivers,
such as bge(4), igb(4), and cxl(4). When I compared their respective ioctl
handlers, I found that they all called ether_ioctl() for the default (i.e.
unhandled) case; by contrast, mxge(4) only calls ether_ioctl() for two
specific cases, and returns ENOTTY for the default case.

Remove the two cases which explicitly call ether_ioctl(), and let the
default case call it instead. This matches what the vast majority of the NIC
drivers do.
19:39:44 - r329833
(20 hours 28 minutes ago)
by rpokala
Affects: 
(2 files)
/stable/11/sys/dev/mxge/if_mxge.c
MFC r329295:

Panasas discovered that ioctl(SIOCGLAGGPORT) returns ENOTTY for mxge(4) when
the NIC is not a member of a lagg. This came as a surprise, because the
SIOCGLAGGPORT handler in if_lagg.c only returns ENOENT (if run against the
laggX interface, rather than a physical port) or EINVAL (if run against a
non-member physical port). This behavior was not seen with other drivers,
such as bge(4), igb(4), and cxl(4). When I compared their respective ioctl
handlers, I found that they all called ether_ioctl() for the default (i.e.
unhandled) case; by contrast, mxge(4) only calls ether_ioctl() for two
specific cases, and returns ENOTTY for the default case.

Remove the two cases which explicitly call ether_ioctl(), and let the
default case call it instead. This matches what the vast majority of the NIC
drivers do.
19:12:32 - r329832
(20 hours 55 minutes ago)
by gonzo
Affects: 
(9 files)
/head/share/man/man4/*
/head/sys/*
[chvgpio] add GPIO driver for Intel Z8xxx SoC family

Add chvgpio(4) driver for Intel Z8xxx SoC family. This product
was formerly known as Cherry Trail but Linux and OpenBSD drivers
refer to it as Cherry View. This driver is derived from OpenBSD
one so the name is kept for alignment with another BSD system.

Submitted by: Tom Jones <tj@enoti.me>
Reviewed by: gonzo, wblock(man page)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D13086
18:49:53 - r329831
(21 hours 18 minutes ago)
by kevans
Affects:  /head/stand/userboot/userboot/Makefile
Fix userboot w/ ZFS after r329725

r329725 cleaned up ZFS commands duplicated in multiple places, but userboot
was not setting HAVE_ZFS when MK_ZFS != "no". This resulted in a failure to
boot (as seen in PR 226118) in bhyve, with the following message:

/boot/userboot.so: Undefined symbol "ldi_get_size"

PR: 226118
Glanced at by: imp
17:47:16 - r329830
(22 hours 20 minutes ago)
by asomers
Affects:  /head/sbin/nvmecontrol/identify.c
nvmecontrol: fix build on amd64/clang

Broken by: 329824
Sponsored by: Spectra Logic Corp
17:09:26 - r329829
(22 hours 58 minutes ago)
by vangyzen
Affects:  /head/sys/kern/sched_ule.c
sched_ule: update a comment to reflect reality

MFC after: 3 days
Sponsored by: Dell EMC
16:59:55 - r329828
(23 hours 8 minutes ago)
by asomers
Affects:  /projects/zfsd/head/tests/sys/cddl/zfs/include/libtest.kshlib
/projects/zfsd/head/tests/sys/cddl/zfs/tests/snapshot/clone_001_pos.ksh
/projects/zfsd/head/tests/sys/cddl/zfs/tests/snapshot/snapshot_test.sh
Fix and reenable clone_001_pos

tests/sys/cddl/zfs/include/libtest.kshlib
  Declare local variables

tests/sys/cddl/zfs/snapshot/clone_001_pos.ksh
  * Remove a Solarism
  * Remove extraneous teardown steps
  * Don't autofail on FreeBSD

tests/sys/cddl/zfs/snapshot/snapshot_test.sh
  Clear an expected failure, and skip if vfs.zfs.vol.recursive=0

Submitted by: avg
Sponsored by: Spectra Logic Corp
16:16:49 - r329827
(23 hours 51 minutes ago)
by kevans
Affects:  /head/sys/dev/nvme/nvme.h
nvme: Unbreak LE builds after r329824

The parameter 'p' is unused if _BYTE_ORDER == _LITTLE_ENDIAN. Add in a
(void)p to fix the build.
15:29:57 - r329826
(1 day ago)
by kevans
Affects:  /head/tools/boot/lua-lint.sh
lua-lint: Add note about luacheck in ports, silence warning

luacheck was added in ports r462609.

Silence warning about cli_execute -- it's non-standard, but for our setup it
will be a standard global.
15:29:19 - r329825
(1 day ago)
by hselasky
Affects: 
(6 files)
/head/sys/compat/linuxkpi/common/include/linux/*
/head/sys/compat/linuxkpi/common/src/*
Return correct error code to user-space when a system call receives a
signal in the LinuxKPI.

The read(), write() and mmap() system calls can return either EINTR or
ERESTART upon receiving a signal. Add code to figure out the correct
return value by temporarily storing the return code from the relevant
FreeBSD kernel APIs in the Linux task structure.

MFC after: 3 days
Sponsored by: Mellanox Technologies
13:32:31 - r329824
(1 day 2 hours ago)
by wma
Affects: 
(20 files)
/head/sbin/nvmecontrol/*
/head/sys/*
NVMe: Add big-endian support

Remove bitfields from defined structures as they are not portable.
Instead use shift and mask macros in the driver and nvmecontrol application.

NVMe is now working on powerpc64 host.

Submitted by: Michal Stanek <mst@semihalf.com>
Obtained from: Semihalf
Reviewed by: imp, wma
Sponsored by: IBM, QCM Technologies
Differential revision: https://reviews.freebsd.org/D13916
13:06:27 - r329823
(1 day 3 hours ago)
by avg
Affects:  /head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
another rework of getzfsvfs / getzfsvfs_impl code

This change is designed to account for yet another difference between
illumos and FreeBSD VFS. In FreeBSD a filesystem driver is supposed to
clean up mnt_data in its VFS_UNMOUNT method because it's the last call
into the driver before a struct mount object is destroyed. The VFS
drains all references to the object before destroying it, but for the
driver it's already as good as gone.
In contrast, illumos VFS provides another method, VFS_FREEVFS, that is
called when all references are drained. So, the driver can keep its
data after VFS_UNMOUNT and clean it up in VFS_FREEVFS after all
references are gone. This is what ZFS does on illumos.
So there a reference to a filesystem is sufficient to guarantee that the
ZFS specific data, aka zfsvfs_t, stays around (even if the filesystem
gets unmounted). In FreeBSD we need to vfs_busy the filesystem to get
the same guarantee. vfs_ref guarantees only that the struct mount is
kept.

The following rules should be observed in getzfsvfs / getzfsvfs_impl on
FreeBSD:
- if we need access to zfsvfs_t then we must use vfs_busy
- if only we need to access struct mount (aka vfs_t), then vfs_ref is
  enough
- when illumos code actually needs only the vfs_t, they still can pass
  the zfsvfs_t and get the vfs_t from it; that can work in FreeBSD if
  the filesystem is busied, but when it's just referenced then we have
  to pass the vfs_t explicitly
- we cannot call vfs_busy while holding a dataset because that creates a
  LOR with dp_config_rwlock

As a result:
- getzfsvfs_impl now only references the filesystem, same as in illumos,
  but unlike illumos it has to return the vfs_t
- the consumers are updated to account for the change
- getzfsvfs busies the filesystem (and drops the reference from
  getzfsvfs_impl)

Also, zfs_unmount_snap() now gets a busied a filesystem, references it
and then unbusies it essentially reverting actions done in getzfsvfs.
This is needed because the code may perform some checks that require the
zfsvfs_t. So, those are done before the unbusying.

MFC after: 2 weeks
12:31:28 - r329822
(1 day 3 hours ago)
by wma
Affects:  /head/sbin/Makefile.powerpc64
Add bsdlabel and fdisk to powerpc64

Submitted by: Wojciech Macek <wma@semihalf.org>
Obtained from: Semihalf
Sponsored by: IBM, QCM Technologies
11:51:50 - r329821
(1 day 4 hours ago)
by imp
Affects:  /head/sys/cam/cam_iosched.c
Revert r329814 as well. It should have been in r329819.
11:41:00 - r329820
(1 day 4 hours ago)
by avg
Affects:  /head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
followup to r329556, completely remove the covered vnode assert

vrele() acquires the vnode lock only if the hold count drops to zero.
In other scenarios it needs only the interlock. So,
zfsctl_snapdir_lookup() can race with vfs_mount_destroy() -> vrele()
such that the lookup adds a new reference and then vrele() drops the
mountpoint's reference and only then we check the reference count.
It would be just one in this case.

In fact, the assert should have been removed in r323483 when the code
learned how to deal with the uncovered vnode.

PR: 225795
MFC after: 4 days
X-MFC with: r329556
11:18:33 - r329819
(1 day 4 hours ago)
by imp
Affects: 
(6 files)
/head/sys/cam/*
/head/sys/dev/nvme/nvme.h
Backout r329818, r329816 and r329815.

These aren't the commits I thought I was testing prior to
commit. Revert until I can sort out what happened and fix it.
10:55:23 - r329818
(1 day 5 hours ago)
by imp
Affects:  /head/sys/cam/cam_iosched.c
Fix typo in last commit after last rebase before commit...
08:25:39 - r329817
(1 day 7 hours ago)
by araujo
Affects:  /head/etc/rc.d/ipfw
/head/etc/rc.firewall
The firewall_type is ignored if not set in rc.conf or rc.conf.local,
after r190575 there is an option to call rc.firewall with the firewall_type
passed in as an argument.

Submitted by: David P. Discher <dpd@dpdtech.com>
MFC after: 3 weeks.
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D14286
05:44:00 - r329816
(1 day 10 hours ago)
by imp
Affects:  /head/sys/cam/nvme/nvme_da.c
/head/sys/dev/nvme/nvme.h
Combine BIO_DELETE requests for nda devices

Now that we're queueing BIO_DELETE requests in the CAM I/O scheduler,
it make sense to try to combine as many as possible into a single
request to send down to hardware. Hopefully, lots of larger requests
like this are better than lots of individual transactions.

Note for future: need to limit based on total size of the trim
request. Should also collapse adjacent ranges where possible to
increase the size of the max payload.

Sponsored by: Netflix
05:43:55 - r329815
(1 day 10 hours ago)
by imp
Affects: 
(5 files)
/head/sys/cam/*
Introduce capacity flags for periphs

Introduce flags word to describe the capacities of the peripheral.
First bit will describe if the periph driver allows multiple
outstanding TRIMS to be active in a device.

Modify the I/O scheduler so that the nda driver can queue trims
for a while after the first one arrives. We'll queue until we see
a I/O scheduler tick, then we'll schedule as many TRIMs as allowed
by other factors (currently this is slocts in the NVMe controller).
This mariginally helps the read latency issues we see with reads,
but sets the stage for the nda driver to do TRIM collapsing like the
da and ada drivers do today.

Sponsored by: Netflix
05:43:50 - r329814
(1 day 10 hours ago)
by imp
Affects:  /head/sys/cam/cam_iosched.c
Note when we tick.

To help implement a policy of 'queue all trims until next I/O sched
tick' policy to help coalesce them, note when we tick so we can do
something special on the first call after the tick to get more work.

Sponsored by: Netflix
05:43:45 - r329813
(1 day 10 hours ago)
by imp
Affects:  /head/sys/cam/cam_iosched.c
Wrap an extra long line

This debugging line is too big for even my largest xterm. wrap it at
about 80 columns.

Sponsored by: Netflix
05:43:20 - r329812
(1 day 10 hours ago)
by imp
Affects:  /head/sys/cam/cam_iosched.c
Don't sort TRIMs.

While the code for ada and da both assume that the trim list is
ordered when doing the coaleascing the TRIMs, it turns out that
creating the sorted list uses more resources than are saved by having
slightly fewer trims sent to the device.

Sponsored by: Netflix
04:30:52 - r329811
(1 day 11 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
lualoader: Clear up an empty conditional branch

We will likely uncomment this whole monster in the near future.
04:28:52 - r329810
(1 day 11 hours ago)
by kevans
Affects:  /head/tools/boot/lua-lint.sh
Add script for linting stand/lua to tools/boot.

We require some --globals due to custom loader extensions in our
environment. Add everything required for this to tools/boot so that other
interested parties can get up and go with linting our scripts and not get a
bunch of false-positives.
04:15:02 - r329809
(1 day 11 hours ago)
by kevans
Affects: 
(7 files)
/head/stand/lua/*
lualoader: Address some 'luacheck' concerns

luacheck pointed out an assortment of issues, ranging from non-standard
globals being created as well as unused parameters, variables, and redundant
assignments.

Using '_' as a placeholder for values unused (whether it be parameters
unused or return values unused, assuming multiple return values) feels clean
and gets the point across, so I've adopted it. It also helps flag candidates
for cleanup later in some of the lambdas I've created, giving me an easy way
to re-evaluate later if we're still not using some of these features.
04:01:55 - r329808
(1 day 12 hours ago)
by mav
Affects: 
(4 files)
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
MFV r329807:
8940 Sending an intra-pool resumable send stream may result in EXDEV

illumos/illumos-gate@544132fce3fa6583f01318f9559adc46614343a7

"zfs send -t <token>" for an incremental send should be able to resume
successfully when sending to the same pool: a subtle issue in
zfs_iter_children() doesn't currently allow this.

Because resuming from a token requires "guid" -> "dataset" mapping
(guid_to_name()), we have to walk the whole hierarchy to find the right
snapshots to send.
When resuming an incremental send both source and destination live in the
same pool and have the same guid: this is where zfs_iter_children() gets
confused and picks up the wrong snapshot, so we end up trying to send an
incremental "destination@snap1 -> source@snap2" stream instead of
"source@snap1 -> source@snap2": this fails with an "Invalid cross-device
link" (EXDEV) error.

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: loli10K <ezomori.nozomu@gmail.com>
04:01:05 - r329807
(1 day 12 hours ago)
by mav
Affects:  /vendor/illumos/dist/lib/libzfs/common/libzfs_iter.c
/vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c
8940 Sending an intra-pool resumable send stream may result in EXDEV

illumos/illumos-gate@544132fce3fa6583f01318f9559adc46614343a7

"zfs send -t <token>" for an incremental send should be able to resume
successfully when sending to the same pool: a subtle issue in
zfs_iter_children() doesn't currently allow this.

Because resuming from a token requires "guid" -> "dataset" mapping
(guid_to_name()), we have to walk the whole hierarchy to find the right
snapshots to send.
When resuming an incremental send both source and destination live in the
same pool and have the same guid: this is where zfs_iter_children() gets
confused and picks up the wrong snapshot, so we end up trying to send an
incremental "destination@snap1 -> source@snap2" stream instead of
"source@snap1 -> source@snap2": this fails with an "Invalid cross-device
link" (EXDEV) error.

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: loli10K <ezomori.nozomu@gmail.com>
03:55:02 - r329806
(1 day 12 hours ago)
by kevans
Affects:  /head/stand/lua/core.lua
lualoader: Consistently use double quotes
03:54:59 - r329805
(1 day 12 hours ago)
by mav
Affects: 
(2 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
MFV r329803:
9080 recursive enter of vdev_indirect_rwlock from vdev_indirect_remap()

illumos/illumos-gate@bdfded42e66b9fc1395ff2401aa2952f7c44ae34

A scenario came up where a callback executed by vdev_indirect_remap() on a
vdev, calls
vdev_indirect_remap() on the same vdev and tries to reacquire
vdev_indirect_rwlock that
was already acquired from the first call to vdev_indirect_remap(). The specific
scenario,
is that we want to remap a block pointer that is snapshoted but its dataset's
remap_deadlist
is not cached. So in order to add it we issue a read through a
vdev_indirect_remap() on the
same vdev, which brings up the aforementioned issue.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
03:53:49 - r329804
(1 day 12 hours ago)
by kevans
Affects:  /head/stand/lua/menu.lua
lualoader: Eliminate some unused locals
03:52:03 - r329803
(1 day 12 hours ago)
by mav
Affects:  /vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_indirect.c
9080 recursive enter of vdev_indirect_rwlock from vdev_indirect_remap()

illumos/illumos-gate@bdfded42e66b9fc1395ff2401aa2952f7c44ae34

A scenario came up where a callback executed by vdev_indirect_remap() on a
vdev, calls
vdev_indirect_remap() on the same vdev and tries to reacquire
vdev_indirect_rwlock that
was already acquired from the first call to vdev_indirect_remap(). The specific
scenario,
is that we want to remap a block pointer that is snapshoted but its dataset's
remap_deadlist
is not cached. So in order to add it we issue a read through a
vdev_indirect_remap() on the
same vdev, which brings up the aforementioned issue.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
03:49:06 - r329802
(1 day 12 hours ago)
by mav
Affects: 
(9 files)
/head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/*
/head/sys/conf/files
MFV r329799, r329800:
9079 race condition in starting and ending condesing thread for indirect vdevs

illumos/illumos-gate@667ec66f1b4f491d5e839644e0912cad1c9e7122

The timeline of the race condition is the following:
[1] Thread A is about to finish condesing the first vdev in
spa_condense_indirect_thread(),
so it calls the spa_condense_indirect_complete_sync() sync task which sets the
spa_condensing_indirect field to NULL. Waiting for the sync task to finish,
thread A
sleeps until the txg is done. When this happens, thread A will acquire
spa_async_lock
and set spa_condense_thread to NULL.
[2] While thread A waits for the txg to finish, thread B which is running
spa_sync() checks
whether it should condense the second vdev in vdev_indirect_should_condense()
by checking
the spa_condensing_indirect field which was set to NULL by
spa_condense_indirect_thread()
from thread A. So it goes on and tries to spawn a new condensing thread in
spa_condense_indirect_start_sync() and the aforementioned assertions fails
because thread A
has not set spa_condense_thread to NULL (which is basically the last thing it
does before
returning).

The main issue here is that we rely on both spa_condensing_indirect and
spa_condense_thread to
signify whether a condensing thread is running. Ideally we would only use one
throughout the
codebase. In addition, for managing spa_condense_thread we currently use
spa_async_lock which
basically tights condensing to scrubing when it comes to pausing and resuming
those actions
during spa export.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>
03:37:01 - r329801
(1 day 12 hours ago)
by emaste
Affects:  /head/sys/amd64/linux32/linux32_dummy.c
Remove accidental vim droppings

Reported by: cy
03:23:43 - r329800
(1 day 12 hours ago)
by mav
Affects:  /vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zthr.h
/vendor-sys/illumos/dist/uts/common/fs/zfs/zthr.c
Missed pieces of r329799.
03:22:27 - r329799
(1 day 12 hours ago)
by mav
Affects: 
(5 files)
/vendor-sys/illumos/dist/uts/common/Makefile.files
/vendor-sys/illumos/dist/uts/common/fs/zfs/*
9079 race condition in starting and ending condesing thread for indirect vdevs

illumos/illumos-gate@667ec66f1b4f491d5e839644e0912cad1c9e7122

The timeline of the race condition is the following:
[1] Thread A is about to finish condesing the first vdev in
spa_condense_indirect_thread(),
so it calls the spa_condense_indirect_complete_sync() sync task which sets the
spa_condensing_indirect field to NULL. Waiting for the sync task to finish,
thread A
sleeps until the txg is done. When this happens, thread A will acquire
spa_async_lock
and set spa_condense_thread to NULL.
[2] While thread A waits for the txg to finish, thread B which is running
spa_sync() checks
whether it should condense the second vdev in vdev_indirect_should_condense()
by checking
the spa_condensing_indirect field which was set to NULL by
spa_condense_indirect_thread()
from thread A. So it goes on and tries to spawn a new condensing thread in
spa_condense_indirect_start_sync() and the aforementioned assertions fails
because thread A
has not set spa_condense_thread to NULL (which is basically the last thing it
does before
returning).

The main issue here is that we rely on both spa_condensing_indirect and
spa_condense_thread to
signify whether a condensing thread is running. Ideally we would only use one
throughout the
codebase. In addition, for managing spa_condense_thread we currently use
spa_async_lock which
basically tights condensing to scrubing when it comes to pausing and resuming
those actions
during spa export.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>
03:15:35 - r329798
(1 day 12 hours ago)
by mav
Affects: 
(22 files)
/head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
/head/cddl/contrib/opensolaris/lib/*
/head/sys/cddl/contrib/opensolaris/uts/common/*
MFV r329793, r329795:
9075 Improve ZFS pool import/load process and corrupted pool recovery

illumos/illumos-gate@6f7938128a2c5e23f4b970ea101137eadd1470a1

Some work has been done lately to improve the debugability of the ZFS pool
load (and import) process. This includes:

https://www.illumos.org/issues/7638: Refactor spa_load_impl into several
functions
https://www.illumos.org/issues/8961: SPA load/import should tell us why it
failed
https://www.illumos.org/issues/7277: zdb should be able to print zfs_dbgmsg's

To iterate on top of that, there's a few changes that were made to make the
import process more resilient and crash free. One of the first tasks during the
pool load process is to parse a config provided from userland that describes
what devices the pool is composed of. A vdev tree is generated from that config,
and then all the vdevs are opened.

The Meta Object Set (MOS) of the pool is accessed, and several metadata objects
that are necessary to load the pool are read. The exact configuration of the
pool is also stored inside the MOS. Since the configuration provided from
userland is external and might not accurately describe the vdev tree
of the pool at the txg that is being loaded, it cannot be relied upon to safely
operate the pool. For that reason, the configuration in the MOS is read early
on. In the past, the two configurations were compared together and if there was
a mismatch then the load process was aborted and an error was returned.

The latter was a good way to ensure a pool does not get corrupted, however it
made the pool load process needlessly fragile in cases where the vdev
configuration changed or the userland configuration was outdated. Since the MOS
is stored in 3 copies, the configuration provided by userland doesn't have to be
perfect in order to read its contents. Hence, a new approach has been adopted:
The pool is first opened with the untrusted userland configuration just so that
the real configuration can be read from the MOS. The trusted MOS configuration
is then used to generate a new vdev tree and the pool is re-opened.

When the pool is opened with an untrusted configuration, writes are disabled
to avoid accidentally damaging it. During reads, some sanity checks are
performed on block pointers to see if each DVA points to a known vdev;
when the configuration is untrusted, instead of panicking the system if those
checks fail we simply avoid issuing reads to the invalid DVAs.

This new two-step pool load process now allows rewinding pools accross
vdev tree changes such as device replacement, addition, etc. Loading a pool
from an external config file in a clustering environment also becomes much
safer now since the pool will import even if the config is outdated and didn't,
for instance, register a recent device addition.

With this code in place, it became relatively easy to implement a
long-sought-after feature: the ability to import a pool with missing top level
(i.e. non-redundant) devices. Note that since this almost guarantees some loss
Of data, this feature is for now restricted to a read-only import.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
02:39:33 - r329797
(1 day 13 hours ago)
by eadler
Affects: 
(2 files)
/stable/11/share/misc/pci_vendors
MFC r326633 r327282 r328085 r329311:

share: update pci_vendors to 2018.02.15
02:26:29 - r329796
(1 day 13 hours ago)
by jhb
Affects:  /head/sys/dev/vt/vt_core.c
Avoid grabbing locks when grabbing the vt(4) console for DDB.

Trying to grab locks during cngrab() when entering the debugger is
deadlock prone as all other CPUs are already halted (and thus unable
to release locks) when cngrab() is invoked. One could instead use
try-locks. However, the case that the try-lock fails still has to
be handled. In addition, if the try-lock works it doesn't provide
any greater ordering guarantees than is already provided by entering
and exiting DDB. It is simpler to define a simpler path for the
case that the try-lock would fail and always use that when entering
DDB. Messing with timers, etc. when entering DDB is dubious even if
the try-lock succeeds.

This patch attempts to use the smallest possible set of operations to
grab the vt(4) console when entering DDB without using any locks.

Reviewed by: emaste
Tested by: Matthew Macy
MFC after: 1 week
02:25:09 - r329795
(1 day 13 hours ago)
by mav
Affects: 
(13 files)
/vendor-sys/illumos/dist/uts/common/fs/zfs/*
/vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h
r329793 | mav | 2018-02-22 04:21:03 +0200 (чт, 22 февр. 2018) | 58 lines

9075 Improve ZFS pool import/load process and corrupted pool recovery

illumos/illumos-gate@6f7938128a2c5e23f4b970ea101137eadd1470a1

Some work has been done lately to improve the debugability of the ZFS pool
load (and import) process. This includes:

https://www.illumos.org/issues/7638: Refactor spa_load_impl into several
functions
https://www.illumos.org/issues/8961: SPA load/import should tell us why it
failed
https://www.illumos.org/issues/7277: zdb should be able to print zfs_dbgmsg's

To iterate on top of that, there's a few changes that were made to make the
import process more resilient and crash free. One of the first tasks during the
pool load process is to parse a config provided from userland that describes
what devices the pool is composed of. A vdev tree is generated from that config,
and then all the vdevs are opened.

The Meta Object Set (MOS) of the pool is accessed, and several metadata objects
that are necessary to load the pool are read. The exact configuration of the
pool is also stored inside the MOS. Since the configuration provided from
userland is external and might not accurately describe the vdev tree
of the pool at the txg that is being loaded, it cannot be relied upon to safely
operate the pool. For that reason, the configuration in the MOS is read early
on. In the past, the two configurations were compared together and if there was
a mismatch then the load process was aborted and an error was returned.

The latter was a good way to ensure a pool does not get corrupted, however it
made the pool load process needlessly fragile in cases where the vdev
configuration changed or the userland configuration was outdated. Since the MOS
is stored in 3 copies, the configuration provided by userland doesn't have to be
perfect in order to read its contents. Hence, a new approach has been adopted:
The pool is first opened with the untrusted userland configuration just so that
the real configuration can be read from the MOS. The trusted MOS configuration
is then used to generate a new vdev tree and the pool is re-opened.

When the pool is opened with an untrusted configuration, writes are disabled
to avoid accidentally damaging it. During reads, some sanity checks are
performed on block pointers to see if each DVA points to a known vdev;
when the configuration is untrusted, instead of panicking the system if those
checks fail we simply avoid issuing reads to the invalid DVAs.

This new two-step pool load process now allows rewinding pools accross
vdev tree changes such as device replacement, addition, etc. Loading a pool
from an external config file in a clustering environment also becomes much
safer now since the pool will import even if the config is outdated and didn't,
for instance, register a recent device addition.

With this code in place, it became relatively easy to implement a
long-sought-after feature: the ability to import a pool with missing top level
(i.e. non-redundant) devices. Note that since this almost guarantees some loss
Of data, this feature is for now restricted to a read-only import.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
02:24:17 - r329794
(1 day 13 hours ago)
by emaste
Affects: 
(18 files)
/head/sys/amd64/*
/head/sys/compat/linux/*
/head/sys/i386/linux/*
Correct proper nouns in the Linuxulator

- Capitalize Linux
- Spell FreeBSD out in full
- Address some style(9) on changed lines

Sponsored by: Turing Robotic Industries Inc.
02:21:03 - r329793
(1 day 13 hours ago)
by mav
Affects: 
(6 files)
/vendor/illumos/dist/cmd/zpool/zpool_main.c
/vendor/illumos/dist/lib/libzfs/common/*
/vendor/illumos/dist/lib/libzpool/common/*
9075 Improve ZFS pool import/load process and corrupted pool recovery

illumos/illumos-gate@6f7938128a2c5e23f4b970ea101137eadd1470a1

Some work has been done lately to improve the debugability of the ZFS pool
load (and import) process. This includes:

https://www.illumos.org/issues/7638: Refactor spa_load_impl into several
functions
https://www.illumos.org/issues/8961: SPA load/import should tell us why it
failed
https://www.illumos.org/issues/7277: zdb should be able to print zfs_dbgmsg's

To iterate on top of that, there's a few changes that were made to make the
import process more resilient and crash free. One of the first tasks during the
pool load process is to parse a config provided from userland that describes
what devices the pool is composed of. A vdev tree is generated from that config,
and then all the vdevs are opened.

The Meta Object Set (MOS) of the pool is accessed, and several metadata objects
that are necessary to load the pool are read. The exact configuration of the
pool is also stored inside the MOS. Since the configuration provided from
userland is external and might not accurately describe the vdev tree
of the pool at the txg that is being loaded, it cannot be relied upon to safely
operate the pool. For that reason, the configuration in the MOS is read early
on. In the past, the two configurations were compared together and if there was
a mismatch then the load process was aborted and an error was returned.

The latter was a good way to ensure a pool does not get corrupted, however it
made the pool load process needlessly fragile in cases where the vdev
configuration changed or the userland configuration was outdated. Since the MOS
is stored in 3 copies, the configuration provided by userland doesn't have to be
perfect in order to read its contents. Hence, a new approach has been adopted:
The pool is first opened with the untrusted userland configuration just so that
the real configuration can be read from the MOS. The trusted MOS configuration
is then used to generate a new vdev tree and the pool is re-opened.

When the pool is opened with an untrusted configuration, writes are disabled
to avoid accidentally damaging it. During reads, some sanity checks are
performed on block pointers to see if each DVA points to a known vdev;
when the configuration is untrusted, instead of panicking the system if those
checks fail we simply avoid issuing reads to the invalid DVAs.

This new two-step pool load process now allows rewinding pools accross
vdev tree changes such as device replacement, addition, etc. Loading a pool
from an external config file in a clustering environment also becomes much
safer now since the pool will import even if the config is outdated and didn't,
for instance, register a recent device addition.

With this code in place, it became relatively easy to implement a
long-sought-after feature: the ability to import a pool with missing top level
(i.e. non-redundant) devices. Note that since this almost guarantees some loss
Of data, this feature is for now restricted to a read-only import.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
02:16:44 - r329792
(1 day 13 hours ago)
by asomers
Affects: 
(2 files)
/stable/11/cddl/usr.sbin/zfsd/case_file.cc
MFC r328605:

zfsd: Don't spare a vdev that's being replaced

If a zfs pool contains a replacing vdev (either created manually by "zpool
replace" or by zfsd(8) via autoreplace by physical path) and then new spares
get added to the pool, zfsd shouldn't use one to replace the drive that is
already being replaced. That's a waste of resources that just slows down
the rebuild.

PR: 225547
Sponsored by: Spectra Logic Corp
02:15:45 - r329791
(1 day 13 hours ago)
by asomers
Affects: 
(3 files)
/stable/11/sys/netinet6/in6.c
/stable/11/sys/netinet6/scope6.c
MFC r328296:

sys/netinet6: fix typos in comments. No functional change.

Sponsored by: Spectra Logic Corp
02:14:43 - r329790
(1 day 13 hours ago)
by asomers
Affects: 
(3 files)
/stable/11/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
/stable/11/lib/libc/sys/mlock.2
MFC r328266:

mlock(2): correct documentation for error conditions.

The man page is years out of date regarding errors. Our implementation _does_
allow unaligned addresses, and it _does_not_ check for negative lengths,
because the length is unsigned. It checks for overflow instead.

Update the tests accordingly.

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D13826
02:12:47 - r329789
(1 day 13 hours ago)
by asomers
Affects: 
(6 files)
/stable/11/sbin/geom/class/nop/*
/stable/11/sys/geom/nop/*
/stable/11/tests/sys/geom/class/nop/nop_test.sh
MFC r328108:

gnop(8): add the ability to set a nop provider's physical path

While I'm here, expand the existing tests a bit.

Differential Revision: https://reviews.freebsd.org/D13579
02:02:31 - r329788
(1 day 14 hours ago)
by jhb
Affects:  /head/sys/dev/cxgbe/common/t4_msg.h
/head/sys/dev/cxgbe/common/t4_tcb.h
Bring in additional constants and message fields for TLS-related messages.

Sponsored by: Chelsio Communications
01:59:59 - r329787
(1 day 14 hours ago)
by emaste
Affects:  /head/sys/sys/sysent.h
Use 'const int *' for sysentvec errno translation table

This allows an sv_errtbl to be read-only .rodata.

Sponsored by: Turing Robotic Industries Inc.
01:57:38 - r329786
(1 day 14 hours ago)
by kevans
Affects:  /head/stand/lua/cli.lua
lualoader: Attach cli command functions to cli module

Instead of the global namespace, let's attach these to the cli module. Other
users, including the "local" module, can attach functions to the cli module
at will to add other cli commands and things will still Just Work.

This distills down the candidates for functions that may be invoked via the
cli to a minimal set (boot, autoboot, arguments), rather than any function
that happens to live in the global lua namespace.
01:50:30 - r329785
(1 day 14 hours ago)
by jhb
Affects: 
(4 files)
/head/sys/dev/cxgbe/tom/*
Move DDP PCB state into a helper structure.

This consolidates all of the DDP state in one place. Also, the code has
now been fixed to ensure that DDP state is only accessed for DDP
connections. This should not be a functional change but makes it cleaner
and easier to add state for other TOE socket modes in the future.

MFC after: 1 month
Sponsored by: Chelsio Communications
01:44:30 - r329784
(1 day 14 hours ago)
by kevans
Affects:  /head/stand/lua/cli.lua
lualoader: Pull argument extraction for cli functions into cli.arguments

This will be the translation layer for varargs -> cmd_name, argv for cli
commands. We reserve the right to break exactly what the varargs inclulde,
but this gives us a stable way to pull the arguments out of varargs.
01:42:13 - r329783
(1 day 14 hours ago)
by mav
Affects: 
(5 files)
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
8942 zfs promote .../%recv should be an error

illumos/illumos-gate@add927f8c8d101e16c23eb9cd270be4fd7edf7d5

Reported on the ZFSonLinux https://github.com/zfsonlinux/zfs/issues/4843,
fixed by https://github.com/zfsonlinux/zfs/pull/6339:

If we are in the middle of an incremental zfs receive, the child .../%recv
will exist. If you concurrently run zfs promote .../%recv, it will "work",
but then zfs gets confused. For example, there's no obvious way to destroy
the containing filesystem (because it is now a clone of its invisible child).

Attempting to do this promote should be an error. We could fix this by
having zfs_ioc_promote() check if zc_name contains a %, similar to
zfs_ioc_rename().

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>
01:31:05 - r329782
(1 day 14 hours ago)
by kevans
Affects:  /head/stand/lua/cli.lua
lualoader: Unbreak 'boot [kernel]' by including config
01:30:03 - r329781
(1 day 14 hours ago)
by mav
Affects:  /vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c
/vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c
8942 zfs promote .../%recv should be an error

illumos/illumos-gate@add927f8c8d101e16c23eb9cd270be4fd7edf7d5

Reported on the ZFSonLinux https://github.com/zfsonlinux/zfs/issues/4843,
fixed by https://github.com/zfsonlinux/zfs/pull/6339:

If we are in the middle of an incremental zfs receive, the child .../%recv
will exist. If you concurrently run zfs promote .../%recv, it will "work",
but then zfs gets confused. For example, there's no obvious way to destroy
the containing filesystem (because it is now a clone of its invisible child).

Attempting to do this promote should be an error. We could fix this by
having zfs_ioc_promote() check if zc_name contains a %, similar to
zfs_ioc_rename().

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>
01:25:28 - r329780
(1 day 14 hours ago)
by asomers
Affects: 
(2 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c
MFC r326399:

Fix assertion when ZFS fails to open certain devices

"panic: vdev_geom_close_locked: cp->private is NULL"
This panic will result if ZFS fails to open a device due to either of the
following reasons:

1) The device's sector size is greater than 8KB.
2) ZFS wants to open the device RW, but it can't be opened for writing.

The solution is to change the initialization order to ensure that the
assertion will be satisfied.

PR: 221066
Reported by: David NewHamlet <wheelcomplex@gmail.com>
Reviewed by: avg
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13278
01:21:39 - r329779
(1 day 14 hours ago)
by kevans
Affects: 
(4 files)
/head/stand/lua/*
lualoader: Split cli bits out into a cli module

This module will, in the not-so-distant future, grow functionality for
reducing boilerplate in functions that implement cli commands. It will
likely also house most in-tree cli commands.
01:17:32 - r329778
(1 day 14 hours ago)
by mav
Affects:  /vendor/illumos/dist/cmd/zpool/zpool_vdev.c
8941 zpool add: assertion failed in get_replication() with nested interior VDEVs

illumos/illumos-gate@ac0215f4d618163d117a40fbf77a3f944852cb7b

When replacing a faulted device which was previously handled by a spare
multiple levels of nested interior VDEVs will be present in the pool
configuration: get_replication() needs to handle this situation gracefully
to let zpool add new devices to the pool

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>
01:00:46 - r329777
(1 day 15 hours ago)
by mav
Affects: 
(2 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
MFV r329776: 8477 Assertion failed in vdev_state_dirty(): spa_writeable(spa)

illumos/illumos-gate@f4c1745bd6c9829a05ecec15759ede7757100ab5

Illumos 4080 allows "zpool clear" to work on readonly pools: i don't think
this is the intended behaviour, we shouldn't be allowed to clear readonly
pools. Probably.

A fix is already in the ZFS on Linux repository to addess this issue:
https://github.com/zfsonlinux/zfs/commit/92e43c17188d47f47b69318e4884096dec380e36

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>
00:59:49 - r329776
(1 day 15 hours ago)
by mav
Affects:  /vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c
8477 Assertion failed in vdev_state_dirty(): spa_writeable(spa)

illumos/illumos-gate@f4c1745bd6c9829a05ecec15759ede7757100ab5

Illumos 4080 allows "zpool clear" to work on readonly pools: i don't think
this is the intended behaviour, we shouldn't be allowed to clear readonly
pools. Probably.

A fix is already in the ZFS on Linux repository to addess this issue:
https://github.com/zfsonlinux/zfs/commit/92e43c17188d47f47b69318e4884096dec380e36

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>
00:55:25 - r329775
(1 day 15 hours ago)
by mav
Affects: 
(2 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c
MFV r329774:
8408 dsl_props_set_sync_impl() does not handle nested nvlists correctly

illumos/illumos-gate@85723e5eec42f46dbfdb4c09b9e1ed66501d1ccf

When iterating over the input nvlist in dsl_props_set_sync_impl() when we
don't preserve the nvpair name before looking up ZPROP_VALUE, so when we
later go to process it nvpair_name() is always "value" instead of the actual
property name.

This results in a couple of bugs in the recv code:

 - received properties are not restored correctly when failing to receive
  an incremental send stream
 - received properties are not completely replaced by the new ones when
  successfully receiving an incremental send stream

This was discovered on ZFS on Linux (fixed in
https://github.com/zfsonlinux/zfs/commit/5f1346c29997dd4e02acf4c19c875d5484f33b1e)

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>
00:53:59 - r329774
(1 day 15 hours ago)
by mav
Affects:  /vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c
8408 dsl_props_set_sync_impl() does not handle nested nvlists correctly

illumos/illumos-gate@85723e5eec42f46dbfdb4c09b9e1ed66501d1ccf

When iterating over the input nvlist in dsl_props_set_sync_impl() when we
don't preserve the nvpair name before looking up ZPROP_VALUE, so when we
later go to process it nvpair_name() is always "value" instead of the actual
property name.

This results in a couple of bugs in the recv code:

 - received properties are not restored correctly when failing to receive
  an incremental send stream
 - received properties are not completely replaced by the new ones when
  successfully receiving an incremental send stream

This was discovered on ZFS on Linux (fixed in
https://github.com/zfsonlinux/zfs/commit/5f1346c29997dd4e02acf4c19c875d5484f33b1e)

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>
00:53:05 - r329773
(1 day 15 hours ago)
by jhb
Affects: 
(2 files)
/stable/11/sys/opencrypto/cryptodev.c
MFC 323889: Place the AAD before the plaintext/ciphertext for CIOCRYPTAEAD.

Software crypto implementations don't care how the buffer is laid out,
but hardware implementations may assume that the AAD is always before
the plain/cipher text and that the hash/tag is immediately after the end
of the plain/cipher text.

In particular, this arrangement matches the layout of both IPSec packets
and TLS frames. Linux's crypto framework also assumes this layout for
AEAD requests.

Sponsored by: Chelsio Communications
00:48:59 - r329772
(1 day 15 hours ago)
by mav
Affects:  /vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_indirect_mapping.c
9036 zfs: duplicate 'const' declaration specifier

illumos/illumos-gate@f02c28e434fb4d81d95122bab187fb43d4f19c2a

Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Toomas Soome <tsoome@me.com>
00:47:38 - r329771
(1 day 15 hours ago)
by mav
Affects: 
(5 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/*
MFV r329770: 9035 zfs: this statement may fall through

illumos/illumos-gate@46ac8fdfc5a1f9d8240c79a6ae5b2889cbe83553

Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Toomas Soome <tsoome@me.com>
00:46:24 - r329770
(1 day 15 hours ago)
by mav
Affects: 
(4 files)
/vendor-sys/illumos/dist/uts/common/fs/zfs/lua/*
9035 zfs: this statement may fall through

illumos/illumos-gate@46ac8fdfc5a1f9d8240c79a6ae5b2889cbe83553

Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Toomas Soome <tsoome@me.com>
00:42:12 - r329769
(1 day 15 hours ago)
by mav
Affects: 
(5 files)
/head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
MFV r329766: 8962 zdb should work on non-idle pools

illumos/illumos-gate@e144c4e6c90e7d4dccaad6db660ee42b6e7ba04f

Currently `zdb` consistently fails to examine non-idle pools as it fails
during the `spa_load()` process. The main problem seems to be that
`spa_load_verify()` fails as can be seen below:

$ sudo zdb -d -G dcenter
  zdb: can't open 'dcenter': I/O error

ZFS_DBGMSG(zdb):
  spa_open_common: opening dcenter
  spa_load(dcenter): LOADING
  disk vdev '/dev/dsk/c4t11d0s0': best uberblock found for spa dcenter. txg
40824950
  spa_load(dcenter): using uberblock with txg=40824950
  spa_load(dcenter): UNLOADING
  spa_load(dcenter): RELOADING
  spa_load(dcenter): LOADING
  disk vdev '/dev/dsk/c3t10d0s0': best uberblock found for spa dcenter. txg
40824952
  spa_load(dcenter): using uberblock with txg=40824952
  spa_load(dcenter): FAILED: spa_load_verify failed [error=5]
  spa_load(dcenter): UNLOADING

This change makes `spa_load_verify()` a dryrun when ran from `zdb`. This is
done by creating a global flag in zfs and then setting it in `zdb`.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
00:39:25 - r329768
(1 day 15 hours ago)
by jhb
Affects: 
(4 files)
/head/lib/libvmmapi/*
/head/sys/amd64/*
Add two new ioctls to bhyve for batch register fetch/store operations.

These are a convenience for bhyve's debug server to use a single
ioctl for 'g' and 'G' rather than a loop of individual get/set
ioctl requests.

Reviewed by: grehan
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D14074
00:36:12 - r329767
(1 day 15 hours ago)
by truckman
Affects: 
(13 files)
/stable/11/share/man/man4/*
/stable/11/stand/forth/loader.conf
/stable/11/sys/*
MFC r323067, r323184, r323185, r323195, r323196 (by cem)

------------------------------------------------------------------------
r323067 | cem | 2017-08-31 11:39:18 -0700 (Thu, 31 Aug 2017) | 4 lines

amdtemp.4: Update BKDG URL to current location

Sponsored by: Dell EMC Isilon

------------------------------------------------------------------------
r323184 | cem | 2017-09-05 08:13:41 -0700 (Tue, 05 Sep 2017) | 10 lines

Add smn(4) driver for AMD System Management Network

AMD Family 17h CPUs have an internal network used to communicate between
the host CPU and the PSP and SMU coprocessors. It exposes a simple
32-bit register space.

Reviewed by: avg (no +1), mjoras, truckman
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12217

------------------------------------------------------------------------
r323185 | cem | 2017-09-05 08:19:14 -0700 (Tue, 05 Sep 2017) | 13 lines

amdtemp(4): Add support for Family 17h temperature sensor

The sensor value is formatted similarly to previous models (same
bitfield sizes, same units), but must be read off of the internal
System Management Network (SMN) from the System Management Unit (SMU)
co-processor.

PR: 218264
Reported and tested by: Nils Beyer <nbe AT renzel.net>
Reviewed by: avg (no +1), mjoras, truckman
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12217

------------------------------------------------------------------------
r323195 | cem | 2017-09-05 13:35:25 -0700 (Tue, 05 Sep 2017) | 8 lines

amdtemp(4): Do not probe not matching hostbridges

Some systems have hostbs that do not match our PCI device id criteria.
Detect and ignore these devices in probe.

PR: 218264
Sponsored by: Dell EMC Isilon

------------------------------------------------------------------------
r323196 | cem | 2017-09-05 14:00:33 -0700 (Tue, 05 Sep 2017) | 8 lines

amdsmn(4): Do not probe not matching hostbridges

Similar to r323195, but for amdsmn(4) driver (which borrowed some design).

Ignore hostbs that do not match our PCI device id criteria.

Sponsored by: Dell EMC Isilon

PR: 218264
Differential Revision: https://reviews.freebsd.org/D12217
00:09:15 - r329766
(1 day 15 hours ago)
by mav
Affects:  /vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c
/vendor/illumos/dist/cmd/zdb/zdb.c
8962 zdb should work on non-idle pools

illumos/illumos-gate@e144c4e6c90e7d4dccaad6db660ee42b6e7ba04f

Currently `zdb` consistently fails to examine non-idle pools as it fails
during the `spa_load()` process. The main problem seems to be that
`spa_load_verify()` fails as can be seen below:

$ sudo zdb -d -G dcenter
  zdb: can't open 'dcenter': I/O error

ZFS_DBGMSG(zdb):
  spa_open_common: opening dcenter
  spa_load(dcenter): LOADING
  disk vdev '/dev/dsk/c4t11d0s0': best uberblock found for spa dcenter. txg
40824950
  spa_load(dcenter): using uberblock with txg=40824950
  spa_load(dcenter): UNLOADING
  spa_load(dcenter): RELOADING
  spa_load(dcenter): LOADING
  disk vdev '/dev/dsk/c3t10d0s0': best uberblock found for spa dcenter. txg
40824952
  spa_load(dcenter): using uberblock with txg=40824952
  spa_load(dcenter): FAILED: spa_load_verify failed [error=5]
  spa_load(dcenter): UNLOADING

This change makes `spa_load_verify()` a dryrun when ran from `zdb`. This is
done by creating a global flag in zfs and then setting it in `zdb`.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
00:03:14 - r329765
(1 day 16 hours ago)
by mav
Affects: 
(9 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/*
MFV r329762: 8961 SPA load/import should tell us why it failed

illumos/illumos-gate@3ee8c80c747c4aa3f83351a6920f30c411236e1b

When we fail to open or import a storage pool, we typically don't get any
additional diagnostic information, just "no pool found" or "can not import".

While there may be no additional user-consumable information, we should at
least make this situation easier to debug/diagnose for developers and support.
For example, we could start by using `zfs_dbgmsg()` to log each thing that we
try when importing, and which things failed. E.g. "tried uberblock of txg X
from label Y of device Z". Also, we could log each of the stages that we go
through in `spa_load_impl()`.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
2018 - 02 - 21   (2 days ago)
23:49:35 - r329764
(1 day 16 hours ago)
by imp
Affects:  /head/sys/cam/nvme/nvme_da.c
Minor formatting nits.
23:49:18 - r329763
(1 day 16 hours ago)
by imp
Affects:  /head/tools/boot/universe.sh
Add LOADER_DEBUG regression test
23:42:30 - r329762
(1 day 16 hours ago)
by mav
Affects: 
(7 files)
/vendor-sys/illumos/dist/uts/common/fs/zfs/*
8961 SPA load/import should tell us why it failed

illumos/illumos-gate@3ee8c80c747c4aa3f83351a6920f30c411236e1b

When we fail to open or import a storage pool, we typically don't get any
additional diagnostic information, just "no pool found" or "can not import".

While there may be no additional user-consumable information, we should at
least make this situation easier to debug/diagnose for developers and support.
For example, we could start by using `zfs_dbgmsg()` to log each thing that we
try when importing, and which things failed. E.g. "tried uberblock of txg X
from label Y of device Z". Also, we could log each of the stages that we go
through in `spa_load_impl()`.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
23:38:30 - r329761
(1 day 16 hours ago)
by mav
Affects: 
(2 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
MFV r329760: 7638 Refactor spa_load_impl into several functions

illumos/illumos-gate@1fd3785ff6601d3e391378c2dcbf4c5f27e1fe32

spa_load_impl has grown out of proportions. It is currently over 700
lines long and makes it very hard to follow or debug the import process
even for experienced ZFS developers. The objective is to split it up
in a series of well commented functions.

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
23:25:11 - r329760
(1 day 16 hours ago)
by mav
Affects:  /vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c
7638 Refactor spa_load_impl into several functions

illumos/illumos-gate@1fd3785ff6601d3e391378c2dcbf4c5f27e1fe32

spa_load_impl has grown out of proportions. It is currently over 700
lines long and makes it very hard to follow or debug the import process
even for experienced ZFS developers. The objective is to split it up
in a series of well commented functions.

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
23:15:06 - r329759
(1 day 16 hours ago)
by mav
Affects: 
(5 files)
/head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
/head/sys/cddl/compat/opensolaris/*
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
9018 Replace kmem_cache_reap_now() with kmem_cache_reap_soon()

illumos/illumos-gate@36a64e62848b51ac5a9a5216e894ec723cfef14e

To prevent kmem_cache reaping from blocking other system resources, turn
kmem_cache_reap_now() (which blocks) into kmem_cache_reap_soon(). Callers
to kmem_cache_reap_soon() should use kmem_cache_reap_active(), which
exploits #9017's new taskq_empty().

Reviewed by: Bryan Cantrill <bryan@joyent.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Author: Tim Kordas <tim.kordas@joyent.com>

FreeBSD does not use taskqueue for kmem caches reaping, so this change
is less dramatic then it is on Illumos, just limiting reaping to 1 time
per second. It may possibly be improved later, if needed.
22:24:49 - r329758
(1 day 17 hours ago)
by marius
Affects:  /head/stand/sparc64/loader/main.c
Fix compilation with LOADER_DEBUG defined after r329725.
22:14:19 - r329757
(1 day 17 hours ago)
by mav
Affects:  /vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c
9018 Replace kmem_cache_reap_now() with kmem_cache_reap_soon()

illumos/illumos-gate@36a64e62848b51ac5a9a5216e894ec723cfef14e

To prevent kmem_cache reaping from blocking other system resources, turn
kmem_cache_reap_now() (which blocks) into kmem_cache_reap_soon(). Callers
to kmem_cache_reap_soon() should use kmem_cache_reap_active(), which
exploits #9017's new taskq_empty().

Reviewed by: Bryan Cantrill <bryan@joyent.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Author: Tim Kordas <tim.kordas@joyent.com>
21:39:47 - r329756
(1 day 18 hours ago)
by kevans
Affects:  /head/stand/liblua/luaconf.h
/head/stand/lua/screen.lua
lualoader: Remove nasty hack for not printing out ".0"

luaconf.h has a LUA_COMPAT_FLOATSTRING option that may be defined to do this
instead of needing intstring.

Reported by: Dan Nelson
21:18:04 - r329755
(1 day 18 hours ago)
by mav
Affects: 
(8 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
/head/sys/cddl/contrib/opensolaris/uts/common/sys/*
MFV r329753: 8809 libzpool should leverage work done in libfakekernel

illumos/illumos-gate@f06dce2c1f0f3af78581e7574f65bfba843ddb6e

Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Andrew Stormont <astormont@racktopsystems.com>
21:13:08 - r329754
(1 day 18 hours ago)
by asomers
Affects: 
(14 files)
/head/sbin/dhclient/*
dhclient: raise WARNS to 4

Mostly const-correctness fixes. There were also some variable-shadowing,
unused variable, and a couple of sockaddr type-correctness changes. I also had
trouble with cast-align warnings. I was able to prove that one of them was a
false positive. But ultimately I had to disable the warning program-wide to
deal with the others.

Reviewed by: cem
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D14460
21:04:46 - r329753
(1 day 19 hours ago)
by mav
Affects: 
(13 files)
/vendor-sys/illumos/dist/uts/common/*
/vendor/illumos/dist/cmd/*
/vendor/illumos/dist/lib/libzpool/common/*
8809 libzpool should leverage work done in libfakekernel

illumos/illumos-gate@f06dce2c1f0f3af78581e7574f65bfba843ddb6e

Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Andrew Stormont <astormont@racktopsystems.com>
20:56:28 - r329752
(1 day 19 hours ago)
by asomers
Affects:  /projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib
Fix zfsd_degrade_001_pos.

$TESTPOOL was running out of space. Reduce the size of the data that we
generate.

Sponsored by: Spectra Logic Corp
20:55:52 - r329751
(1 day 19 hours ago)
by asomers
Affects:  /projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_007_pos.ksh
Remove an obsolete cleanup step from hotspare_007_pos

We no longer need this after the gnop conversion

Sponsored by: Spectra Logic Corp
20:45:43 - r329750
(1 day 19 hours ago)
by asomers
Affects:  /head/lib/libifconfig/libifconfig.c
libifconfig: fix ifconfig_set_metric

Due to a copy/paste error, ifconfig_set_metric actually set the mtu, not the
metric.

See Also: https://github.com/Savagedlight/libifconfig/issues/48

MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
20:32:23 - r329749
(1 day 19 hours ago)
by mckusick
Affects:  /head/sbin/fsck_ffs/inode.c
Fix a read past the end of a buffer in fsck.

To minimize the time spent scanning all of the directories in pass 2
(Check Pathnames), fsck uses a search order based on the location
of their first block. Zero length directories have no first block,
so the array being used to hold the block numbers of directory
inodes was of zero length. Thus a lookup was done past the end of
the array getting at best a random value and at worst a segment
fault. For zero length directories, this change allocates a one
element block array and initializes it to zero. The effect is that
all zero length directories are handled first in pass 2.

Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D14163
20:17:08 - r329748
(1 day 19 hours ago)
by kevans
Affects:  /head/stand/lua/password.lua
lualoader: Drop password length restrictions

This seems to have been arbitrary; bootlock_password and password don't seem
to have any documented length restrictions, and loader(8) probably shouldn't
care about whatever GELI passphrase length restrictions might exist.

Reported by: Kalle Carlbark <kalle.carlbark+freebsd@kcbark.net>
19:56:34 - r329747
(1 day 20 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
lualoader: Replace 8-space indentation with a single tab
19:56:19 - r329746
(1 day 20 hours ago)
by mckusick
Affects:  /head/sys/ufs/ffs/ffs_subr.c
Refactor fix in r329600 to do its check once in readsuper() rather
than in the two places that call readsuper().

No semantic change intended.

Reviewed by: kib
19:42:54 - r329745
(1 day 20 hours ago)
by emaste
Affects:  /head/stand/common/load_elf.c
load_elf.c: Use consistent indentation

As noted in D14267 load_elf.c has a variety of indentation styles. Move
to standard 8 column hard tab indents, 4 space second level indents.
Also includes some whitespace cleanups found by clang-format.
19:13:27 - r329744
(1 day 20 hours ago)
by rstone
Affects:  /head/sbin/route/route.8
Fix route manpage to show correct flush syntax

The current route(8) manpage shows that "flush" is an argument to
the optional -n flag, rather than a separate subcommand. Correct
this to properly show flush as a route subcommand.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Reviewed by: rgrimes
Differential Revision: https://reviews.freebsd.org/D14401
19:13:23 - r329743
(1 day 20 hours ago)
by rstone
Affects:  /head/sbin/route/route.8
/head/sys/net/rtsock.c
Allow route change requests to not specify the gateway.

Only require a gateway to be specified on a route add request. On
a route change request that does not specify the gateway, the
gateway will remain the same. This allows changing other route
parameters without having to re-specifying the gateway, like in
"route change 10.0.0.0/8 -mtu 9000".

Update the route(8) manpage to explicitly call out this usage
as being supported.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Reviewed By: eugen (rtsock.c change), rgrimes
Differential Revision: https://reviews.freebsd.org/D14291
18:57:00 - r329742
(1 day 21 hours ago)
by shurd
Affects:  /head/sys/net/iflib.h
IFLIB: Make isc_magic unsigned

The IFLIB_MAGIC macro is > INT_MAX, so isc_magic should
be able to contain it.

Reported by: jeb
Sponsored by: Limelight Networks
18:32:57 - r329741
(1 day 21 hours ago)
by brooks
Affects: 
(4 files)
/stable/10/sys/kern/sysv_msg.c
/stable/10/sys/kern/sysv_sem.c
/stable/10/sys/kern/sysv_shm.c
MFC r329525:

Correct/improve the descriptions if kern.ipc.(shmsegs,sema,msqids).

The description of kern.ipc.shmsegs was wrong since 2005. I updated the
others (which were more correct) to match.

PR: 225933
Reviewed by: cem
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14391
18:32:06 - r329740
(1 day 21 hours ago)
by benno
Affects:  /head/stand/i386/boot2/boot2.c
Further style(9) changes.

Tested by: objdump -d | md5 (both in-tree clang and lang/gcc6)
18:31:21 - r329739
(1 day 21 hours ago)
by brooks
Affects: 
(4 files)
/stable/11/sys/kern/sysv_msg.c
/stable/11/sys/kern/sysv_sem.c
/stable/11/sys/kern/sysv_shm.c
MFC r329525:

Correct/improve the descriptions if kern.ipc.(shmsegs,sema,msqids).

The description of kern.ipc.shmsegs was wrong since 2005. I updated the
others (which were more correct) to match.

PR: 225933
Reviewed by: cem
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14391
18:12:19 - r329738
(1 day 21 hours ago)
by mav
Affects: 
(2 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
MFV r329736: 8969 Cannot boot from RAIDZ with parity > 1

illumos/illumos-gate@0fb055e81fd0cda5221da8ddd98b2f8d1fc6bdbe

At present it is possible to boot from a root pool that is on RAIDZ but not
one that is on RAIDZ2 or RAIDZ3. This is because, at the time the pool
version is checked to ensure support for dual/triple parity, the uberblock
has not yet been loaded into the SPA and therefore the code determines that
the pool version is too old and returns ENOTSUP.

Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Andy Fiddaman <omnios@citrus-it.co.uk>

FreeBSD already had this fixed, so this is just a diff reduction.
18:10:50 - r329737
(1 day 21 hours ago)
by benno
Affects:  /head/stand/i386/boot2/boot2.c
Purely whitespace changes bringing this file closer to style(9).

Curiously, changing whitespace seems to cause the md5 of the .o files to differ
these days hence the following testing strategy:

Tested by: objdump -d | md5 (both in-tree clang and lang/gcc6)
18:09:07 - r329736
(1 day 21 hours ago)
by mav
Affects:  /vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c
8969 Cannot boot from RAIDZ with parity > 1

illumos/illumos-gate@0fb055e81fd0cda5221da8ddd98b2f8d1fc6bdbe

At present it is possible to boot from a root pool that is on RAIDZ but not
one that is on RAIDZ2 or RAIDZ3. This is because, at the time the pool
version is checked to ensure support for dual/triple parity, the uberblock
has not yet been loaded into the SPA and therefore the code determines that
the pool version is too old and returns ENOTSUP.

Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
17:46:13 - r329735
(1 day 22 hours ago)
by brooks
Affects:  /svnadmin/conf/sizelimit.conf
Remove my entry. Its been years since I needed it.
17:33:01 - r329734
(1 day 22 hours ago)
by kevans
Affects:  /head/stand/lua/menu.lua
lualoader: Don't execute menu.autoboot() for every opened menu

Attempt to autoboot when we open the default menu, and only when we open the
default menu. This alleviates the need for checking menu.already_autoboot,
because we're not trying to autoboot every time we open a submenu.

I note that escaping to loader prompt and going back to the menu (by running
require('menu').run() at the loader prompt) will happily work and not
re-initiate the autoboot sequence since "Escape to loader prompt" disables
the autoboot_delay.
16:57:03 - r329733
(1 day 23 hours ago)
by kevans
Affects:  /head/stand/lua/core.lua
lualoader: Make kernel autodetection contingent on loader.conf(5) var

Instead of based it off of whether 'kernels' was specified, base it off of a
new variable: kernels_autodetect. If set to yes, we'll run the autodetection
bits and add any detected kernels to the already existing list *after* both
'kernel' and 'kernels'.
16:51:02 - r329732
(1 day 23 hours ago)
by mav
Affects: 
(91 files)
/head/cddl/contrib/opensolaris/*
/head/sys/cddl/contrib/opensolaris/*
/head/sys/conf/files
MFV r329502: 7614 zfs device evacuation/removal

illumos/illumos-gate@5cabbc6b49070407fb9610cfe73d4c0e0dea3e77

https://www.illumos.org/issues/7614:
This project allows top-level vdevs to be removed from the storage pool with
“zpool remove”, reducing the total amount of storage in the pool. This
operation copies all allocated regions of the device to be removed onto other
devices, recording the mapping from old to new location. After the removal is
complete, read and free operations to the removed (now “indirect”) vdev must
be remapped and performed at the new location on disk. The indirect mapping
table is kept in memory whenever the pool is loaded, so there is minimal
performance overhead when doing operations on the indirect vdev.

The size of the in-memory mapping table will be reduced when its entries
become “obsolete” because they are no longer used by any block pointers in
the pool. An entry becomes obsolete when all the blocks that use it are
freed. An entry can also become obsolete when all the snapshots that
reference it are deleted, and the block pointers that reference it have been
“remapped” in all filesystems/zvols (and clones). Whenever an indirect block
is written, all the block pointers in it will be “remapped” to their new
(concrete) locations if possible. This process can be accelerated by using
the “zfs remap” command to proactively rewrite all indirect blocks that
reference indirect (removed) vdevs.

Note that when a device is removed, we do not verify the checksum of the data
that is copied. This makes the process much faster, but if it were used on
redundant vdevs (i.e. mirror or raidz vdevs), it would be possible to copy
the wrong data, when we have the correct data on e.g. the other side of the
mirror. Therefore, mirror and raidz devices can not be removed.

Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Richard Laager <rlaager@wiktel.com>
Reviewed by: Tim Chase <tim@chase2k.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Prashanth Sreenivasa <pks@delphix.com>
16:50:41 - r329731
(1 day 23 hours ago)
by kevans
Affects:  /head/stand/lua/core.lua
/head/stand/lua/menu.lua
lualoader: Add boot environment support

This looks a little bit differently than the forth version for the time
being, just to get off the ground- rather than a paging system, it's
implemented as a simple carousel like the kernel selector.

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D14436
16:36:44 - r329730
(1 day 23 hours ago)
by ian
Affects:  /head/sys/modules/imx/imx_i2c/Makefile
Add required header files.

Reported by: andreast@
16:34:04 - r329729
(1 day 23 hours ago)
by ian
Affects:  /head/sys/modules/spi/at45d/Makefile
/head/sys/modules/spi/mx25l/Makefile
Remove some files that snuck in via cut and paste.

Having these compiled into the module causes the kobj method descriptors
to be resolved incorrectly (by the compile-time linker instead of the
kernel linker), which then leads to hours of frustrating debugging.
16:33:08 - r329728
(1 day 23 hours ago)
by kevans
Affects:  /head/stand/zfs/zfs.c
stand/zfs: Unbreak build, 'truct' ~= 'struct'
16:26:16 - r329727
(1 day 23 hours ago)
by kevans
Affects:  /head/stand/zfs/libzfs.h
/head/stand/zfs/zfs.c
stand/zfs: Add all bootenvs to environment

For the benefit of lualoader, add all bootenvs to environment when
init_zfs_bootenv is invoked. All of the boot environment logic can then be
implemented in pure lua, rather than going back and forth with C to
implement paging.

This stores all boot environments in bootenvs[idx] and the final count of
bootenvs in bootenvs_count.

While here, make a copy of currdev for init_zfs_bootenv since it will be
modifying it and the caller may not necessarily want that. Some of the logic
was shifted around so that the 'currdev' pointer remains at the beginning of
the string and 'beroot' is moved around as needed to modify it or ultimately
store it in zfs_be_root.

The original zfs_bootenv that this was copied from will be able to go away
only if/when forth eventually goes away.

Tested with: lualoader (and local changes to add boot env. support)
Tested with: forth
Reviewed by: cem (earlier version), imp
Differential Revision: https://reviews.freebsd.org/D14435
15:58:00 - r329726
(2 days ago)
by imp
Affects:  /head/stand/i386/loader/Makefile
/head/stand/i386/loader/conf.c
Honor settings for including / excluding cd9660, ufs, ext2fs and msdos.

The Makefile gives the impression that ext2fs and msdos were excluded
(they weren't) and that you could exclude cd9660 and ufs support (you
couldn't). Allow those to be excluded.

We need to look, in the future, at trimming the number of supported
filesystems, and this will make that easier.
15:57:36 - r329725
(2 days ago)
by imp
Affects: 
(9 files)
/head/stand/*
Consolidate three copies of ZFS commands into a central location.

There's no reason to have multiple copies of lszfs and
reloadbe. Consolidate them into one location. Also ldi_get_size is the
same everywhere (except sparc64). Make it the same everywhere as the
common definition is more general and will work on spar64.
15:57:24 - r329724
(2 days ago)
by trasz
Affects: 
(4 files)
/head/libexec/getty/*
Build getty(8) with WARNS=6.

Reviewed by: imp@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14197
15:54:23 - r329723
(2 days ago)
by emaste
Affects:  /head/usr.bin/ministat/ministat.c
ministat: disallow negative variance / nan Stddev

With all values identical it was possible for Var() to return a negative
value due to limited floating point precision, resulting in "nan"
reported as Stddev.

Variance cannot actually be negative, so just return 0. We can later
investigate alternate algorithms for calculating variance to reduce the
effect of catastrophic cancellation here.

Reported by: Arshan Khanifar <arshankhanifar_gmail.com>
Approved by: phk
Sponsored by: The FreeBSD Foundation
15:51:48 - r329722
(2 days ago)
by asomers
Affects:  /head/cddl/usr.sbin/zdb/Makefile
zdb: raise WARNS from 0 to 2

This has only been possible since r329694 and r329508

MFC after: 3 weeks
X-MFC-With: 329694
X-MFC-With: 329508
Sponsored by: Spectra Logic
15:15:58 - r329721
(2 days ago)
by nwhitehorn
Affects:  /head/sys/powerpc/include/spr.h
Add definition for the PowerPC A2.
15:15:31 - r329720
(2 days ago)
by nwhitehorn
Affects:  /head/sys/powerpc/include/pte.h
Add definitions for the new Radix MMU mode on POWER9+ CPUs.
15:12:14 - r329719
(2 days ago)
by avg
Affects: 
(6 files)
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
MFV r329718: 8520 7198 lzc_rollback_to should support rolling back to origin

illumos/illumos-gate@95643f75d23914a3e332adc9661ed51749e9858d
https://github.com/illumos/illumos-gate/commit/95643f75d23914a3e332adc9661ed51749e9858d

https://www.illumos.org/issues/8520
  lzc_rollback_to() should support rolling back to a clone's origin.
  The current checks in zfs_ioc_rollback() would not allow that because the
  origin snapshot belongs to a different filesystem.
  The overly restrictive check was introduced in 7600, but it was not a
  regression as none of the existing tools provided a way to rollback to the
  origin.

https://www.illumos.org/issues/7198
  EINVAL is returned when a dataset does not have any snapshots, so there is
  nothing to roll back to.
  Although the code in zfs_do_rollback checks for that condition in advance,
it's
  still possible that the snapshot(s) gets removed after the check and before
the
  rollback sync task is executed.
  At the moment zfs command would crash when that happens.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>
MFC after: 2 weeks
15:10:33 - r329718
(2 days ago)
by avg
Affects:  /vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c
/vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c
/vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c
8520 7198 lzc_rollback_to should support rolling back to origin

illumos/illumos-gate@95643f75d23914a3e332adc9661ed51749e9858d
https://github.com/illumos/illumos-gate/commit/95643f75d23914a3e332adc9661ed51749e9858d

https://www.illumos.org/issues/8520
  lzc_rollback_to() should support rolling back to a clone's origin.
  The current checks in zfs_ioc_rollback() would not allow that because the
  origin snapshot belongs to a different filesystem.
  The overly restrictive check was introduced in 7600, but it was not a
  regression as none of the existing tools provided a way to rollback to the
  origin.

https://www.illumos.org/issues/7198
  EINVAL is returned when a dataset does not have any snapshots, so there is
  nothing to roll back to.
  Although the code in zfs_do_rollback checks for that condition in advance,
it's
  still possible that the snapshot(s) gets removed after the check and before
the
  rollback sync task is executed.
  At the moment zfs command would crash when that happens.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>
15:07:49 - r329717
(2 days 1 hour ago)
by avg
Affects: 
(6 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/*
MFV r329715: 8997 ztest assertion failure in zil_lwb_write_issue

illumos/illumos-gate@f864f99efe57685e1762590c1a880dd16bca6da9
https://github.com/illumos/illumos-gate/commit/f864f99efe57685e1762590c1a880dd16bca6da9

https://www.illumos.org/issues/8997
  When dmu_tx_assign is called from zil_lwb_write_issue, it's possible
  for either ERESTART or EIO to be returned.
  If ERESTART is returned, this will cause an assertion to fail directly
  in zil_lwb_write_issue, where the code assumes the return value is
  EIO if dmu_tx_assign returns a non-zero value. This can occur if the
  SPA is suspended when dmu_tx_assign is called, and most often occurs
  when running zloop.
  If EIO is returned, this can cause assertions to fail elsewhere in the
  ZIL code. For example, zil_commit_waiter_timeout contains the
  following logic:
  lwb_t *nlwb = zil_lwb_write_issue(zilog, lwb);
  ASSERT3S(lwb->lwb_state, !=, LWB_STATE_OPENED);
  In this case, if dmu_tx_assign returned EIO from within
  zil_lwb_write_issue, the lwb variable passed in will not be issued
  to disk. Thus, it's lwb_state field will remain LWB_STATE_OPENED and
  this assertion will fail. zil_commit_waiter_timeout assumes that after
  it calls zil_lwb_write_issue, the lwb will be issued to disk, and
  doesn't handle the case where this is not true; i.e. it doesn't handle
  the case where dmu_tx_assign returns EIO.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>
MFC after: 3 weeks
14:37:49 - r329716
(2 days 1 hour ago)
by kevans
Affects:  /head/stand/lua/menu.lua
lualoader: Use the key that interrupts autoboot as a menu choice

This matches forth behavior. Hitting "6" when autobooting at the welcome
menu will now take you directly to the "Boot Options" menu.

We likely have some slight optimizations we should make, like not checking
autoboot every time we open a new menu and things of this nature. Further
work will go towards this end.
14:33:00 - r329715
(2 days 1 hour ago)
by avg
Affects: 
(5 files)
/vendor-sys/illumos/dist/uts/common/fs/zfs/*
8997 ztest assertion failure in zil_lwb_write_issue

illumos/illumos-gate@f864f99efe57685e1762590c1a880dd16bca6da9
https://github.com/illumos/illumos-gate/commit/f864f99efe57685e1762590c1a880dd16bca6da9

https://www.illumos.org/issues/8997
  When dmu_tx_assign is called from zil_lwb_write_issue, it's possible
  for either ERESTART or EIO to be returned.
  If ERESTART is returned, this will cause an assertion to fail directly
  in zil_lwb_write_issue, where the code assumes the return value is
  EIO if dmu_tx_assign returns a non-zero value. This can occur if the
  SPA is suspended when dmu_tx_assign is called, and most often occurs
  when running zloop.
  If EIO is returned, this can cause assertions to fail elsewhere in the
  ZIL code. For example, zil_commit_waiter_timeout contains the
  following logic:
  lwb_t *nlwb = zil_lwb_write_issue(zilog, lwb);
  ASSERT3S(lwb->lwb_state, !=, LWB_STATE_OPENED);
  In this case, if dmu_tx_assign returned EIO from within
  zil_lwb_write_issue, the lwb variable passed in will not be issued
  to disk. Thus, it's lwb_state field will remain LWB_STATE_OPENED and
  this assertion will fail. zil_commit_waiter_timeout assumes that after
  it calls zil_lwb_write_issue, the lwb will be issued to disk, and
  doesn't handle the case where this is not true; i.e. it doesn't handle
  the case where dmu_tx_assign returns EIO.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>
14:31:48 - r329714
(2 days 1 hour ago)
by avg
Affects: 
(2 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c
MFV r329713: 8731 ASSERT3U(nui64s, <=, UINT16_MAX) fails for large blocks

illumos/illumos-gate@a6c1eb3c08094a6db69aa1dc6315bc814e82e79c
https://github.com/illumos/illumos-gate/commit/a6c1eb3c08094a6db69aa1dc6315bc814e82e79c

https://www.illumos.org/issues/8731
  annotate_ecksum() asserts that nui64s, calculated as nui64s = size / sizeof
  (uint64_t), is not greater than UINT16_MAX.
  This restriction is needed because histograms of incorrectly set and cleared
  bits have 16 bit counters and if the buffer consists of too many 64-bit words,
  then a counter can potentially overflow producing an incorrect result.
  When the largest buffer size was 128KB the greatest value of nui64s was 16K,
  well within the limit.
  But now we have support for large buffers and for buffer sizes of 512KB and
  above the restriction is violated.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>
MFC after: 2 weeks
14:30:34 - r329713
(2 days 1 hour ago)
by avg
Affects:  /vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_fm.c
8731 ASSERT3U(nui64s, <=, UINT16_MAX) fails for large blocks

illumos/illumos-gate@a6c1eb3c08094a6db69aa1dc6315bc814e82e79c
https://github.com/illumos/illumos-gate/commit/a6c1eb3c08094a6db69aa1dc6315bc814e82e79c

https://www.illumos.org/issues/8731
  annotate_ecksum() asserts that nui64s, calculated as nui64s = size / sizeof
  (uint64_t), is not greater than UINT16_MAX.
  This restriction is needed because histograms of incorrectly set and cleared
  bits have 16 bit counters and if the buffer consists of too many 64-bit words,
  then a counter can potentially overflow producing an incorrect result.
  When the largest buffer size was 128KB the greatest value of nui64s was 16K,
  well within the limit.
  But now we have support for large buffers and for buffer sizes of 512KB and
  above the restriction is violated.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>
14:28:40 - r329712
(2 days 1 hour ago)
by wma
Affects: 
(9 files)
/head/sys/conf/files.powerpc
/head/sys/powerpc/*
PowerNV: Put processor to power-save state in idle thread

When processor enters power-save state it releases resources shared with other
cpu threads which makes other cores working much faster.

This patch also implements saving and restoring registers that might get
corrupted in power-save state.

Submitted by: Patryk Duda <pdk@semihalf.com>
Obtained from: Semihalf
Reviewed by: jhibbits, nwhitehorn, wma
Sponsored by: IBM, QCM Technologies
Differential revision: https://reviews.freebsd.org/D14330
14:17:07 - r329711
(2 days 1 hour ago)
by avg
Affects: 
(2 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
MFV r329710: 8966 Source file zfs_acl.c, function zfs_aclset_common contains a
use after end of the lifetime of a local variable

illumos/illumos-gate@82693e09cc02331fa1b3b73b54b1060e73507a8d
https://github.com/illumos/illumos-gate/commit/82693e09cc02331fa1b3b73b54b1060e73507a8d
https://www.illumos.org/issues/8966

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: WHR <msl0000023508@gmail.com>
PR: 225162
Submitted by: WHR <msl0000023508@gmail.com>
Reported by: WHR <msl0000023508@gmail.com>
MFC after: 1 week
14:12:29 - r329710
(2 days 1 hour ago)
by avg
Affects:  /vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_acl.c
8966 Source file zfs_acl.c, function zfs_aclset_common contains a use after end
of the lifetime of a local variable

illumos/illumos-gate@82693e09cc02331fa1b3b73b54b1060e73507a8d
https://github.com/illumos/illumos-gate/commit/82693e09cc02331fa1b3b73b54b1060e73507a8d

https://www.illumos.org/issues/8966

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: WHR <msl0000023508@gmail.com>
14:07:53 - r329709
(2 days 2 hours ago)
by kevans
Affects:  /head/stand/lua/core.lua
lualoader: Don't autodetect kernels if 'kernels' is explicitly set
14:05:13 - r329708
(2 days 2 hours ago)
by trasz
Affects:  /head/sys/cam/scsi/scsi_cd.c
Use proper buffer length (the announce_buf char pointer used to be anarray),
broken in r317143. This fixes those weird "cd0: Attempt" messages at boot.

PR: 222103
Reviewed by: scottl@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14369
11:31:29 - r329707
(2 days 4 hours ago)
by kib
Affects: 
(2 files)
/stable/10/sys/vm/vm_fault.c
MFC r329254:
Ensure memory consistency on COW.
11:29:07 - r329706
(2 days 4 hours ago)
by kib
Affects: 
(2 files)
/stable/11/sys/vm/vm_reserv.c
MFC r329256:
Cleanup unused page argument for vm_reserv_break().
11:28:05 - r329705
(2 days 4 hours ago)
by kib
Affects: 
(2 files)
/stable/11/sys/vm/vm_fault.c
MFC r329254:
Ensure memory consistency on COW.
11:26:59 - r329704
(2 days 4 hours ago)
by kib
Affects: 
(2 files)
/stable/11/sys/vm/vm_fault.c
MFC r329252:
Do not call pmap_enter() with invalid protection mode.
10:13:17 - r329703
(2 days 5 hours ago)
by hselasky
Affects:  /head/sys/compat/linux/linux_mmap.c
Allow LinuxKPI character devices to receive mmap() calls from the Linux
binary mode user-space emulation layer. This is a regression issue after
r328436, when LinuxKPI character devices started to use DTYPE_DEV in
the "f_type" field of the associated file structure(s).

MFC after: 3 days
Found by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
08:13:17 - r329702
(2 days 7 hours ago)
by wma
Affects:  /head/sys/powerpc/powernv/opal_dev.c
PowerNV: add missing RTC_WRITE support

Add function which can store RTC values to OPAL.

Submitted by: Wojciech Macek <wma@semihalf.org>
Obtained from: Semihalf
Sponsored by: IBM, QCM Technologies
08:05:56 - r329701
(2 days 8 hours ago)
by wma
Affects:  /head/sys/dev/cxgbe/adapter.h
CXGBE: implement prefetch on non-Intel architectures

Submitted by: Michal Stanek <mst@semihalf.com>
Obtained from: Semihalf
Reviewed by: np, pdk@semihalf.com
Sponsored by: IBM, QCM Technologies
Differential revision: https://reviews.freebsd.org/D14452
05:04:58 - r329700
(2 days 11 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
/head/stand/lua/menu.lua
lualoader: Allow carousel 'items' to be a table as well as a function

We don't have any in-tree users of this, but for a static set of carousel
options having to define a callback is excessive.
04:48:37 - r329699
(2 days 11 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
/head/stand/lua/menu.lua
lualoader: Simplify menu definitions a little further

Allow "name" entries to be simple strings, instead of just functions. We
know whether we support colors or not by the time any of this is setup, so
all menu names that are basically static with colors sprinkled in are good
candidates for simplification.

Also simplify "func" in many cases where it's just invoking another function
with no arguments. The downside to this simplification is that the functions
called can no longer be trivially replaced by a local module. The upside is
that it removes another layer of indirection that we likely don't need.

These can be re-evaluated later if a compelling argument is raised, on a
case-by-case basis, for replacement.
04:23:13 - r329698
(2 days 11 hours ago)
by kevans
Affects:  /head/stand/lua/menu.lua
lualoader: Directly reference submenu definition with submenu key
04:14:32 - r329697
(2 days 11 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
/head/stand/lua/menu.lua
lualoader: Drop name requirement for menu separators
03:37:46 - r329696
(2 days 12 hours ago)
by kevans
Affects:  /head/stand/lua/menu.lua
lualoader: Add "menu.default", initialized to menu.welcome

The intent here is to abstract away the name of the default menu. The
default menu is still the welcome menu, but this detail doesn't need to
matter to things outside of the menu module. You may change the default
menu, but one would need to modify a specific menu.
03:34:33 - r329695
(2 days 12 hours ago)
by jhibbits
Affects:  /head/sys/powerpc/powerpc/trap.c
Split printtrap() into generic and CPU-specific components

Summary:
This compartmentalizes the CPU-specific trap components into its own
function, rather than littering the general printtrap() with various checks.
This will let us replace a series of #ifdef's with a runtime conditional check
in the future.

Reviewed By: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D14416
03:08:47 - r329694
(2 days 12 hours ago)
by mav
Affects: 
(10 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/*
MFV r324198: 8081 Compiler warnings in zdb

illumos/illumos-gate@3f7978d02b206a6ebc5652c91aa9f42da6fbe00c
https://github.com/illumos/illumos-gate/commit/3f7978d02b206a6ebc5652c91aa9f42da6fbe00c

https://www.illumos.org/issues/8081
  zdb(8) is full of minor problems that generate compiler warnings. On FreeBSD,
  which uses -WError, the only way to build it is to disable all compiler
  warnings. This makes it much harder to detect newly introduced bugs. We should
  cleanup all the warnings.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Alan Somers <asomers@gmail.com>
03:06:36 - r329693
(2 days 13 hours ago)
by kevans
Affects:  /head/stand/lua/core.lua
lualoader: Return only argstr if with_kernel not requested
02:35:13 - r329692
(2 days 13 hours ago)
by kevans
Affects:  /head/stand/lua/loader.lua
lualoader: Bring in local.lua module if it exists

Provide a way for out-of-tree users of lualoader to patch into the loader
system without having to modify our distributed scripts.

Do note that we can't really offer any API compatibility guarantees at this
time due to the evolving nature of lualoader right now.

This still has some utility as local modules may add commands at the loader
prompt without relying heavily on lualoader features- this specific
functionality is less likely to change without more careful consideration.

Reviewed by: cem (earlier version)
Differential Revision: https://reviews.freebsd.org/D14439
02:21:22 - r329691
(2 days 13 hours ago)
by mav
Affects: 
(3 files)
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
MFV r322231:
8430 dir_is_empty_readdir() doesn't properly handle error from fdopendir()

illumos/illumos-gate@ba6e7e6505150388de6dc6a88741164118a421bf
https://github.com/illumos/illumos-gate/commit/ba6e7e6505150388de6dc6a88741164118a421bf

https://www.illumos.org/issues/8430
  we should close dirfd if fdopendir() fails.

Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Sowrabha Gopal <sowrabha.gopal@delphix.com>
02:19:42 - r329690
(2 days 13 hours ago)
by mav
Affects: 
(9 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/*
/head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
/head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h
MFV r319737: 6939 add sysevents to zfs core for commands

illumos/illumos-gate@ce1577b04976f1d8bb5f235b6eaaab15b46a3068
https://github.com/illumos/illumos-gate/commit/ce1577b04976f1d8bb5f235b6eaaab15b46a3068

https://www.illumos.org/issues/6939
  Originally created https://smartos.org/bugview/OS-4489
  sysevents should be fired in the kernel from ZFS whenever a command
  is run that is logged in zpool history.
  Example output
  Terminal 1
  root - gz sunos ~ # zfs create zones/foobar
  root - gz sunos ~ # zfs set quota=10g zones/foobar
  root - gz sunos ~ # zfs destroy zones/foobar
  Terminal 2
  root - gz sunos ~ # sysevent EC_zfs
  nvlist version: 0
  date = 2016-04-28T14:50:08.964Z
  vendor = SUNW
  publisher = zfs
  class = EC_zfs
  subclass = ESC_ZFS_history_event
  pid = 0
  data = (embedded nvlist)
  nvlist version: 0
  pool_name = zones
  pool_guid = 0x40c964e8f9a7a694
  history_record = (embedded nvlist)
  nvlist version: 0
  dsname = zones/foobar
  dsid = 0x1525
  history internal str =
  internal_name = create
  history txg = 0x4c4ef3

Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Joshua M. Clulow <jmc@joyent.com>
Reviewed by: Josh Wilsdon <jwilsdon@joyent.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed by: Alan Somers <asomers@gmail.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Dave Eddy <dave@daveeddy.com>
01:52:42 - r329689
(2 days 14 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
lualoader: Output "Failed to parse" messages

I can't find any good reason these aren't enabled, so enable them.

The silent runs will only return false on actual parse errors, so it's ok to
be loud about those failures.
01:50:46 - r329688
(2 days 14 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
lualoader: Don't return false for failure to open config on silent parse
01:39:33 - r329687
(2 days 14 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
/head/stand/lua/core.lua
/head/stand/lua/menu.lua
lualoader: Drop explicit boolean tests; b or not b
01:37:22 - r329686
(2 days 14 hours ago)
by kevans
Affects:  /head/share/man/man9/style.lua.9
style.lua(9): Drop notes about semicolons

It is generally agreed upon that they are ugly and should not be used except
where needed.
01:35:19 - r329685
(2 days 14 hours ago)
by kevans
Affects: 
(8 files)
/head/stand/lua/*
lualoader: Drop excessive parenthesizing

This was also a convenience convention (for me) that is not very lua-tic.
Drop it.

I've maintained some parentheses where I'd prefer them, for example,
'if x or y or (z and w) then', but these situations are far and few between.
01:10:03 - r329684
(2 days 14 hours ago)
by kevans
Affects: 
(8 files)
/head/stand/lua/*
lualoader: Drop terminating semicolons

This was previously chosen out of convenience, as we had a mixed style and
needed to be consistent. I started learning Lua on Friday, so I switched
everything over. It is not a very lua-nic convention, though, so drop it.

Excessive parenthesizing around conditionals is next on the chopping block.
00:24:54 - r329683
(2 days 15 hours ago)
by mav
Affects: 
(2 files)
/head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h
MFV r319736: 6396 remove SVM

illumos/illumos-gate@5f10ef697f250374b7b917e10961c4e02d4e3112
https://github.com/illumos/illumos-gate/commit/5f10ef697f250374b7b917e10961c4e02d4e3112

https://www.illumos.org/issues/6396
  LVM = SVM = Solaris Volume Manager
  dead code and not using with ZFS based platform.

Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: Yuri Pankov <yuri.pankov@nexenta.com>
00:19:02 - r329682
(2 days 15 hours ago)
by rpokala
Affects:  /head/usr.sbin/mountd/mountd.c
mountd: Return proper errno values in a few error paths

When attempting to mount a non-directory which exists, return ENOTDIR instead
of ENOENT. If stat() or statfs() failed, don't pass part of the invalid
(struct statfs) to ex_search(). In that same case, preserve the value of "bad"
rather than overwriting with EACCES.

Submitted by: Bruce Leverett (Panasas)
Reviewed by: rmacklem
MFC after: 1 week
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D14438
00:18:57 - r329681
(2 days 15 hours ago)
by mav
Affects: 
(15 files)
/head/cddl/contrib/opensolaris/*
/head/cddl/usr.sbin/zfsd/case_file.cc
/head/sys/cddl/contrib/opensolaris/*
MFV r318941: 7446 zpool create should support efi system partition

illumos/illumos-gate@7855d95b30fd903e3918bad5a29b777e765db821
https://github.com/illumos/illumos-gate/commit/7855d95b30fd903e3918bad5a29b777e765db821

https://www.illumos.org/issues/7446
  Since we support whole-disk configuration for boot pool, we also will need
  whole disk support with UEFI boot and for this, zpool create should create
efi-
  system partition.
  I have borrowed the idea from oracle solaris, and introducing zpool create -
  B switch to provide an way to specify that boot partition should be created.
  However, there is still an question, how big should the system partition be.
  For time being, I have set default size 256MB (thats minimum size for FAT32
  with 4k blocks). To support custom size, the set on creation "bootsize"
  property is created and so the custom size can be set as: zpool create B -
  o bootsize=34MB rpool c0t0d0
  After pool is created, the "bootsize" property is read only. When -B switch is
  not used, the bootsize defaults to 0 and is shown in zpool get output with
  value ''. Older zfs/zpool implementations are ignoring this property.
  https://www.illumos.org/rb/r/219/

Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: Dan McDonald <danmcd@kebe.com>
Author: Toomas Soome <tsoome@me.com>

This commit makes no sense for FreeBSD, that is why I blocked the option,
but it should be good to stay closer to upstream.
2018 - 02 - 20   (3 days ago)
22:47:49 - r329680
(2 days 17 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
lualoader: When restoring environment, only restore unchanged vars

Track the latest value we've set an environment variable to, and only
restore those that are unchanged from that.

This gives us some leeway to make sure we're not clobbering variables
overwritten by menu changes.
22:03:08 - r329679
(2 days 18 hours ago)
by bdrewery
Affects:  /head/Makefile.inc1
Properly lookup values if they were empty.

Spotted by: rpokala
X-MFC-With: r329676
MFC after: 2 weeks
Sponsored by: Dell EMC
22:03:04 - r329678
(2 days 18 hours ago)
by bdrewery
Affects:  /head/Makefile.inc1
Only lookup SVN once and rename to SVN_CMD.

MFC after: 2 weeks
Sponsored by: Dell EMC
21:53:39 - r329677
(2 days 18 hours ago)
by bdrewery
Affects:  /head/Makefile.inc1
Avoid looking up VCS_REVISION for every sub-make call to Makefile.inc1.

MFC after: 2 weeks
Sponsored by: Dell EMC
21:48:16 - r329676
(2 days 18 hours ago)
by bdrewery
Affects:  /head/Makefile.inc1
/head/share/mk/bsd.own.mk
Move SVNVERSION_CMD into the one place that uses it.

This code, which is basically `svnversion || svnliteversion`, generates
2 fstatat(2) for every directory in PATH for every Makefile parsed that
includes bsd.own.mk. This can add up for things like generating a Ports
index (Poudriere) or building a dependency graph for base.

Sponsored by: Dell EMC
MFC after: 2 weeks
21:42:45 - r329675
(2 days 18 hours ago)
by np
Affects:  /head/sys/dev/cxgbe/t4_netmap.c
/head/sys/net/iflib.c
Catch up with the removal of nktr_slot_flags from upstream netmap. No
functional impact intended.

Submitted by: Vincenzo Maffione <v.maffione@gmail.com>
21:37:55 - r329674
(2 days 18 hours ago)
by kevans
Affects:  /head/stand/lua/core.lua
lualoader: Intercept the 'autoboot' cli command
21:32:36 - r329673
(2 days 18 hours ago)
by kevans
Affects:  /head/stand/lua/core.lua
/head/stand/lua/menu.lua
lualoader: Intercept boot cli command

This should be functional and roughly equivalent to the Forth version.

Stop doing a loadelf() on menu exit now that we can DTRT with boot
invocations. autoboot interception will follow not long after.
21:27:17 - r329672
(2 days 18 hours ago)
by jeff
Affects:  /head/sys/kern/vfs_bio.c
Fix the broken subqueue assignment for the cleanq.

Reported by: pho
Tested by: pho
Sponsored by: Netflix, Dell/EMC Isilon
21:23:01 - r329671
(2 days 18 hours ago)
by kevans
Affects:  /head/stand/lua/core.lua
lualoader: Prepare for interception of "boot" CLI cmd

core.boot and core.autoboot may both take arguments; add a helper to cleanly
append an argstring to the given loader command.

Also provide a popFrontTable() that we'll use pop the command name off of an
argv table. We don't have the table library included, and including it is
non-trivial, so we'll implement this one function that we need in lua for
the time being.
21:15:43 - r329670
(2 days 18 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
lualoader: Don't try so hard to load a kernel

If the user's selected a kernel, we really should be trying to load that one
instead of falling back to some default kernel.

This should generally be a no-op and most desirable, unless you really
enjoyed surprises.
21:13:21 - r329669
(2 days 18 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
lualoader: Prefer selected kernel to currently loaded
20:46:27 - r329668
(2 days 19 hours ago)
by mav
Affects: 
(3 files)
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c
MFV r316918: 7990 libzfs: snapspec_cb() does not need to call zfs_strdup()

illumos/illumos-gate@d8584ba6fb7a5e46da1725845b99ae5fab5a4baf
https://github.com/illumos/illumos-gate/commit/d8584ba6fb7a5e46da1725845b99ae5fab5a4baf

https://www.illumos.org/issues/7990
  The snapspec_cb() callback function in libzfs does not need to call
zfs_strdup().

Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Marcel Telka <marcel@telka.sk>
20:40:55 - r329667
(2 days 19 hours ago)
by mav
Affects: 
(4 files)
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
/head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
MFV r316902: 7745 print error if lzc_* is called before libzfs_core_init

illumos/illumos-gate@7c13517fff71be473e47531ef4330160c042bedc
https://github.com/illumos/illumos-gate/commit/7c13517fff71be473e47531ef4330160c042bedc

https://www.illumos.org/issues/7745
  The problem is that consumers of `libZFS_Core` that forget to call
  `libzfs_core_init()` before calling any other function of the library
  are having a hard time realizing their mistake. The library's internal
  file descriptor is declared as global static, which is ok, but it is not
  initialized explicitly; therefore, it defaults to 0, which is a valid
  file descriptor. If `libzfs_core_init()`, which explicitly initializes
  the correct fd, is skipped, the ioctl functions return errors that do
  not have anything to do with `libZFS_Core`, where the problem is
  actually located.
  Even though assertions for that existed within `libZFS_Core` for debug
  builds, they were never enabled because the `-DDEBUG` flag was missing
  from the compiler flags.
  This patch applies the following changes:
  1. It adds `-DDEBUG` for debug builds of `libZFS_Core` and `libzfs`,
  to enable their assertions on debug builds.
  2. It corrects an assertion within `libzfs`, where a function had
  been spelled incorrectly (`zpool_prop_unsupported()`) and nobody
  knew because the `-DDEBUG` flag was missing, and the preprocessor
  was taking that part of the code away.
  3. The library's internal fd is initialized to `-1` and `VERIFY`
  assertions have been placed to check that the fd is not equal to
  `-1` before issuing any ioctl. It is important here to note, that
  the `VERIFY` assertions exist in both debug and non-debug builds.
  4. In `libzfs_core_fini` we make sure to never increment the
  refcount of our fd below 0, and also reset the fd to `-1` when no
  one refers to it. The reason for this, is for the rare case that
  the consumer closes all references but then calls one of the
  library's functions without using `libzfs_core_init()` first, and
  in the mean time, a previous call to `open()` decided to reuse
  our previous fd. This scenario would have passed our assertion in

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>
20:39:34 - r329666
(2 days 19 hours ago)
by mjg
Affects:  /head/sys/kern/kern_mutex.c
mtx: add debug assertions to mtx_spin_wait_unlocked
20:37:01 - r329665
(2 days 19 hours ago)
by mav
Affects: 
(3 files)
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
MFV r316901:
7730 libzfs`add_config() leaks config nvl when reading spare/l2cache devices

illumos/illumos-gate@105686550ee9cbf5d033166a8a2a5a763667d436
https://github.com/illumos/illumos-gate/commit/105686550ee9cbf5d033166a8a2a5a763667d436

https://www.illumos.org/issues/7730
  antares:root:~# mdb /usr/sbin/zpool
  > ::sysbp _exit
  > ::run import
  pool: data
  id: 2093977168778024605
  state: ONLINE
  action: The pool can be imported using its name or numeric identifier.
  config:

  data ONLINE
  c6t0d0 ONLINE
  c6t1d0 ONLINE
  cache
  c6t2d0
  mdb: stop on entry to _exit
  mdb: target stopped at:
  0xfee556ba: nop
  mdb: You've got symbols!
  Loading modules: [ ld.so.1 libumem.so.1 libc.so.1 libtopo.so.1 libavl.so.1
  libnvpair.so.1 ]
  > ::findleaks -d
  BYTES LEAKED VMEM_SEG CALLER
  4096 10 fda7b000 MMAP
  8192 1 fea8d000 MMAP
  8192 1 fe76d000 MMAP
  8192 1 fe66e000 MMAP
  4096 1 fe570000 MMAP
  8192 1 fe470000 MMAP
  4096 1 fe372000 MMAP
  4096 1 fe273000 MMAP

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>
20:34:04 - r329664
(2 days 19 hours ago)
by mav
Affects: 
(3 files)
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
MFV r316893:
7604 if volblocksize property is the default, it displays as "-" rather than 8K

illumos/illumos-gate@4d86c0eab246bdfddc2dd52410ba808433bd6266
https://github.com/illumos/illumos-gate/commit/4d86c0eab246bdfddc2dd52410ba808433bd6266

https://www.illumos.org/issues/7604
  If a zvol has the default setting for the "volblocksize" property, it is
  8KB. However, it is displayed as "-" (not present), rather than "8K".
  The problem was introduced by:
  commit 25228e830e86924a41243343b1de9daf2d7dd43a
  Author: Matthew Ahrens &lt;mahrens@delphix.com&gt;
  Date: Thu Nov 17 14:37:24 2016 -0800
  7571 non-present readonly numeric ZFS props do not have default value
  which changed changed get_numeric_property() to indicate that readonly
  default properties are not present. However, zfs_prop_readonly() returns
  TRUE for both readonly and set-once properties (e.g. volblocksize).
  Amusingly, that commit essentially reverted:
  6900484 default volblocksize is no longer being reported correctly
  from November 2009. However, that change was not correct either; the
  correct solution is to only do this check for "truly readonly" (i.e. not
  setonce) properties.
  $ zfs list -t volume -o name,volblocksize
  NAME
  VOLBLOCK
  domain0/group-100/appdata_container-101/appdata_windows_timeflow-102/
  archive -
  domain0/group-100/appdata_container-101/appdata_windows_timeflow-102/
  datafile -
  domain0/group-100/appdata_container-101/appdata_windows_timeflow-102/
  external -
  rpool/dump
  128K
  rpool/swap
  4K
  rpool/swap1

===============================================================================

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>
20:30:40 - r329663
(2 days 19 hours ago)
by mav
Affects: 
(4 files)
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
MFV r316876: 7542 zfs_unmount failed with EZFS_UNSHARENFSFAILED

illumos/illumos-gate@09c9e6dc9b69d10b771bb87e01040ec320a0bfd3
https://github.com/illumos/illumos-gate/commit/09c9e6dc9b69d10b771bb87e01040ec320a0bfd3

https://www.illumos.org/issues/7542
  libshare keeps a cached copy of the sharetab listing in memory, which can
  become out of date if shares are destroyed or created while leaving a libzfs
  handle open. This results in a spurious unmounting failure when an NFS share
  exists but isn't in the stale libshare cache.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matt Amdur <matt.amdur@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Chris Williamson <chris.williamson@delphix.com>
20:29:41 - r329662
(2 days 19 hours ago)
by kevans
Affects:  /head/stand/lua/loader.lua
lualoader: Replace invalid construct with valid construct

It only worked by coincidence, but it did work. Store varargs in a table
instead and work off of that.
20:26:48 - r329661
(2 days 19 hours ago)
by mav
Affects: 
(3 files)
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
MFV r316875: 7336 vfork and O_CLOEXEC causes zfs_mount EBUSY

illumos/illumos-gate@873c4903a52d089cd8234b79d24f5a3fc3bccc82
https://github.com/illumos/illumos-gate/commit/873c4903a52d089cd8234b79d24f5a3fc3bccc82

https://www.illumos.org/issues/7336
  We can run into a problem where we call into zfs_mount, which in turn calls
  is_dir_empty, which opens the directory to try and make sure it's empty. The
  issue with the current approach is that it holds the directory open while it
  traverses it with readdir, which, due to subtle interaction with the Java JVM,
  vfork, and exec can cause a tricky race condition resulting in zfs_mount
  failures.
  The approach to resolving the issue in this patch is to drop the usage of
  readdir altogether, and instead rely on the fact that ZFS stores the number of
  entries contained in a directory using the st_size field of the stat
structure.
  Thus, if the directory in question is a ZFS directory, we can check to see if
  it's empty by calling stat() and inspecting the st_size field of structure
  returned.

===============================================================================
  The root cause appears to be an interesting race between vfork, exec, and
  zfs_mount's usage of O_CLOEXEC when calling openat. Here's what is going on:
  1. We call zfs_mount, and this in turn calls openat to check if the directory
  is empty, which results in opening the directory we're trying to mount onto,
  and increment v_count.
  2. As we're in the middle of reading the directory, vfork is called by the JVM
  and proceeds to exec the jspawnhelper utility. As a result of the vfork, we
  take an additional hold on the directory, which increments v_count a second
  time. The semantics of vfork mean the parent process will wait for the child
  process to exit or exec before the parent can continue; at this point the
  parent is in the middle of zfs_mount, reading the directory to determine if
  it's empty or not.
  3. The child process exec-ing jspawnhelper gets to the relvm call within
  exec_args (which is called by exec_common). relvm is the function that
releases
  the parent process, allowing the parent to proceed. The problem is, at this
  point of calling relvm, the child hasn't yet called close_exec which is
  responsible for closing the file descriptors inherited from the parent process

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Prakash Surya <prakash.surya@delphix.com>
20:19:38 - r329660
(2 days 19 hours ago)
by mjg
Affects:  /head/sys/kern/sys_procdesc.c
Fix reaping on process fd close broken after r329449

The only consumer of proc_reap other than proc_to_reap was not updated
to not PROC_SLOCK.

Reported by: Juan Ramon Molina Menor <listjm club.fr>
20:17:19 - r329659
(2 days 19 hours ago)
by mav
Affects: 
(3 files)
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
MFV r316873: 7233 dir_is_empty should open directory with CLOEXEC

illumos/illumos-gate@d420209d9c807f782c1d31f5683be74798142198
https://github.com/illumos/illumos-gate/commit/d420209d9c807f782c1d31f5683be74798142198

https://www.illumos.org/issues/7233
  This fixes a race where one thread is executing zfs_mount() while another
  thread forks and execs. If the fork occurs while the directory is open, the
  child process will inherit (but not necessarily close immediately) the open fd
  for the directory, preventing the mount.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Alex Reece <alex@delphix.com>
20:14:11 - r329658
(2 days 19 hours ago)
by mav
Affects: 
(2 files)
/head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
MFV r316872: 7502 ztest should run zdb with -G (debug mode)

illumos/illumos-gate@c3c65d17f7b6689bbd6568a1a1fcc0c4a3bac127
https://github.com/illumos/illumos-gate/commit/c3c65d17f7b6689bbd6568a1a1fcc0c4a3bac127

https://www.illumos.org/issues/7502
  Right now ztest executes zdb without -G, so when it has errors, the messages
  are often not very helpful:
  Executing zdb -bccsv -d -U /rpool/tmp/zpool.cache ztest
  zdb: can't open 'ztest': Operation not supported
  ztest: '/usr/sbin/amd64/zdb -bccsv -d -U /rpool/tmp/zpool.cache ztest' exit
  code 1
  With -G, we'd have:
  /usr/sbin/amd64/zdb -bccsv -d -U /rpool/tmp/zpool.cache -G ztest
  zdb: can't open 'ztest': Operation not supported

  ZFS_DBGMSG(zdb):
  spa_open_common: opening ztest
  spa_load(ztest): LOADING
  spa_load(ztest): FAILED: unable to parse config [error=48]
  spa_load(ztest): UNLOADING
  Which indicates where the error came from

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
19:54:06 - r329657
(2 days 20 hours ago)
by asomers
Affects:  /head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
Fix memory leaks in zdb introduced by r329508

Reported by: Coverity
CID: 1386185
MFC after: 3 weeks
X-MFC-With: 329508
Sponsored by: Spectra Logic Corp
19:39:48 - r329656
(2 days 20 hours ago)
by cem
Affects: 
(4 files)
/head/stand/common/interp_lua.c
/head/stand/liblua/*
loader.lua: Expose errno table to lua

Reviewed by: kevans
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14454
19:33:33 - r329655
(2 days 20 hours ago)
by n_hibma
Affects: 
(2 files)
/stable/11/sbin/ipfw/ipfw.8
Merge rev. 329197 from HEAD:

 DSCP values passed to setdscp need to be lowercase.
19:21:34 - r329654
(2 days 20 hours ago)
by kevans
Affects:  /head/stand/lua/core.lua
/head/stand/lua/menu.lua
lualoader: Ignore ACPI bits on !i386
18:45:38 - r329653
(2 days 21 hours ago)
by asomers
Affects:  /projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_008_pos.ksh
/projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_test.sh
Fix zfs_mount_008_pos

tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_008_pos.ksh
  Illumos syntax => FreeBSD syntax. All FreeBSD mounts are the
  equivalent of Illumos's overlay mounts.

tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_test.sh
  Don't skip this test.

Sponsored by: Spectra Logic Corp
18:42:08 - r329652
(2 days 21 hours ago)
by asomers
Affects: 
(4 files)
/projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_get/*
/projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_mount/*
Update ZFS tests now that PR 221985 is fixed

tests/sys/cddl/zfs/tests/cli_root/zfs_get/zfs_get_003_pos.ksh
tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_007_pos.ksh
  Convert Illumos syntax => FreeBSD syntax

tests/sys/cddl/zfs/tests/cli_root/zfs_get/zfs_get_test.sh
  Clear expected failure for zfs_get_003_pos

tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_007_pos.ksh
  Remove the "devices" property. Unlike on Illumos, on FreeBSD it
  can't be changed temporarily (or at all).

tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_test.sh
  Remove the expected failure for zfs_mount_007_pos due to 221985, but
  add a new expected failure due to PR 115361.

PR: 221985
PR: 115361
Sponsored by: Spectra Logic Corp
18:33:45 - r329651
(2 days 21 hours ago)
by shurd
Affects:  /head/sys/net/iflib.c
IFLIB: do not remove dmamap on buffer unload

Dmamap is created only on IFC attach. If we remove it on
buffer release, we won't be able to do ifconfig down&up. Only destroy
when in detach.

Reported by: wma
Reviewed by: wma
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14060
18:24:20 - r329650
(2 days 21 hours ago)
by kevans
Affects:  /head/stand/liblua/lutils.c
liblua: Add loader.machine and loader.machine_arch properties

Provisioned from MACHINE/MACHINE_ARCH on the system, expose loader.machine
and loader.machine_arch respectively.

These may be used to hide ACPI option on non-applicable archs.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D14446
18:21:30 - r329649
(2 days 21 hours ago)
by cem
Affects:  /head/stand/liblua/lfs.c
Lua lfs.attributes: Provide a more consistent error return

In the remaining error case, return a 3-tuple consistent with the other
error return case.

Document how to invoke lfs.attributes() and detect/decode error return in
example comments.

Reviewed by: kevans
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14451
18:12:07 - r329648
(2 days 21 hours ago)
by gonzo
Affects: 
(2 files)
/stable/11/sys/arm/allwinner/if_awg.c
MFC r325410:

Increase TX_MAX_SEGS from 10 to 20 for the if_awg.c driver

Under certain traffic pattern awg driver does not recover from TX queue
full condition. The actual source of the problem is not identified yet
but jmcneill@ agreed that bumping TX_MAX_SEGS to 20 is OK as a workaround
for the problem (NetBSD has it set to 128).

Also add some diagnostic printfs to prevent silent failure of bus_dma
functions in the future

PR will be kept open until root cause of the issue is identified and fixed

PR: 219927
Submitted by: Tom Vijlbrief <tvijlbrief@gmail.com>
Approved by: jmcneill
18:08:57 - r329647
(2 days 21 hours ago)
by brooks
Affects: 
(4 files)
/head/sys/compat/freebsd32/*
/head/sys/kern/kern_syscalls.c
/head/sys/sys/sysent.h
Reduce duplication in dynamic syscall registration code.

Remove the unused syscall_(de)register() functions in favor of the
better documented and easier to use syscall_helper_(un)register(9)
functions.

The default and freebsd32 versions differed in which array of struct
sysents they used and a few missing updates to the 32-bit code as
features were added to the main code.

Reviewed by: cem
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14337
18:05:21 - r329646
(2 days 22 hours ago)
by kevans
Affects:  /head/stand/lua/loader.lua
lualoader: Eliminate global namespace pollution in loader.lua
18:04:08 - r329645
(2 days 22 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
/head/stand/lua/drawer.lua
/head/stand/lua/menu.lua
lualoader: Move carousel storage out into config

Carousel storage doesn't need to happen in the menu module, and indeed
storing it there introduces a circular reference between drawer and menu
that only works because of global pollution in loader.lua.

Carousel choices generally map to config entries anyways, making it as good
of place as any to store these. Move {get,set}CarouselIndex functionality
out into config so that drawer and menu may both use it. If we had more
carousel functionality, it might make sense to create a carousel module, but
this is not the case.
17:46:50 - r329644
(2 days 22 hours ago)
by kevans
Affects:  /head/stand/common/interp_lua.c
/head/stand/lua/loader.lua
lualoader: Add ability to intercept cli commands

If we failed to execute the input line as pure lua, run the command through
parse for consistent argument parsing. Pass the parsed arguments through to
a global "cli_execute" written in Lua, which is expected to either handle it
or pass it back through to interp_builtin_cmd (via loader.command).

lua-handled cli commands will then exist as globals in whatever module they
most belong in, and invocations at the loader prompt will magically dispatch
to them if they exist.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D14450
17:28:59 - r329643
(2 days 22 hours ago)
by imp
Affects:  /head/stand/liblua/lutils.c
Implement loader.command

This is just like loader.perform, except it takes pre-parsed arguments.

Review: https://reviews.freebsd.org/D14448
14:59:29 - r329642
(3 days 1 hour ago)
by ian
Affects:  /head/sys/arm/freescale/imx/imx6_ccmreg.h
Adjust whitespace of things added in the past couple years to match the
original style of the file. No functional changes.
14:45:58 - r329641
(3 days 1 hour ago)
by kevans
Affects: 
(7 files)
/head/stand/lua/*
stand/lua: Consistently organize modules

We follow pretty closely the following structure of a module:

1. Copyright notice
2. Module requires
3. Module local declarations
4. Module local definitions
5. Module exports
6. return

Re-organize the one-offs (config/drawer) and denote the start of module
exports with a comment.
14:36:28 - r329640
(3 days 1 hour ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
/head/stand/lua/menu.lua
/head/stand/lua/screen.lua
stand/lua: Consistently declare local functions at module scope

Declare these adjacent to the local definitions at the top of the module,
and make sure they're actually declared local to pollute global namespace a
little bit less.
10:52:07 - r329639
(3 days 5 hours ago)
by mjg
Affects:  /head/sys/kern/kern_sig.c
Make killpg1 perform process validity checks without proc lock held.
10:35:13 - r329638
(3 days 5 hours ago)
by kib
Affects: 
(2 files)
/stable/11/sys/compat/linuxkpi/common/include/linux/mm.h
MFC r329216:
linuxkpi: Do not leak pages on put.
10:34:15 - r329637
(3 days 5 hours ago)
by kib
Affects: 
(2 files)
/stable/11/sys/vm/vm_reserv.c
MFC r329215:
Do not leak rv->psind in some specific situations.
10:13:13 - r329636
(3 days 5 hours ago)
by kib
Affects: 
(22 files)
/head/sys/*
vm_wait() rework.

Make vm_wait() take the vm_object argument which specifies the domain
set to wait for the min condition pass. If there is no object
associated with the wait, use curthread' policy domainset. The
mechanics of the wait in vm_wait() and vm_wait_domain() is supplied by
the new helper vm_wait_doms(), which directly takes the bitmask of the
domains to wait for passing min condition.

Eliminate pagedaemon_wait(). vm_domain_clear() handles the same
operations.

Eliminate VM_WAIT and VM_WAITPFAULT macros, the direct functions calls
are enough.

Eliminate several control state variables from vm_domain, unneeded
after the vm_wait() conversion.

Scetched and reviewed by: jeff
Tested by: pho
Sponsored by: The FreeBSD Foundation, Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D14384
07:30:57 - r329635
(3 days 8 hours ago)
by wma
Affects:  /head/sys/powerpc/powerpc/clock.c
PowerPC: Switch to more accurate unit to avoid division rounding

On POWER8 architecture there is a timer with 512Mhz frequency.
It has about 1,95ns period, but it is rounded to 1ns which is not accurate.

Submitted by: Patryk Duda <pdk@semihalf.com>
Obtained from: Semihalf
Reviewed by: wma
Sponsored by: IBM, QCM Technologies
Differential revision: https://reviews.freebsd.org/D14433
06:38:55 - r329634
(3 days 9 hours ago)
by wma
Affects:  /head/sys/powerpc/powerpc/trap.c
PowerNV: Send SIGILL on HEA illegal instruction exception

Currently Hypervisor Emulation Assistance interrupt is unhandled.
Executing an undefined instruction in userland triggers kernel panic.
Handle this the same way as Facility Unavailable Interrupt - send
SIGILL signal to userspace.

Submitted by: Michal Stanek <mst@semihalf.com>
Obtained from: Semihalf
Reviewed by: nwhitehorn, pdk@semihalf.com, wma
Sponsored by: IBM, QCM Technologies
Differential revision: https://reviews.freebsd.org/D14437
05:35:00 - r329633
(3 days 10 hours ago)
by imp
Affects:  /head/sbin/devmatch/devmatch.c
More verbose output.
05:21:58 - r329632
(3 days 10 hours ago)
by kevans
Affects:  /head/share/man/man9/style.lua.9
style.lua(9): Clarify local variable guideline

The intent of this guideline is to avoid creating global variables in module
scope. Its main purpose is to serve as a reminder that variables at module
scope also need to be declared.

We want to avoid global variables in general, but this is easier to mess up
when designing things in the module scope.
05:12:39 - r329631
(3 days 10 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
stand/lua: Insert helpful comment for drawer.branddefs
05:11:17 - r329630
(3 days 10 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
stand/lua: Stick a copyright notice on drawer.lua
05:10:26 - r329629
(3 days 10 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
stand/lua: Use 'graphic' instead of 'logo' for table depicting graphics

This is a more sensible name that offers less redundancy when referring to
it (vs. logodef.logo). Switch to it while the getting is good.
05:07:21 - r329628
(3 days 11 hours ago)
by mav
Affects: 
(4 files)
/head/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
MFC r316910: 7812 Remove gender specific language

illumos/illumos-gate@48bbca816818409505a6e214d0911fda44e622e3
https://github.com/illumos/illumos-gate/commit/48bbca816818409505a6e214d0911fda44e622e3

https://www.illumos.org/issues/7812
  This change removes all gendered language that did not refer specifically
  to an individual person or pet. The convention taken was to use
  variations on "they" when referring to users and/or human beings, while
  using "it" when referring to code, functions, and/or libraries.
  Additionally, we took the liberty to fix up any whitespace issues that
  were found in any files that were already being modified.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: Chris Williamson <chris.williamson@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Daniel Hoffman <dj.hoffman@delphix.com>
05:06:11 - r329627
(3 days 11 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
stand/lua: Refactor brands into drawer.branddefs
04:56:03 - r329626
(3 days 11 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
stand/lua: Refactor logos into drawer.logodefs table

This refactor makes it straightforward to add new logos for drawing and
organizes logo definitions in a logical manner.

The graphic to be drawn for each logo may again be modified outside of
drawer, but it must be done on a case-by-case basis as a modification to the
loader_logo.
04:36:51 - r329625
(3 days 11 hours ago)
by mav
Affects: 
(5 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/*
MFV r307315:
7301 zpool export -f should be able to interrupt file freeing

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Author: Alek Pinchuk <alek@nexenta.com>

Closes #175
04:23:43 - r329624
(3 days 11 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
stand/lua: Reduce exposure of the drawer module

As part of an effort to slowly reduce our exports overall to a set of stable
properties/functions, go ahead and reduce what drawer exposes to others.

The graphics should generally not be modified on their own, but their
position could be modified if additional grahics also need to be drawn.
Export position/shift information, but leave the actual graphic local to
the module.

The next step will be to create a 'menudef' that gets exported instead, with
each entry in the menudef table describing the graphic to be drawn along
with specific positioning information.
04:14:12 - r329623
(3 days 11 hours ago)
by mav
Affects: 
(2 files)
/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
MFV r302649: 7016 arc_available_memory is not 32-bit safe

illumos/illumos-gate@0dd053d7d890618ea1fc697b07de364e69eb4190
https://github.com/illumos/illumos-gate/commit/0dd053d7d890618ea1fc697b07de364e69eb4190

https://www.illumos.org/issues/7016
  upstream DLPX-39446 arc_available_memory is not 32-bit safe
  https://github.com/delphix/delphix-os/commit/
  6b353ea3b8a1610be22e71e657d051743c64190b
  related to this upstream:
  DLPX-38547 delphix engine hang
  https://github.com/delphix/delphix-os/commit/
  3183a567b3e8c62a74a65885ca60c86f3d693783
  DLPX-38547 delphix engine hang (fix static global)
  https://github.com/delphix/delphix-os/commit/
  22ac551d8ef085ad66cc8f65e51ac372b12993b9
  DLPX-38882 system hung waiting on free segment
  https://github.com/delphix/delphix-os/commit/
  cdd6beef7548cd3b12f0fc0328eeb3af540079c2

Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Gordon Ross <gordon.ross@nexenta.com>
Author: Prakash Surya <prakash.surya@delphix.com>
04:11:48 - r329622
(3 days 11 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
stand/lua: Move drawer.menu_name_handlers further up

As a good candidate for modification, move this table further up in the
module to improve visibility.
03:58:45 - r329621
(3 days 12 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
stand/lua: Add and use drawer.menu_name_handlers

Pull out specialized naming behavior into drawer.menu_name_handlers. This is
currently only needed for the carousel entry, where naming is based on the
current choice and the menu item purposefully does not store this state.

The setup was designed so that every type can have a special name handler,
and the default action is to simply use the result of entry.name().
03:51:09 - r329620
(3 days 12 hours ago)
by ian
Affects:  /head/sys/dev/flash/at45d.c
/head/sys/dev/flash/mx25l.c
Add missing MODULE_DEPENDS().
03:40:16 - r329619
(3 days 12 hours ago)
by kevans
Affects:  /head/stand/lua/menu.lua
stand/lua: Extract menu handlers out into menu.handlers table

This is a bit cleaner than our former method of an if ... else chain of
handlers. Store handlers in the menu.handlers table so that they may be
added to or removed dynamically.

All handlers take the current menu and selected entry as parameters, and
their return value indicates whether the menu processor should continue or
not. An omitted return value or 'true' will indicate that we should
continue, while returning 'false' will indicate that we should exit the
current menu.

The omitted return value behavior is due to continuing the loop being the
more common situation.
02:32:22 - r329618
(3 days 13 hours ago)
by jeff
Affects:  /user/jeff/numa/sys/kern/vfs_bio.c
/user/jeff/numa/sys/sys/buf.h
Catch up with the version in head.
02:31:22 - r329617
(3 days 13 hours ago)
by jeff
Affects:  /user/jeff/numa/sys/conf/files
Add PID controller to the build
02:30:51 - r329616
(3 days 13 hours ago)
by jeff
Affects: 
(6 files)
/user/jeff/numa/sys/kern/subr_pidctrl.c
/user/jeff/numa/sys/sys/pidctrl.h
/user/jeff/numa/sys/vm/*
PID Controlled page daemon

Differential Revision: https://reviews.freebsd.org/D14402
02:18:30 - r329615
(3 days 13 hours ago)
by mjg
Affects:  /head/sys/kern/kern_exit.c
/head/sys/kern/kern_fork.c
Reduce contention on the proctree lock during heavy package build.

There is a proctree -> allproc ordering established.

Most of the time it is either xlock -> xlock or slock -> slock.

On fork however there is a slock -> xlock pair which results in
pathological wait times due to threads keeping proctree held for
reading and all waiting on allproc. Switch this to xlock -> xlock.
Longer term fix would get rid of proctree in this place to begin with.
Right now it is necessary to walk the session/process group lists to
determine which id is free. The walk can be avoided e.g. with bitmaps.

The exit path used to have one place which dealt with allproc and
then with proctree. Move the allproc acquire into the section protected
by proctree. This reduces contention against threads waiting on proctree
in the fork codepath - the fork proctree holder does not have to wait
for allproc as often.

Finally, move tidhash manipulation outside of the area protected by
either of these locks. The removal from the hash was already unprotected.
There is no legitimate reason to look up thread ids for a process still
under construction.

This results in about 50% wait time reduction during -j 128 package build.
02:03:29 - r329614
(3 days 14 hours ago)
by kevans
Affects:  /head/stand/lua/core.lua
stand/lua: Don't set ACPI off just because we can't detect it.

This should unbreak EFI/!i386 cases.

Reported by: Peter Lei <peter.lei@ieee.org>
00:34:42 - r329613
(3 days 15 hours ago)
by markj
Affects: 
(2 files)
/stable/11/sys/geom/mirror/g_mirror.c
MFC r328938:
Simplify synchronization read error handling.
00:06:07 - r329612
(3 days 16 hours ago)
by jeff
Affects: 
(4 files)
/head/sys/kern/*
/head/sys/sys/*
Further parallelize the buffer cache.

Provide multiple clean queues partitioned into 'domains'. Each domain manages
its own bufspace and has its own bufspace daemon. Each domain has a set of
subqueues indexed by the current cpuid to reduce lock contention on the cleanq.

Refine the sleep/wakeup around the bufspace daemon to use atomics as much as
possible.

Add a B_REUSE flag that is used to requeue bufs during the scan to approximate
LRU rather than locking the queue on every use of a frequently accessed buf.

Implement bufspace_reserve with only atomic_fetchadd to avoid loop restarts.

Reviewed by: markj
Tested by: pho
Sponsored by: Netflix, Dell/EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14274
2018 - 02 - 19   (4 days ago)
22:56:04 - r329611
(3 days 17 hours ago)
by kevans
Affects:  /head/stand/lua/menu.lua
stand/lua: Wrap tuple assignment earlier for readability
22:54:10 - r329610
(3 days 17 hours ago)
by kevans
Affects:  /head/share/man/man9/style.lua.9
style.lua(9): Note that wrapping at 80-columns is not rigid
22:29:16 - r329609
(3 days 17 hours ago)
by kevans
Affects:  /head/stand/lua/menu.lua
stand/lua: Cache swapped menu, and don't create locals for swapping

Building the swapped welcome menu (first two items swapped) is kind of a
sluggish, because it requires a full (recrusive) shallow copy of the welcome
menu. Cache the result of that and re-use it later, instead of building it
everytime.

While here, don't create temporary locals just for swapping. The following
is just as good:

x, y = y, x;

Reported by: Alexander Nasonov <alnsn@yandex.ru> (swapping)
22:22:35 - r329608
(3 days 17 hours ago)
by jeff
Affects: 
(230 files)
/user/jeff/numa/*
Merge from head
> Description of fields to fill in above: 76 columns --|
> PR: If and which Problem Report is related.
> Submitted by: If someone else sent in the change.
> Reported by: If someone else reported the issue.
> Reviewed by: If someone else reviewed your modification.
> Approved by: If you needed approval for this commit.
> Obtained from: If the change is from a third party.
> MFC after: N [day[s]|week[s]|month[s]]. Request a reminder
email.
> MFH: Ports tree branch name. Request approval for merge.
> Relnotes: Set to 'yes' for mention in release notes.
> Security: Vulnerability reference (one per line) or
description.
> Sponsored by: If the change was sponsored by an organization.
> Differential Revision: https://reviews.freebsd.org/D### (*full* phabric
URL needed).
> Empty fields above will be automatically removed.

_M .
MM MAINTAINERS
M ObsoleteFiles.inc
M UPDATING
M bin/sh/var.c
M bin/uuidgen/uuidgen.c
_M cddl
_M cddl/contrib/opensolaris
_M cddl/contrib/opensolaris/cmd/zdb
M cddl/contrib/opensolaris/cmd/zdb/zdb.c
A + cddl/contrib/opensolaris/cmd/zdb/zdb.h
M cddl/contrib/opensolaris/cmd/zdb/zdb_il.c
M cddl/contrib/opensolaris/cmd/ztest/ztest.c
_M cddl/contrib/opensolaris/lib/libzfs
M cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
M cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
M cddl/lib/libdtrace/errno.d
M cddl/lib/libdtrace/io.d
M cddl/lib/libdtrace/ip.d
M cddl/lib/libdtrace/libproc_compat.h
M cddl/lib/libdtrace/psinfo.d
M cddl/lib/libdtrace/regs_x86.d
M cddl/lib/libdtrace/sched.d
M cddl/lib/libdtrace/tcp.d
M cddl/lib/libdtrace/udp.d
M cddl/usr.sbin/zfsd/case_file.cc
M cddl/usr.sbin/zfsd/case_file.h
M cddl/usr.sbin/zfsd/zfsd.cc
M cddl/usr.sbin/zfsd/zfsd_event.cc
M cddl/usr.sbin/zfsd/zfsd_event.h
_M contrib/compiler-rt
M contrib/compiler-rt/lib/asan/asan_linux.cc
_M contrib/less
M contrib/less/NEWS
M contrib/less/README
M contrib/less/command.c
M contrib/less/help.c
M contrib/less/less.nro
M contrib/less/lessecho.nro
M contrib/less/lesskey.nro
M contrib/less/version.c
_M contrib/libc++
_M contrib/llvm
M contrib/llvm/include/llvm/IR/IntrinsicsAMDGPU.td
M contrib/llvm/include/llvm/IR/IntrinsicsX86.td
A + contrib/llvm/include/llvm/MC/MCAsmMacro.h
M contrib/llvm/include/llvm/MC/MCContext.h
M contrib/llvm/include/llvm/Support/GenericDomTreeConstruction.h
M contrib/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
M contrib/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
M contrib/llvm/lib/CodeGen/LivePhysRegs.cpp
M contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
M contrib/llvm/lib/CodeGen/SplitKit.cpp
M contrib/llvm/lib/CodeGen/SplitKit.h
M contrib/llvm/lib/IR/AutoUpgrade.cpp
M contrib/llvm/lib/MC/MCParser/AsmParser.cpp
M contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
M contrib/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h
M contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp
M contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h
M contrib/llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td
M contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
M contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
M contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
M contrib/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
M contrib/llvm/lib/Target/AMDGPU/VOP2Instructions.td
M contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
M contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp
M contrib/llvm/lib/Target/X86/X86DomainReassignment.cpp
M contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
M contrib/llvm/lib/Target/X86/X86IntrinsicsInfo.h
M contrib/llvm/lib/Target/X86/X86RetpolineThunks.cpp
M contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
_M contrib/llvm/tools/clang
M contrib/llvm/tools/clang/include/clang/AST/DeclBase.h
M contrib/llvm/tools/clang/lib/AST/ASTContext.cpp
M contrib/llvm/tools/clang/lib/AST/DeclBase.cpp
M contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp
M contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp
M contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp
M contrib/llvm/tools/clang/lib/Format/TokenAnnotator.cpp
M contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.cpp
M contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.h
M contrib/llvm/tools/clang/lib/Headers/avx512bwintrin.h
M contrib/llvm/tools/clang/lib/Headers/avx512fintrin.h
M contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp
M contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp
M contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp
M contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp
_M contrib/llvm/tools/lld
M contrib/llvm/tools/lld/COFF/PDB.cpp
M contrib/llvm/tools/lld/ELF/Driver.cpp
M contrib/llvm/tools/lld/ELF/InputFiles.cpp
M contrib/llvm/tools/lld/ELF/Options.td
_M contrib/llvm/tools/lldb
M contrib/llvm/tools/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
M
contrib/llvm/tools/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
_M contrib/netbsd-tests
M contrib/netbsd-tests/kernel/t_sysv.c
M contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c
M etc/autofs/special_media
M etc/defaults/rc.conf
M etc/devd/Makefile
A + etc/devd/devmatch.conf
D etc/devd/usb.conf
M etc/mtree/BSD.root.dist
M etc/mtree/BSD.tests.dist
M etc/rc.d/Makefile
A + etc/rc.d/devmatch
M etc/rc.d/resolv
M include/varargs.h
M lib/clang/include/clang/Basic/Version.inc
M lib/clang/include/lld/Common/Version.inc
M lib/clang/include/llvm/Support/VCSRevision.h
M lib/libc/string/Makefile.inc
M lib/libc/string/memset.3
M lib/libcasper/libcasper/Makefile
M lib/libcasper/libcasper/libcasper.3
M lib/libcasper/libcasper/libcasper.c
M lib/libcasper/libcasper/libcasper.h
M lib/libcasper/libcasper/libcasper_impl.h
M lib/libcasper/libcasper/libcasper_service.c
M lib/libcasper/libcasper/libcasper_service.h
M lib/libcasper/libcasper/service.c
M lib/libcasper/services/cap_dns/Makefile
M lib/libcasper/services/cap_dns/cap_dns.c
M lib/libcasper/services/cap_grp/Makefile
M lib/libcasper/services/cap_grp/cap_grp.c
M lib/libcasper/services/cap_pwd/Makefile
M lib/libcasper/services/cap_pwd/cap_pwd.c
M lib/libcasper/services/cap_random/Makefile
M lib/libcasper/services/cap_random/cap_random.c
M lib/libcasper/services/cap_sysctl/Makefile
M lib/libcasper/services/cap_sysctl/cap_sysctl.c
M lib/libcasper/services/cap_syslog/Makefile
M lib/libcasper/services/cap_syslog/cap_syslog.c
M lib/libdevdctl/event.cc
M lib/libufs/sblock.c
M lib/msun/src/e_atan2.c
M release/arm64/PINE64.conf
M sbin/Makefile
M sbin/devd/devd.cc
A + sbin/devmatch
M sbin/dumpon/dumpon.8
M sbin/dumpon/dumpon.c
M sbin/ipfw/ipfw.8
M sbin/savecore/savecore.c
M share/man/man4/bnxt.4
M share/man/man4/ng_pppoe.4
M share/man/man5/core.5
M share/man/man5/rc.conf.5
M share/man/man9/DECLARE_MODULE.9
M share/man/man9/DRIVER_MODULE.9
A + share/man/man9/MODULE_PNP_INFO.9
M share/man/man9/Makefile
M share/man/man9/device_add_child.9
M share/man/man9/module.9
M share/man/man9/pci.9
M share/man/man9/pmap_enter.9
M share/man/man9/pmap_qenter.9
A + share/man/man9/style.lua.9
M share/misc/organization.dot
M share/misc/pci_vendors
D share/mk/bsd.stand.mk
M share/mk/src.opts.mk
M stand/Makefile
M stand/Makefile.amd64
A + stand/common/interp_lua.c
A + stand/common/metadata.c
M stand/defs.mk
M stand/efi/include/efidevp.h
M stand/efi/include/efilib.h
M stand/efi/libefi/efipart.c
M stand/efi/loader/main.c
M stand/fdt/Makefile
M stand/ficl/Makefile
M stand/geli/Makefile
A + stand/liblua
A + stand/liblua32
M stand/libsa/Makefile
M stand/libsa/arp.c
M stand/libsa/bootp.c
M stand/libsa/ip.c
M stand/libsa/net.c
M stand/libsa/net.h
M stand/libsa/rarp.c
M stand/libsa/rpc.c
M stand/libsa/tftp.c
M stand/libsa/ufs.c
M stand/loader.mk
A + stand/lua
A + stand/lua.mk
M stand/mips/beri/loader/Makefile
M stand/mips/beri/loader/exec.c
M stand/mips/beri/loader/loader.h
D stand/mips/beri/loader/metadata.c
M stand/mips/uboot/Makefile
M stand/powerpc/kboot/Makefile
M stand/powerpc/kboot/main.c
D stand/powerpc/kboot/metadata.c
M stand/powerpc/ofw/Makefile
D stand/powerpc/ofw/metadata.c
M stand/sparc64/loader/Makefile
D stand/sparc64/loader/metadata.c
D stand/uboot/common/metadata.c
M stand/uboot/fdt/Makefile
M stand/uboot/lib/Makefile
M stand/uboot/lib/elf_freebsd.c
M stand/uboot.mk
M stand/zfs/Makefile
M tests/sys/geom/class/Makefile
M tests/sys/geom/class/eli/Makefile
A + tests/sys/geom/class/eli/misc_test.sh
A + tests/sys/geom/class/part
A + tools/boot/lua-img.sh
A + tools/boot/lua-test.sh
M tools/boot/universe.sh
A + tools/build/options/WITH_LOADER_LUA
D tools/tools/bus_autoconf
M tools/tools/net80211/w00t/ap/ap.c
M usr.bin/ipcrm/ipcrm.c
M usr.bin/ipcs/ipc.c
M usr.bin/ipcs/ipc.h
M usr.bin/ipcs/ipcs.c
M usr.sbin/Makefile
D usr.sbin/devmatch
M usr.sbin/kldxref/kldxref.c
M usr.sbin/trpt/Makefile
M usr.sbin/trpt/trpt.8
M usr.sbin/trpt/trpt.c
22:19:44 - r329607
(3 days 17 hours ago)
by jeff
Affects: 
(238 files)
/user/jeff/numa/sys/*
Merge from head
22:09:49 - r329606
(3 days 17 hours ago)
by asomers
Affects:  /head/usr.bin/tail/reverse.c
/head/usr.bin/tail/tests/tail_test.sh
tail: fix "tail -r" for piped input that begins with '\n'

A subtle logic bug, probably introduced in r311895, caused tail to print the
first two lines of piped input in forward order, if the very first character
was a newline.

PR: 222671
Reported by: Jim Long <freebsd-bugzilla@umpquanet.com>, pprocacci@gmail.com
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
22:00:02 - r329605
(3 days 18 hours ago)
by jeff
Affects: 
(86 files)
/user/jeff/numa/*
Commit missing !sys portion of last merge.
21:58:12 - r329604
(3 days 18 hours ago)
by jeff
Affects:  /user/jeff/numa/sys/vm/vm_pageout.c
Use vm_page_held() instead of a direct check for hold count. Fix and simply the
count in vm_pageout_free_pages().
19:55:29 - r329603
(3 days 20 hours ago)
by gonzo
Affects: 
(2 files)
/stable/11/sys/dev/nctgpio/nctgpio.c
MFC r327502:

nctgpio: add new device id for the GPIO chip in PCEngines APU3

PR: 224512
Submitted by: mike@sentex.net
19:31:18 - r329602
(3 days 20 hours ago)
by bryanv
Affects:  /head/sys/dev/virtio/virtqueue.c
/head/sys/dev/virtio/virtqueue.h
Add more virtqueue getter methods

MFC after: 2 weeks
19:28:24 - r329601
(3 days 20 hours ago)
by bryanv
Affects:  /head/sys/dev/virtio/virtio.c
/head/sys/dev/virtio/virtio.h
/head/sys/dev/virtio/virtio_bus_if.m
Add VirtIO bus config_generation method

VirtIO buses (PCI, MMIO) can provide a generation field so a driver
can ensure either a 64-bit or array read was stable.

MFC after: 2 weeks
19:08:25 - r329600
(3 days 20 hours ago)
by kib
Affects:  /head/sys/ufs/ffs/ffs_subr.c
Do not free(9) uninitialized pointer.

Reported and tested by: allanjude
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
19:01:46 - r329599
(3 days 21 hours ago)
by eadler
Affects:  /head/tools/tools/net80211/w00t/ap/ap.c
tools/80211: correct array index

wh->i_dur is a two byte value; not a single byte set twice

Reported by: swildner@DragonFlyBSD.org
18:41:56 - r329598
(3 days 21 hours ago)
by bryanv
Affects: 
(7 files)
/head/share/man/man9/pci.9
/head/sys/dev/pci/*
Add PCI methods to iterate over the PCI capabilities

VirtIO V1 provides configuration in multiple VENDOR capabilities so this
allows all of the configuration to be discovered.

Reviewed by: jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D14325
18:14:12 - r329597
(3 days 21 hours ago)
by asomers
Affects:  /projects/zfsd/head/tests/sys/cddl/zfs/tests/snapshot/snapshot_test.sh
No longer skip snapshot_019_pos, now that PR 225795 is fixed

PR: 225795
Sponsored by: Spectra Logic Corp
18:11:35 - r329596
(3 days 21 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
/head/stand/lua/menu.lua
/head/stand/lua/password.lua
stand/lua: Add copyright notice in places

I've made some not-insignificant changes to config, menu, and password bits
of our lua scripts. Add a copyright notice to them to reflect.
17:54:22 - r329595
(3 days 22 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
/head/stand/lua/menu.lua
/head/stand/lua/password.lua
stand/lua: Re-order locals after copyright notice; require comes first
17:51:33 - r329594
(3 days 22 hours ago)
by kevans
Affects: 
(5 files)
/head/stand/lua/*
stand/lua: Round up some more style.lua(9) concerns
17:40:19 - r329593
(3 days 22 hours ago)
by kevans
Affects:  /head/stand/lua/core.lua
/head/stand/lua/menu.lua
stand/lua: Change boot menu items' names when swapped

[Enter] should be moved to the single user menu item when we swap them.

Define a non-standard menu entry function "alternate_name" to use for this
purpose for ultimate flexibility if we change our minds later. When we're
booting single user, make a shallow copy of the menu that we'd normally
display and swap the items and their name functions to use alternate_name
instead. Toggling single user in the options menu and going back to the main
menu will now correctly reflect the current boot setting with the first two
menu options and "[Enter]" will always be on the right one.

This shallow copy technique has the chance of being quite slow since it's
done on every redraw, but in my testing it does not seem to make any obvious
difference.

shallowCopyTable could likely belong better in a general-purpose utility
module, but this (and the key constnats) are the only candidates we have at
the moment so we'll drop it into our core stuff for the moment and consider
re-organization at a later date.
17:09:29 - r329592
(3 days 22 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: Remove inaccurate comment after r329590

lualoader does a pretty good job of reverting any environment changes now.
It will even wipe out boot_verbose if it's set explicitly in loader.conf(5)
and overwritten in the boot options menu.

Future work will likely change this, as explicit choices made in the menu
should probably override the new loader.conf(5). I don't suspect this will
cause much grief, though, so it is not a high priority until boot
environment support actually lands.
17:03:50 - r329591
(3 days 23 hours ago)
by markj
Affects: 
(2 files)
/stable/11/sys/vm/swap_pager.c
MFC r329374:
Use the conventional name for an array of pages.
17:01:21 - r329590
(3 days 23 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: Restore environment upon config reload

This restores environment to whatever defaults we had coming into lualoader.
16:59:28 - r329589
(3 days 23 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: Track env changes that come in via loader.conf(5)

This will be used when boot environment support lands to make a good-faith
effort to apply any new loader.conf(5) environment settings atop the default
configuration that we started with.
16:42:06 - r329588
(3 days 23 hours ago)
by kevans
Affects:  /head/stand/lua/menu.lua
stand/lua: Re-wrap menu.lua now that I've added indentation...
16:36:29 - r329587
(3 days 23 hours ago)
by kevans
Affects:  /head/stand/lua/menu.lua
stand/lua: Swap single-/multi- user boot entries as needed
16:35:46 - r329586
(3 days 23 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
stand/lua: Call menu_entries if it's a function

If we've fetched menu.entries and it turns out it's a function, call it to
get the actual menu entries.

This will be used to swap multi-/single- user boot options if we're booting
single user by default (boot_single="YES" in loader.conf(5)). It can also be
used fairly easily for other non-standard situations.
16:34:23 - r329585
(3 days 23 hours ago)
by kevans
Affects:  /head/stand/lua/core.lua
stand/lua: Add core.isSingleUserBoot
16:31:19 - r329584
(3 days 23 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/list.h
Implement list_safe_reset_next() function macro in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
16:25:43 - r329583
(3 days 23 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
/head/stand/lua/menu.lua
stand/lua: Store menu entries in an "entries" table

Instead of directly listing them in menu.welcome and menu.boot_options,
store them at menu.welcome.entries and welcome.boot_options.entries.

This will come into play later when we need to re-order the welcome menu if
boot_single is specified.
15:56:33 - r329582
(4 days ago)
by vangyzen
Affects: 
(2 files)
/stable/11/sys/netinet6/nd6_rtr.c
MFC r329181

Update the MTU in affected routes when IPv6 RA changes the MTU

ip6_calcmtu() only looks at the interface MTU if neither the TCP hostcache
nor the route provides an MTU. Update the routes so they do not provide
stale MTUs.

This fixes UNH IPv6 conformance test cases v6LC_4_1_08 and v6LC_4_1_09,
which use a RA to reduce the link MTU from 1500 to 1280.

Reported and tested by: Farrell Woods <Farrell_Woods@Dell.com>
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D14257
15:54:26 - r329581
(4 days ago)
by vangyzen
Affects: 
(2 files)
/stable/11/sys/netinet6/icmp6.c
MFC r329053

Fix ICMPv6 redirects

icmp6_redirect_input() validates that a redirect packet came from the
current gateway for the respective destination. To do this, it compares
the source address, which has an embedded scope zone id, to the next-hop
address, which does not. If the address is link-local, which should be
the case, the comparison fails and the redirect is ignored.

Insert the scope zone id into the next-hop address so the comparison
is accurate.

Unsurprisingly, this fixes 35 UNH IPv6 conformance test cases.

Submitted by: Farrell Woods <Farrell_Woods@Dell.com> (initial revision)
Reviewed by: ae melifaro dab
Relnotes: yes
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D14254
15:49:27 - r329580
(4 days ago)
by kevans
Affects:  /head/stand/lua/menu.lua
stand/lua: Remove some unused local declarations

Menus are actually defined as entries in the 'menu' table. These local
declarations have not been used in the history of our in-tree lua scripts,
so give them the boot.
15:49:14 - r329579
(4 days ago)
by nwhitehorn
Affects:  /head/sys/dev/ofw/ofw_standard.c
/head/sys/powerpc/ofw/ofw_real.c
Set internal error returns for OF_peer(), OF_child(), and OF_parent() to
zero, matching the IEEE 1275 standard. Since these internal error paths
have never, to my knowledge, been taken, behavior is unchanged.

Reported by: gonzo
MFC after: 2 weeks
15:47:09 - r329578
(4 days ago)
by kevans
Affects:  /head/stand/lua/menu.lua
stand/lua: Menu style.lua(9) nits
15:42:20 - r329577
(4 days ago)
by kevans
Affects: 
(4 files)
/head/stand/lua/*
stand/lua: Rename bootserial for clarity
14:21:56 - r329576
(4 days 1 hour ago)
by kevans
Affects:  /head/stand/lua/config.lua
/head/stand/lua/core.lua
/head/stand/lua/menu.lua
stand/lua: Defer kernel/module loading until boot or menu escape

Loading the kernel and modules can be really slow. Loading before the menu
draws and every time one changes kernel/boot environment is even more
painful.

Defer loading until we either boot, auto-boot, or escape to loader prompt.
We still need to deal with configuration changes as the boot environment
changes, but this is generally much quicker.

This commit strips all ELF loading out of config.load/config.reload so that
these are purely for configuration. config.loadelf has been created to deal
with kernel/module loads. Unloading logic has been ripped out, as we won't
need to deal with it in the menu anymore.

Discussed in part with: allanjude
12:52:17 - r329575
(4 days 3 hours ago)
by hselasky
Affects: 
(8 files)
/projects/bsd_rdma_4_9_stable_11/sys/*
MFC r329222:
Import the mthca kernel side infiniband driver from Linux 4.9 and fix
compilation under FreeBSD. The mthca driver was temporarily removed as
part of the Linux 4.9 RoCE/infinband upgrade.

Top commit in Linux source tree:
69973b830859bc6529a7a0468ba0d80ee5117826

Sponsored by: Mellanox Technologies
12:47:59 - r329574
(4 days 3 hours ago)
by hselasky
Affects: 
(2 files)
/projects/bsd_rdma_4_9_stable_11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c
MFC r303646:
ipoib: Bound the number of egress mbufs buffered during pathrec lookups.

In pathological situations where the master subnet manager becomes
unresponsive for an extended period, we may otherwise end up queuing all
of the system's mbufs while waiting for a response to a path record lookup.

This addresses the same issue as commit 1e85b806f9 in Linux.

Reviewed by: cem, ngie
Sponsored by: EMC / Isilon Storage Division
12:42:40 - r329573
(4 days 3 hours ago)
by hselasky
Affects: 
(2 files)
/projects/bsd_rdma_4_9_stable_11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
MFC r315672:
Make sdp compilable after r315662.
12:38:40 - r329572
(4 days 3 hours ago)
by hselasky
Affects: 
(2 files)
/projects/bsd_rdma_4_9_stable_11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
MFC r303513:
sdp: Destroy the RDMA ID after destroying the connection's queue pair.

This is the ordering documented by rdma_destroy_qp(). Also add a useful
KASSERT to sdp_pcbfree().

Sponsored by: EMC / Isilon Storage Division
12:37:07 - r329571
(4 days 3 hours ago)
by hselasky
Affects: 
(4 files)
/projects/bsd_rdma_4_9_stable_11/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h
/projects/bsd_rdma_4_9_stable_11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
/projects/bsd_rdma_4_9_stable_11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c
MFC r303512:
sdp: Use malloc(9) instead of the Linux compat layer.

SDP transmit and receive rings are always created in a sleepable context,
so we can use M_WAITOK and remove error checks.

Sponsored by: EMC / Isilon Storage Division
12:34:38 - r329570
(4 days 3 hours ago)
by hselasky
Affects: 
(2 files)
/projects/bsd_rdma_4_9_stable_11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
MFC r303506:
sdp: Destroy the PCB lock before freeing to the zone.

Sponsored by: EMC / Isilon Storage Division
12:33:38 - r329569
(4 days 3 hours ago)
by hselasky
Affects: 
(3 files)
/projects/bsd_rdma_4_9_stable_11/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h
/projects/bsd_rdma_4_9_stable_11/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
MFC r303505:
sdp: Use an mbufq for received control packets.

This is simpler than the hand-rolled queue, and fixes a use-after-free.

Sponsored by: EMC / Isilon Storage Division
12:25:32 - r329568
(4 days 3 hours ago)
by hselasky
Affects: 
(2 files)
/projects/bsd_rdma_4_9_stable_11/contrib/ofed/include/udma_barrier.h
MFC r326765:
ofed: Define barriers for mips and arm.

I used the strongest barriers available on the architectures, so if
the future analysis show that it is excessive, the barriers could be
relaxed. Still, it is unlikely that it is meaningful to run IB on 32bit
ARM or current MIPS machines, so the change is to make WITH_OFED to pass
tinderbox.

Sponsored by: Mellanox Technologies
Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D13329
12:24:28 - r329567
(4 days 3 hours ago)
by hselasky
Affects: 
(2 files)
/projects/bsd_rdma_4_9_stable_11/contrib/ofed/librdmacm/librdmacm.map
MFC r326764:
ofed: Remove duplicated symbols from the version file.

ld.bfd accepts multiple listing of the same symbol in the version script.
lld is stricter and errors out. Since arm64 and sometimes amd64 use lld,
we should correct this cosmetic issue.

Sponsored by: Mellanox Technologies
Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D13329
12:23:17 - r329566
(4 days 3 hours ago)
by hselasky
Affects: 
(3 files)
/projects/bsd_rdma_4_9_stable_11/contrib/ofed/libibnetdisc/Makefile
/projects/bsd_rdma_4_9_stable_11/contrib/ofed/libibnetdisc/g_hash_table.cpp
MFC r326716:
Correctly define the unordered_map namespace in ofed/libibnetdisc .

This should fix ofed/libibnetdisc compilation with C-compilers
different from clang and GCC v4.2.1.

Submitted by: kib
Sponsored by: Mellanox Technologies
12:21:56 - r329565
(4 days 3 hours ago)
by hselasky
Affects:  /svnadmin/conf/sizelimit.conf
Remove myself.
12:21:24 - r329564
(4 days 3 hours ago)
by hselasky
Affects: 
(619 files)
/projects/bsd_rdma_4_9_stable_11/*
MFC r326169 and r326563:
RoCE/infiniband upgrade to Linux v4.9 for kernel and userspace.

This commit merges projects/bsd_rdma_4_9 to head.

List of kernel sources used:
============================

1) kernel sources were cloned from git://github.com/torvalds/linux.git
Top commit 69973b830859bc6529a7a0468ba0d80ee5117826 - tag: v4.9, linux-4.9

2) krping was cloned from https://github.com/larrystevenwise/krping
Top commit 292a2f1abf0348285e678a82264740d52e4dcfe4

List of userspace sources used:
===============================

1) rdma-core was cloned from https://github.com/linux-rdma/rdma-core.git
Top commit d65138ef93af30b3ea249f3a84aa6a24ba7f8a75

2) OpenSM was cloned from git://git.openfabrics.org/~halr/opensm.git
Top commit 85f841cf209f791c89a075048a907020e924528d

3) libibmad was cloned from git://git.openfabrics.org/~iraweiny/libibmad.git
Tag 1.3.13 with some additional patches from Mellanox.

4) infiniband-diags was cloned from
git://git.openfabrics.org/~iraweiny/infiniband-diags.git
Tag 1.6.7 with some additional patches from Mellanox.

NOTES:
======

1) The mthca driver has been removed in kernel and in userspace.
2) All GPLv2 only sources have been removed and where applicable
  rewritten from scratch under a BSD license.
3) List of fully supported drivers in userspace and kernel:
  a) iw_cxgbe (Chelsio)
  b) mlx4ib (Mellanox)
  c) mlx5ib (Mellanox)
4) WITH_OFED=YES is still required by make in order to build
  OFED userspace and kernel code.
5) Full support has been added for routable RoCE, RoCE v2.

Sponsored by: Mellanox Technologies
12:20:51 - r329563
(4 days 3 hours ago)
by ae
Affects:  /head/sys/netipsec/ipsec.c
/head/sys/netipsec/ipsec.h
Remove unused variables and sysctl declaration.

MFC after: 1 week
12:20:17 - r329562
(4 days 3 hours ago)
by hselasky
Affects:  /svnadmin/conf/sizelimit.conf
Add myself.
11:14:38 - r329561
(4 days 4 hours ago)
by ae
Affects:  /head/sys/netipsec/xform_ah.c
Check packet length to do not make out of bounds access. Also save ah_nxt
value to use it later, since ah pointer can become invalid.

Reported by: Maxime Villard <max at m00nbsd dot net>
MFC after: 5 days
10:59:19 - r329560
(4 days 5 hours ago)
by kib
Affects: 
(2 files)
/stable/11/share/man/man9/pmap_enter.9
MFC r329347:
Note that on amd64 pmap_enter(psind = 1) works.
10:34:30 - r329559
(4 days 5 hours ago)
by ae
Affects: 
(2 files)
/stable/11/sys/netinet6/ip6_input.c
MFC r328541:
  Do not skip scope zone violation check, when mbuf has M_FASTFWD_OURS flag.

  When mbuf has M_FASTFWD_OURS flag, this means that a destination address
  is our local, but we still need to pass scope zone violation check,
  because protocol level expects that IPv6 link-local addresses have
  embedded scope zone indexes. This should fix the problem, when ipfw is
  used to forward packets to local address and source address of a packet
  is IPv6 LLA.

  Reported by: asomers@
10:30:34 - r329558
(4 days 5 hours ago)
by ae
Affects: 
(2 files)
/stable/11/sys/netinet6/in6_ifattach.c
MFC r328540:
  Assign IPv6 link-local address to loopback interfaces whith unit > 0.

  When an interface has IFF_LOOPBACK flag in6_ifattach() tries to assing
  IPv6 loopback address to this interface. It uses in6ifa_ifpwithaddr()
  to check, that interface doesn't already have given address and then
  uses in6_ifattach_loopback(). If in6_ifattach_loopback() fails, it just
  exits and thus skips assignment of IPv6 LLA.
  Fix this using in6ifa_ifwithaddr() function. If IPv6 loopback address is
  already assigned in the system, do not call in6_ifattach_loopback().

  PR: 138678
09:08:46 - r329557
(4 days 6 hours ago)
by hselasky
Affects:  /projects/bsd_rdma_4_9_stable_11
Create a projects branch for backporting projects/bsd_rdma_4_9 to FreeBSD
11-stable.
08:55:22 - r329556
(4 days 7 hours ago)
by avg
Affects:  /head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
relax an assert in zfsctl_snapdir_lookup to match r323578

Since r323578 we may remove the last reference to a covered vnode with
vrele() instead of vput(). So, v_usecount may be decremented before
the vnode is locked and zfsctl_snapdir_lookup may "catch" the vnode
with v_usecount of zero and v_holdcnt of one.

PR: 225795
Reported by: asomers
MFC after: 1 week
06:11:58 - r329555
(4 days 9 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/src/linux_radix.c
When stepping the radix tree in the LinuxKPI make sure we
clear the least significant bits, so that no entries are
skipped.

MFC after: 1 week
Sponsored by: Mellanox Technologies
05:10:22 - r329554
(4 days 10 hours ago)
by delphij
Affects: 
(9 files)
/head/contrib/less/*
MFV r329552: less v530.

MFC after: 2 weeks
04:56:22 - r329553
(4 days 11 hours ago)
by delphij
Affects:  /vendor/less/v530
Tag less v530.
04:47:31 - r329552
(4 days 11 hours ago)
by delphij
Affects: 
(11 files)
/vendor/less/dist/*
Vendor import of less v530.
03:59:26 - r329551
(4 days 12 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: reload previously loaded kernel at config-load/reload

r329550 introduced config.kernel_loaded. config.load() doesn't provide a
means of overriding the kernel to load, but that likely isn't necessary as
it will not be a common case. When loading the kernel, just attempt to load
the kernel previously loaded and specified in config.kernel_loaded.

If we haven't loaded a kernel yet, config.kernel_loaded will be unset/nil
and the "default"/first kernel found will be loaded. If we've loaded a
kernel, we'll try to load that same kernel again and fallback to the default
kernel if we need to.

This in also in support of upcoming boot environment support.
03:52:02 - r329550
(4 days 12 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: Store the loaded kernel as config.kernel_loaded

'nil' means the 'first kernel found in module_path', which is the same
interpretation as passing 'nil' to loadkernel.

Otherwise, it denotes the name of a kernel that we've successfully loaded.
When reloaded later, we will still need to do the full search again to
locate the actual kernel in case things have changed, so just the name is
good enough.

This is in support of upcoming boot environment support. vfs.root.mountfrom
and currdev will be changed, then we will reload configuration and attempt
to reload the currently chosen kernel unless we shouldn't.
02:09:10 - r329549
(4 days 13 hours ago)
by kevans
Affects:  /head/stand/lua/password.lua
stand/lua: Clear the screen before prompting for passwords

In the worst case scenario, we have no passwords to prompt for and we end up
just clearing the screen twice before we draw the menu or proceed with boot.

In the best case scenario, we don't try drawing password prompts amidst a
bunch of kernel/module loading.
02:01:49 - r329548
(4 days 14 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
stand/lua: Addres style.lua(9) concern
01:59:41 - r329547
(4 days 14 hours ago)
by kevans
Affects:  /head/stand/lua/drawer.lua
stand/lua: Allow menu items to be conditionally (in)visible

This will be used to conditionally show/hide the boot environment menu.
01:49:19 - r329546
(4 days 14 hours ago)
by ian
Affects: 
(5 files)
/head/sys/modules/spi/Makefile
/head/sys/modules/spi/at45d/Makefile
/head/sys/modules/spi/mx25l/Makefile
Build at45d and mx25l SPI flash drivers as modules.
01:39:02 - r329545
(4 days 14 hours ago)
by ian
Affects:  /head/sys/modules/spi/spibus/Makefile
Add ofw_bus_if.h to SRCS.
01:32:27 - r329544
(4 days 14 hours ago)
by ian
Affects: 
(5 files)
/head/sys/modules/Makefile
/head/sys/modules/spi/Makefile
/head/sys/modules/spi/spibus/Makefile
Add modules/spi as a gathering point for SPI-related modules, analagous to
modules/i2c for i2c/iicbus modules. Build spibus as a module.
01:25:52 - r329543
(4 days 14 hours ago)
by kevans
Affects:  /head/share/man/man9/Makefile
/head/share/man/man9/style.lua.9
Create style.lua(9)

This covers the lua style guidelines we've generally agreed on so far. It
will be revised as work continues and we run into more scenarios that need
specified.

Discussed with: cem, jilles
Differential Revision: https://reviews.freebsd.org/D14423
00:54:08 - r329542
(4 days 15 hours ago)
by mjg
Affects:  /head/sys/kern/kern_exit.c
Fix process exit vs reap race introduced in r329449

The race manifested itself mostly in terms of crashes with "spin lock
held too long".

Relevant parts of respective code paths:

exit: reap:
PROC_LOCK(p);
PROC_SLOCK(p);
p->p_state == PRS_ZOMBIE
PROC_UNLOCK(p);
  PROC_LOCK(p);
/* exit work */
  if (p->p_state == PRS_ZOMBIE) /* true */
  proc_reap()
  free proc
/* more exit work */
PROC_SUNLOCK(p);

Thus a still exiting process is reaped.

Prior to the change the zombie check was followed by slock/sunlock trip
which prevented the problem.

Even code prior to this commit has a bug: the proc is still accessed for
statistic collection purposes. However, the severity is rather small and
the bug may be fixed in a future commit.

Reported by: many
Tested by: allanjude
00:47:03 - r329541
(4 days 15 hours ago)
by ian
Affects: 
(3 files)
/head/sys/modules/i2c/Makefile
/head/sys/modules/i2c/ofw_iicbus/Makefile
Build ofw_iicbus as a module if OPT_FDT is defined.
00:38:14 - r329540
(4 days 15 hours ago)
by mjg
Affects:  /head/sys/kern/kern_mutex.c
/head/sys/sys/mutex.h
mtx: add mtx_spin_wait_unlocked

The primitive can be used to wait for the lock to be released. Intended
usage is for locks in structures which are about to be freed.

The benefit is the avoided interrupt enable/disable trip + atomic op to
grab the lock and shorter wait if the lock is held (since there is no
worry someone will contend on the lock, re-reads can be more aggressive).

Briefly discussed with: kib
2018 - 02 - 18   (5 days ago)
23:35:23 - r329539
(4 days 16 hours ago)
by ian
Affects:  /head/sys/dev/spibus/ofw_spibus.c
/head/sys/dev/spibus/spibusvar.h
Provide public declarations for ofw_spibus_driver and ofw_spibus_devclass
so other drivers can refer to them in DRIVER_MODULE() decls.
23:16:16 - r329538
(4 days 16 hours ago)
by imp
Affects:  /head/sbin/devmatch/devmatch.c
Print more info for -v runs and temp hack for usb vs uhub

Despite best efforts to regularize, there's a few tables in the system
that still report they are for bus usb when they are really for bus
uhub (where usb devices attach). Add a temporary workaround for this
until these places have been eliminated (likely my fault).

Second, when running verbose, describe what we're doing when
searching. This output can be quite long, but says exactly what's
going on (this output is to stdout, so it's useless for scripting).
23:08:43 - r329537
(4 days 16 hours ago)
by ian
Affects:  /head/sys/dev/gpio/gpiobusvar.h
/head/sys/dev/gpio/ofw_gpiobus.c
Provide a public function to acquire a gpio pin by giving the property name
and index. A private function to do exactly that already existed, so this
renames gpio_pin_get_by_ofw_impl() to gpio_pin_get_by_ofw_propidx() and
provides a declaration for it in a public header.

Previously there were functions to get a pin by property name (assuming
there would only be one pin defined for the name), or by index (asuming
the property has the standard name "gpios"). It turns out there are
devicetree bindings that describe properties with names other than "gpios"
which can describe multiple pins. Hence the need to retrieve the Nth item
from a named property.
23:01:33 - r329536
(4 days 17 hours ago)
by ian
Affects:  /head/sys/arm/freescale/imx/imx_i2c.c
Add the MODULE_DEPEND()s needed so that the kernel linker can resolve all
the symbols at load time when iicbus is not compiled into the kernel.
22:57:04 - r329535
(4 days 17 hours ago)
by ian
Affects:  /head/sys/modules/i2c/iicbus/Makefile
Add iic_recover_bus.c, now part of iicbus. This should have been added
as part of r320463.
22:54:19 - r329534
(4 days 17 hours ago)
by ian
Affects:  /head/sys/modules/i2c/iicbus/Makefile
Arrange SRCS= as 1 file per line, alphabetical, so it's easier to maintain.
Whitespace only, no functional changes.
22:12:20 - r329533
(4 days 17 hours ago)
by wulf
Affects: 
(2 files)
/stable/10/sys/dev/atkbdc/psm.c
MFC r328864 (Synaptics part only):

psm(4): Fix panic occuring soon after PS/2 packet has been rejected by
synaptics sanity checker.

After packet has been rejected contents of packet buffer is not cleared
with setting of inputbytes counter to 0. So when this packet buffer is
filled again being an element of circular queue, new data appends to old
data rather than overwrites it. This leads to packet buffer overflow
after 10 rounds.

Fix it with setting of packet's inputbytes counter to 0 after rejection.

While here add extra logging of rejected packets.

PR: 222667 (for reference)
Reported by: Neel Chauhan <neel@neelc.org>
Tested by: Neel Chauhan <neel@neelc.org>
22:04:42 - r329532
(4 days 18 hours ago)
by wulf
Affects: 
(2 files)
/stable/11/sys/dev/atkbdc/psm.c
MFC r328864:

psm(4): Fix panic occuring soon after PS/2 packet has been rejected by
synaptics or elantech sanity checker.

After packet has been rejected contents of packet buffer is not cleared
with setting of inputbytes counter to 0. So when this packet buffer is
filled again being an element of circular queue, new data appends to old
data rather than overwrites it. This leads to packet buffer overflow
after 10 rounds.

Fix it with setting of packet's inputbytes counter to 0 after rejection.

While here add extra logging of rejected packets.

PR: 222667 (for reference)
Reported by: Neel Chauhan <neel@neelc.org>
Tested by: Neel Chauhan <neel@neelc.org>
21:07:15 - r329531
(4 days 19 hours ago)
by mjg
Affects:  /head/sys/kern/kern_exit.c
exit: get rid of PROC_SLOCK when checking a process to report, take #2

The suspension counter needs synchronisation through slock, but we don't
need it to check if inspecting the counter is necessary to begin with.
In the common case it is not, thus avoid the lock if possible.

Reviewed by: kib
Tested by: pho
20:49:43 - r329530
(4 days 19 hours ago)
by brooks
Affects: 
(2 files)
/stable/11/bin/df/df.c
MFC r329092:

Add a deprecation warning when using the feature which mounts devices
to see how much space it on them.

Adjust MOUNT_CHAR_DEVS to allow the free space of already mounted
devices to be displayed and report an appropriate error if the
device isn't mounted.

Reviewed by: cem
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8801
20:08:35 - r329529
(4 days 19 hours ago)
by ian
Affects:  /head/sys/arm/freescale/imx/imx_i2c.c
Give the imx_i2c driver its own name, set up its relationship to ofw_iicbus.
Previously it called itself 'iichb' to link up with the EARLY_DRIVER_MODULE
declaration in ofw_iicbus.c.
20:04:39 - r329528
(4 days 20 hours ago)
by oshogbo
Affects:  /head/sys/kern/sys_capability.c
Fix broken assertion in r329520.

Reported by: pho@ lwhsu@
19:46:57 - r329527
(4 days 20 hours ago)
by markj
Affects: 
(4 files)
/stable/11/sys/dev/agp/agp_i810.c
/stable/11/sys/dev/agp/agp_i810.h
/stable/11/sys/modules/agp/Makefile
MFC r320851:
Add a helper function to agp(4) which installs a single GTT entry.
19:33:28 - r329526
(4 days 20 hours ago)
by ian
Affects:  /head/sys/dev/iicbus/iicbus.h
/head/sys/dev/iicbus/ofw_iicbus.c
Allow i2c hardware drivers to declare their own relationships to ofw_iicbus
rather than relying on a set of canned EARLY_DRIVER_MODULE() statements in
the ofw_iicbus source. This means hw drivers will no longer be required to
use one of a few predefined driver names. They will also now be able to
decide themselves if they want to use DRIVER_MODULE or EARLY_DRIVER_MODULE
and to set which pass to attach on for early modules.

Mainly, this adds extern declarations for the driver and devclass variables.
It also renames ofwiicbus_devclass to ofw_iicbus_devclass to be consistant
with the way we use ofw_ prefixes on this stuff.
19:19:36 - r329525
(4 days 20 hours ago)
by brooks
Affects:  /head/sys/kern/sysv_msg.c
/head/sys/kern/sysv_sem.c
/head/sys/kern/sysv_shm.c
Correct/improve the descriptions if kern.ipc.(shmsegs,sema,msqids).

The description of kern.ipc.shmsegs was wrong since 2005. I updated the
others (which were more correct) to match.

PR: 225933
Reviewed by: cem
MFC after: 3 days
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14391
18:46:56 - r329524
(4 days 21 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/asm/atomic.h
Optimise xchg() to use atomic_swap_32() and atomic_swap_64().

Suggested by: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies
17:37:23 - r329523
(4 days 22 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/asm/atomic.h
Fix implementation of xchg() function macro in the LinuxKPI.
The exchange operation must be atomic.

MFC after: 1 week
Sponsored by: Mellanox Technologies
16:41:34 - r329522
(4 days 23 hours ago)
by scottl
Affects: 
(6 files)
/head/sys/dev/mpr/*
/head/sys/dev/mps/*
Improve command lifecycle debugging and detection of problems.

Sponsored by: Netflix
16:03:50 - r329521
(5 days ago)
by markj
Affects:  /head/sys/x86/iommu/intel_gas.c
Don't include DMAR map entry zone items in kernel dumps.

Such items may be allocated in the I/O path used by the dumper,
potentially causing the dump to fail. Since there is some precedent
in the DMAR driver for avoiding this problem using _NODUMP, apply
this workaround to the zone as well.

Reported and tested by: mmacy
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14422
15:27:24 - r329520
(5 days ago)
by oshogbo
Affects:  /head/sys/kern/sys_capability.c
Use the fdeget_locked function instead of the fget_locked in the
sys_capability.

Reviewed by: pjd@ (earlier version)
Discussed with: mjg@
12:54:21 - r329519
(5 days 3 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/radix-tree.h
/head/sys/compat/linuxkpi/common/src/linux_radix.c
Implement support for radix_tree_for_each_slot() and radix_tree_exception()
in the LinuxKPI and use unsigned long type for the radix tree index.

MFC after: 1 week
Sponsored by: Mellanox Technologies
11:36:46 - r329518
(5 days 4 hours ago)
by ae
Affects: 
(2 files)
/stable/11/sys/netinet/tcp_input.c
MFC r329101:
  Reinitialize IP header length after checksum calculation. It is used
  later by TCP-MD5 code.

  This fixes the problem with broken TCP-MD5 over IPv4 when NIC has
  disabled TCP checksum offloading.

  PR: 223835
11:17:39 - r329517
(5 days 4 hours ago)
by manu
Affects:  /head/stand/efi/include/efidevp.h
efi: Do not pad the efi devpath structure

This solve problem when booting with efi on armv7
Reviewed by: imp, tsoome
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D14415
09:52:30 - r329516
(5 days 6 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/slab.h
Implement the KMEM_CACHE() function macro in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
09:31:01 - r329515
(5 days 6 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/mm.h
/head/sys/compat/linuxkpi/common/src/linux_compat.c
Make the vm_fault structure in the LinuxKPI compatible with
newer versions of the Linux kernel. No functional change.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
09:10:14 - r329514
(5 days 6 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/rcupdate.h
Implement the rcu_dereference_raw() function macro.
Make sure all RCU dereferencing use the READ_ONCE() function macro.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
08:58:20 - r329513
(5 days 7 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/gfp.h
Implement __GFP_BITS_SHIFT and __GFP_BITS_MASK macros in the LinuxKPI.
Add compile time asserts to catch conflicts with native defines.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
08:47:15 - r329512
(5 days 7 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/list.h
Implement __list_del_entry() helper functions in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
08:40:07 - r329511
(5 days 7 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/fs.h
Implement file_inode() and call_mmap() helper functions in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
08:29:25 - r329510
(5 days 7 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/dcache.h
/head/sys/compat/linuxkpi/common/include/linux/fs.h
Refactor dentry structure into its own header file in the LinuxKPI similary
to Linux. No functional change. Implement d_inode() helper function.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
08:05:40 - r329509
(5 days 8 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/ktime.h
/head/sys/compat/linuxkpi/common/src/linux_hrtimer.c
Update the ktime type in the LinuxKPI to be a signed 64-bit integer similarly
to Linux, to avoid compilation issues. Implement ktime_get_real_seconds().

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
04:00:29 - r329508
(5 days 12 hours ago)
by mav
Affects: 
(7 files)
/head/cddl/contrib/opensolaris/cmd/zdb/*
/head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
/head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
MFV r324198: 8081 Compiler warnings in zdb

illumos/illumos-gate@3f7978d02b206a6ebc5652c91aa9f42da6fbe00c
https://github.com/illumos/illumos-gate/commit/3f7978d02b206a6ebc5652c91aa9f42da6fbe00c

https://www.illumos.org/issues/8081
  zdb(8) is full of minor problems that generate compiler warnings. On FreeBSD,
  which uses -WError, the only way to build it is to disable all compiler
  warnings. This makes it much harder to detect newly introduced bugs. We should
  cleanup all the warnings.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Alan Somers <asomers@gmail.com>
02:48:54 - r329507
(5 days 13 hours ago)
by ian
Affects: 
(7 files)
/head/sys/arm/conf/*
/head/sys/modules/Makefile
/head/sys/modules/imx/*
Build modules specific to imx5/imx6 only when building those kernels.

This adds sys/modules/imx with a SUBDIR makefile to make the whole
collection of modules that are specific to these SoCs. Initially, that
"whole collection" consists of the if_ffec and imx_i2c drivers.

The if_ffec driver is referenced in its existing home in ../ffec rather
than moving it into the imx directory, because it's used by powerpc too,
but it is no longer built for all armv6/7 systems.

The imx_i2c driver is newly added as a module.
02:01:41 - r329506
(5 days 14 hours ago)
by ian
Affects:  /head/sys/arm/freescale/imx/imx_i2c.c
Add a detach method so that this can be a kldunload-friendly module.
01:42:17 - r329505
(5 days 14 hours ago)
by mav
Affects: 
(3 files)
/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
MFV r323911:
8502 illumos#7955 broke delegated datasets when libshare is not present

illumos/illumos-gate@1c18e8fbd8db41a9fb39bd3ef7a18ee71ece20da
https://github.com/illumos/illumos-gate/commit/1c18e8fbd8db41a9fb39bd3ef7a18ee71ece20da

https://www.illumos.org/issues/8502
  The code in lib/libzfs/common/libzfs_mount.c already basically handles
  the case when libshare is not installed. We just need to not fail in
  zfs_init_libshare_impl. I tested this in lx and things work as
  expected. I also tested there trying to set sharenfs and sharesmb on
  the delegated dataset. Neither is allowed from within a zone. The
  spew of msgs from a native zone is not ZFS specific. I see the same
  spew simply running the share command.

Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Yuri Pankov <yuripv@gmx.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Jerry Jelinek <jerry.jelinek@joyent.com>
01:35:46 - r329504
(5 days 14 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: More style nits, config.lua

Some other points I think we need to be consistent on:
- Spacing around string concatenation (always)
- Test against 'nil' explicitly rather than relying on 'not' for things that
  reasonably won't be returning a boolean. e.g. loader.getenv

Eventually this will all get formalized somewhere.
01:31:18 - r329503
(5 days 14 hours ago)
by kevans
Affects:  /head/stand/liblua/lutils.c
liblua: Fix missing '}' in lutil.c after r329499
01:21:52 - r329502
(5 days 14 hours ago)
by mav
Affects: 
(85 files)
/vendor-sys/illumos/dist/*
/vendor/illumos/dist/*
7614 zfs device evacuation/removal

illumos/illumos-gate@5cabbc6b49070407fb9610cfe73d4c0e0dea3e77

https://www.illumos.org/issues/7614:
This project allows top-level vdevs to be removed from the storage pool with
“zpool remove”, reducing the total amount of storage in the pool. This
operation copies all allocated regions of the device to be removed onto other
devices, recording the mapping from old to new location. After the removal is
complete, read and free operations to the removed (now “indirect”) vdev must
be remapped and performed at the new location on disk. The indirect mapping
table is kept in memory whenever the pool is loaded, so there is minimal
performance overhead when doing operations on the indirect vdev.

The size of the in-memory mapping table will be reduced when its entries
become “obsolete” because they are no longer used by any block pointers in
the pool. An entry becomes obsolete when all the blocks that use it are
freed. An entry can also become obsolete when all the snapshots that
reference it are deleted, and the block pointers that reference it have been
“remapped” in all filesystems/zvols (and clones). Whenever an indirect block
is written, all the block pointers in it will be “remapped” to their new
(concrete) locations if possible. This process can be accelerated by using
the “zfs remap” command to proactively rewrite all indirect blocks that
reference indirect (removed) vdevs.

Note that when a device is removed, we do not verify the checksum of the data
that is copied. This makes the process much faster, but if it were used on
redundant vdevs (i.e. mirror or raidz vdevs), it would be possible to copy
the wrong data, when we have the correct data on e.g. the other side of the
mirror. Therefore, mirror and raidz devices can not be removed.

Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Richard Laager <rlaager@wiktel.com>
Reviewed by: Tim Chase <tim@chase2k.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Prashanth Sreenivasa <pks@delphix.com>
01:16:37 - r329501
(5 days 14 hours ago)
by cem
Affects:  /head/stand/lua/core.lua
lua loader: Auto detect eligible list of kernels to boot

Reviewed by: imp, kevans
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14419
01:15:25 - r329500
(5 days 14 hours ago)
by cem
Affects: 
(4 files)
/head/stand/common/interp_lua.c
/head/stand/liblua/*
Lua loader: Add barebones "lfs" module

Add a Lua FileSystem module, an emulation of a subset of the permissively
licensed (MIT) Lua library of the same name[0], to our loader's Lua
environment.

[0]: https://github.com/keplerproject/luafilesystem/

Reviewed by: kevans
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14418
01:13:58 - r329499
(5 days 14 hours ago)
by cem
Affects:  /head/stand/common/interp_lua.c
/head/stand/liblua/lutils.c
/head/stand/liblua/lutils.h
interp_lua: Register io/loader with regular Lua module system

Reviewed by: kevans
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14421
01:01:15 - r329498
(5 days 15 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: Remove some debugging bits that snuck in... gr...
00:56:12 - r329497
(5 days 15 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: Fix module_path handling with multiple kernels

Once we've successfully loaded a kernel, we add its directory to
module_path. If we switch kernels with the kernel selector, we again prepend
the kernel directory to the current module_path and end up with multiple
kernel paths, potentially with mismatched kernel/modules, added to
module_path.

Fix it by caching module_path at load() time and using the cached version
whenever we load a new kernel.
00:44:09 - r329496
(5 days 15 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: Fix verbiage and some typos

"other_kernel" is decidedly not spelled "other_kern"
00:27:35 - r329495
(5 days 15 hours ago)
by mav
Affects: 
(2 files)
/stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
MFC r328256:
MFV r328255: 8972 zfs holds: In scripted mode, do not pad columns with spaces

illumos/illumos-gate@e9b7d6e7f7a6477679a35b73eb3934b096b3dd39

https://www.illumos.org/issues/8972:
'zfs holds -H' does not properly output content in scripted mode. It uses a
tab instead of two spaces, but it still pads column widths with spaces when
it should not.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Allan Jude <allanjude@freebsd.org>
00:26:34 - r329494
(5 days 15 hours ago)
by mav
Affects: 
(2 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
MFC r328254:
MFV r328253: 8835 Speculative prefetch in ZFS not working for misaligned reads

illumos/illumos-gate@5cb8d943bc8513c6230589aad5a409d58b0297cb

https://www.illumos.org/issues/8835:
Sequential reads not aligned to block size are not detected by ZFS
prefetcher as sequential, killing prefetch and severely hurting
performance. It is caused by dmu_zfetch() in case of misaligned
sequential accesses being called with overlap of one block.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Allan Jude <allanjude@freebsd.org>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Alexander Motin <mav@FreeBSD.org>
00:26:00 - r329493
(5 days 15 hours ago)
by mav
Affects: 
(5 files)
/stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
/stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
/stable/11/sys/cddl/contrib/opensolaris/uts/common/*
MFC r328252: MFV r328251: 8652 Tautological comparisons with ZPROP_INVAL

illumos/illumos-gate@4ae5f5f06c6c2d1db8167480f7d9e3b5378ba2f2

https://www.illumos.org/issues/8652:
Clang and GCC prefer to use unsigned ints to store enums. With Clang, that
causes tautological comparison warnings when comparing a zfs_prop_t or
zpool_prop_t variable to the macro ZPROP_INVAL. It's likely that error
handling code is being silently removed as a result.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Alan Somers <asomers@gmail.com>
00:25:21 - r329492
(5 days 15 hours ago)
by mav
Affects: 
(2 files)
/stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
MFC r328250: MFV r328249:
8641 "zpool clear" and "zinject" don't work on "spare" or "replacing" vdevs

illumos/illumos-gate@2ba5f978a4f9b02da9db1b8cdd9ea5498eb00ad9

https://www.illumos.org/issues/8641:
"zpool clear" and "zinject -d" can both operate on specific vdevs, either
leaf or interior. However, due to an oversight, neither works on a "spare"
or "replacing" vdev. For example:

sudo zpool create foo raidz1 c1t5000CCA000081D61d0 c1t5000CCA000186235d0 spare c
1t5000CCA000094115d0
sudo zpool replace foo c1t5000CCA000186235d0 c1t5000CCA000094115d0
$ zpool status foo pool: foo
state: ONLINE
scan: resilvered 81.5K in 0h0m with 0 errors on Fri Sep 8 10:53:03 2017
config:

NAME STATE READ WRITE CKSUM
  foo ONLINE 0 0 0
  raidz1-0 ONLINE 0 0 0
  c1t5000CCA000081D61d0 ONLINE 0 0 0
  spare-1 ONLINE 0 0 0
  c1t5000CCA000186235d0 ONLINE 0 0 0
  c1t5000CCA000094115d0 ONLINE 0 0 0
  spares
  c1t5000CCA000094115d0 INUSE currently in use
$ sudo zinject -d spare-1 -A degrade foo
cannot find device 'spare-1' in pool 'foo'
$ sudo zpool clear foo spare-1
cannot clear errors for spare-1: no such device in pool

Even though there was nothing to clear, those commands shouldn't have
reported an error. by contrast, trying to clear "raidz1-0" works just fine:
$ sudo zpool clear foo raidz1-0

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Alan Somers <asomers@gmail.com>
00:24:31 - r329491
(5 days 15 hours ago)
by mav
Affects: 
(3 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
/stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h
MFC r328248: MFV r328247:
8959 Add notifications when a scrub is paused or resumed

illumos/illumos-gate@301fd1d6f25595cd8c6d6795f39c72d97aff8cd9

Reviewed by: Alek Pinchuk <pinchuk.alek@gmail.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Sean Eric Fagan <sef@ixsystems.com>
00:23:51 - r329490
(5 days 15 hours ago)
by mav
Affects: 
(2 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
MFC r328246:
MFV r328245: 8856 arc_cksum_is_equal() doesn't take into account ABD-logic

illumos/illumos-gate@01a059ee0cdece49f47fd4d70086dd5bc7d0b0ff

https://www.illumos.org/issues/8856:
arc_cksum_is_equal() calls zio_push_transform() that requires abd_t*
(second arg), but a void* is passed.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Roman Strashkin <roman.strashkin@nexenta.com>
00:23:12 - r329489
(5 days 15 hours ago)
by mav
Affects: 
(3 files)
/stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs.8
/stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
MFC r328234: MFV r328233:
8898 creating fs with checksum=skein on the boot pools fails ungracefully

illumos/illumos-gate@9fa2266d9a78b8366e1cd2d5f050e8b5e37d558c

https://www.illumos.org/issues/8898:
# zfs create -o checksum=skein rpool/test
internal error: Result too large
Abort (core dumped)

Not a big deal per se, but should be handled correctly.

Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

PR: 222199
00:21:42 - r329488
(5 days 15 hours ago)
by mav
Affects: 
(2 files)
/stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
MFC r328232:
MFV r328231: 8897 zpool online -e fails assertion when run on non-leaf vdevs

illumos/illumos-gate@9a551dd645b478816cb11251b19f5034d885bf01

https://www.illumos.org/issues/8897:
# zpool online -e test mirror-1
Assertion failed: nvlist_lookup_string(tgt, "path", &pathname) == 0, file
../common/libzfs_pool.c, line 2558, function zpool_vdev_online
Abort (core dumped)

Not a big deal per se, but should be handled gracefully, same way as 'offline'
and 'online' without '-e'.

Also reported as: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221408

Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>
00:20:46 - r329487
(5 days 15 hours ago)
by mav
Affects: 
(2 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
MFC r328230: MFV r328229:
8930 zfs_zinactive: do not remove the node if the filesystem is readonly

illumos/illumos-gate@93c618e0f4932dc0bb9a9c90d8c4a5d029de5797

https://www.illumos.org/issues/8930:
We normally remove an unlinked node when its last user goes away and the
node becomes inactive. However, we should not do that if the filesystem
is mounted read-only including the case where it has its readonly
property set. The node will remain on the unlinked queue, so it will
not be leaked.

One particular scenario is when we receive an incremental stream into a
mounted read-only filesystem and that stream contains an unlinked file
(still on the unlinked queue). If that file is opened before the
receive and some time later after the receive it becomes inactive we
would remove it and, thus, modify the read-only filesystem. As a
result, the filesystem would diverge from its source and further
incremental receives would not be possible (without forcing a rollback).

Another related scenario, that may or may not be possible depending on an
OS / VFS policy, is when an open file is unlinked, then the filesystem is
remounted read-only, and then the file is closed.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Andriy Gapon <avg@FreeBSD.org>
00:20:06 - r329486
(5 days 15 hours ago)
by mav
Affects: 
(6 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/*
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
MFC r328228: MFV r328227: 8909 8585 can cause a use-after-free kernel panic

illumos/illumos-gate@94ddd0900a8838f62bba15e270649a42f4ef9f81

https://www.illumos.org/issues/8909:
There's a race condition that exists if `zil_free_lwb` races with either
`zil_commit_waiter_timeout` and/or `zil_lwb_flush_vdevs_done`.

Here's an example panic due to this bug:

> ::status
  debugging crash dump vmcore.0 (64-bit) from ip-10-110-205-40
  operating system: 5.11 dlpx-5.2.2.0_2017-12-04-17-28-32b6ba51fb (i86pc)
  image uuid: 4af0edfb-e58e-6ed8-cafc-d3e9167c7513
  panic message:
  BAD TRAP: type=e (#pf Page fault) rp=ffffff0010555970 addr=60 occurred in mo
dule "zfs" due to a NULL pointer dereference
  dump content: kernel pages only

> $c
  zio_shrink+0x12()
  zil_lwb_write_issue+0x30d(ffffff03dcd15cc0, ffffff03e0730e20)
  zil_commit_waiter_timeout+0xa2(ffffff03dcd15cc0, ffffff03d97ffcf8)
  zil_commit_waiter+0xf3(ffffff03dcd15cc0, ffffff03d97ffcf8)
  zil_commit+0x80(ffffff03dcd15cc0, 9a9)
  zfs_write+0xc34(ffffff03dc38b140, ffffff0010555e60, 40, ffffff03e00fb758, 0)
  fop_write+0x5b(ffffff03dc38b140, ffffff0010555e60, 40, ffffff03e00fb758, 0)
  write+0x250(42, fffffd7ff4832000, 2000)
  sys_syscall+0x177()

If there's an outstanding lwb that's in `zil_commit_waiter_timeout`
waiting to timeout, waiting on it's waiter's CV, we must be sure not to
call `zil_free_lwb`. If we end up calling `zil_free_lwb`, then that LWB
may be freed and can result in a use-after-free situation where the
stale lwb pointer stored in the `zil_commit_waiter_t` structure of the
thread waiting on the waiter's CV is used.

A similar situation can occur if an lwb is issued to disk, and thus in
the `LWB_STATE_ISSUED` state, and `zil_free_lwb` is called while the
disk is servicing that lwb. In this situation, the lwb will be freed by
`zil_free_lwb`, which will result in a use-after-free situation when the
lwb's zio completes, and `zil_lwb_flush_vdevs_done` is called.

This race condition is prevented in `zil_close` by calling `zil_commit`
before `zil_free_lwb` is called, which will ensure all outstanding (i.e.
all lwb's in the `LWB_STATE_OPEN` and/or `LWB_STATE_ISSUED` states)
reach the `LWB_STATE_DONE` state before the lwb's are freed
(`zil_commit` will not return untill all the lwb's are
`LWB_STATE_DONE`).

Further, this race condition is prevented in `zil_sync` by only calling
`zil_free_lwb` for lwb's that do not have their `lwb_buf` pointer set.
All lwb's not in the `LWB_STATE_DONE` state will have a non-null value
for this pointer; the pointer is only cleared in
`zil_lwb_flush_vdevs_done`, at which point the lwb's state will be
changed to `LWB_STATE_DONE`.

This race is present in `zil_suspend`, leading to this bug.

At first glance, it would appear as though this would not be true
because `zil_suspend` will call `zil_commit`, just like `zil_close`, but
the problem is that `zil_suspend` will set the zilog's `zl_suspend`
field prior to calling `zil_commit`. Further, in `zil_commit`, if
`zl_suspend` is set, `zil_commit` will take a special branch of logic
and use `txg_wait_synced` instead of performing the normal `zil_commit`
logic.

This call to `txg_wait_synced` might be good enough for the data to
reach disk safely before it returns, but it does not ensure that all
outstanding lwb's reach the `LWB_STATE_DONE` state before it returns.
This is because, if there's an lwb "stuck" in
`zil_commit_waiter_timeout`, waiting for it's lwb to timeout, it will
maintain a non-null value for it's `lwb_buf` field and thus `zil_sync`
will not free that lwb. Thus, even though the lwb's data is already on
disk, the lwb will be left lingering, waiting on the CV, and will
eventually timeout and be issued to disk even though the write is
unnesseary.

So, after `zil_commit` is called from `zil_suspend`, we incorrectly
assume that there are not outstanding lwb's, and proceed to free all
lwb's found on the zilog's lwb list. As a result, we free the lwb that
will later be used `zil_commit_waiter_timeout`.

Reviewed by: John Kennedy <jwk404@gmail.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>
00:19:03 - r329485
(5 days 15 hours ago)
by mav
Affects: 
(3 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
MFC r328226: MFV r328225:
8603 rename zilog's "zl_writer_lock" to "zl_issuer_lock"

illumos/illumos-gate@cf07d3da9915c0d22da8f59e991639f819463cef

https://www.illumos.org/issues/8603:
  To help make the ZIL's code more understandable, it was suggested that
  the zilog_t's "zl_writer_lock" field should be renamed to "zl_issuer_lock".

Reviewed by: C Fraire <cfraire@me.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>
00:17:37 - r329484
(5 days 15 hours ago)
by mav
Affects: 
(13 files)
/stable/11/cddl/contrib/opensolaris/cmd/zfs/*
/stable/11/cddl/contrib/opensolaris/lib/*
/stable/11/sys/cddl/contrib/opensolaris/uts/common/*
MFC r328224: MFV r328220: 8677 Open-Context Channel Programs

illumos/illumos-gate@a3b2868063897ff0083dea538f55f9873eec981f

https://www.illumos.org/issues/8677
  We want to be able to run channel programs outside of synching context.
  This would greatly improve performance of channel program that just gather
  information, as we won't have to wait for synching context anymore.

  This feature should introduce the following:
  - A new command line flag in "zfs program" to specify our intention to
  run in open context.
  - A new flag/option within the channel program ioctl which selects the
  context.
  - Appropriate error handling whenever we try a channel program in
  open-context that contains zfs.sync* expressions.
  - Documentation for the new feature in the manual pages.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Chris Williamson <chris.williamson@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>
00:02:09 - r329483
(5 days 16 hours ago)
by ian
Affects:  /head/sys/arm/freescale/imx/imx6_machdep.c
Fix fallout from the import of fresh dts source files from linux 4.15. It
appears that node names no longer include leading zeroes in the @address
qualifiers, so we have to search for the nodes involved in interrupt fixup
using both flavors of name to be compatible with old and new .dtb files.

(You know you're in a bad place when you're applying a workaround to code
that exists only as a workaround for another problem.)
2018 - 02 - 17   (6 days ago)
23:54:59 - r329482
(5 days 16 hours ago)
by mav
Affects: 
(2 files)
/stable/11/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
MFC r323002 (by emaste): zfs: do not advertise edonr which is not yet supported

illumos 4185 ("add new cryptographic checksums to ZFS: SHA-512,
Skein, Edon-R") was intentionally merged only partially in r289422,
without adding support for skein, sha512 and edonr on FreeBSD.

Support for skein and sha512 was added later on, but edonr is still not
implemented in FreeBSD.

Prior to this commit zfs(8) correctly rejected edonr, but with an error
message that claimed support:

fk@r500 ~ $zfs set checksum=edonr tank
cannot set property for 'tank': 'checksum' must be one of 'on | off | fletcher2
| fletcher4 | sha256 | sha512 | skein | edonr'
23:51:15 - r329481
(5 days 16 hours ago)
by mav
Affects: 
(2 files)
/stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c
MFC r321104 (by jhibbits): Make ZFS not crash on mount on 32-bit systems

ZPL_VERSION is unsigned long long, not an int. With this change, a zpool
can be created on a 32-bit system (tested on powerpcspe) and mounted
correctly.
23:39:10 - r329480
(5 days 16 hours ago)
by ian
Affects:  /head/sys/dev/sdhci/fsl_sdhci.c
Don't call sdhci_cleanup_slot() if sdhci_init_slot() never got called.
Also, do callout_init() very early in attach, so that callout_drain()
can be called in detach without worrying about whether it ever got init'd.
23:23:27 - r329479
(5 days 16 hours ago)
by ian
Affects:  /head/sys/dev/usb/controller/ehci_imx.c
Do not try to deallocate memory that wasn't allocated (you'd think that
would be safe, but the function also tries to destroy mutexes that never
got created).

I guess this can only happen when imx_ehci_detach() is called on the
error-exit path from imx_ehci_attach(), and that path never got exercised
before today.
23:05:19 - r329478
(5 days 17 hours ago)
by mav
Affects: 
(2 files)
/stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
MFC r319671:
SHA-512 and Skein have been supported by the boot loader for some time.
22:45:15 - r329477
(5 days 17 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/spinlock.h
Implement spin_trylock_irq() function macro in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
22:41:20 - r329476
(5 days 17 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/lockdep.h
Stub more lockdep function macros in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
22:33:26 - r329475
(5 days 17 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/pid.h
Implement get_task_pid() function macro in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
22:18:39 - r329474
(5 days 17 hours ago)
by cem
Affects:  /head/stand/liblua/lstd.c
/head/stand/liblua/lstd.h
liblua: Emulate DIR, opendir, fdopendir, closedir

In a similar fashion to FILE, provide thin shims for the standard directory
manipulation functions.

Reviewed by: imp
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14417
22:17:21 - r329473
(5 days 17 hours ago)
by cem
Affects:  /head/stand/liblua/lutils.c
/head/stand/liblua/lutils.h
liblua: Clean up io/loader C module registration

Utilize registration APIs Lua provides to make module definition a little
cleaner.

Discussed with: imp
Sponsored by: Dell EMC Isilon
21:47:15 - r329472
(5 days 18 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/uaccess.h
Allow the put_user() function macro to put constant values by using the
existing __put_user() macro.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
21:40:19 - r329471
(5 days 18 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/kernel.h
Implement BUILD_BUG_ON_INVALID() function macro in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
21:25:19 - r329470
(5 days 18 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/printk.h
Add support for printk_ratelimit() function macro and improve the existing
printk_ratelimited() function macro to return a boolean stating if there
was a printout, true, or not, false.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
20:59:12 - r329469
(5 days 19 hours ago)
by jhibbits
Affects: 
(11 files)
/head/sys/powerpc/*
Merge AIM and Book-E PCPU fields

This is part of a long-term goal of merging Book-E and AIM into a single GENERIC
kernel. As more work is done, the struct may be optimized further.

Reviewed by: nwhitehorn
20:56:35 - r329468
(5 days 19 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/kref.h
Add support for kref_read() function in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
20:52:54 - r329467
(5 days 19 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/mm_types.h
Add support for mmgrab() function in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
20:50:18 - r329466
(5 days 19 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/compiler.h
Add support for __percpu and __weak macros in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
20:37:21 - r329465
(5 days 19 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/device.h
/head/sys/compat/linuxkpi/common/include/linux/interrupt.h
/head/sys/compat/linuxkpi/common/include/linux/irqreturn.h
Move the IRQ_RETVAL() and irqreturn definitions to irqreturn.h in the
LinuxKPI to be compatible with Linux. No functional change.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
20:09:43 - r329464
(5 days 19 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/linux/interrupt.h
Add checks for valid IRQ tag before setting up or tearing down an interrupt
handler in the LinuxKPI. This is needed when the interrupt handler is disabled
before freeing the interrupt.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
18:30:25 - r329463
(5 days 21 hours ago)
by manu
Affects:  /head/sys/arm/allwinner/aw_mmc.c
aw_mmc: Only change the clock if it has really changed

This also seems to fix problem when booting Pine64 from the mmc.

Tested On: Pine64
Tested On: Pine64-LTS
18:00:01 - r329462
(5 days 22 hours ago)
by kib
Affects: 
(48 files)
/stable/11/sys/*
MFC r328083,328096,328116,328119,328120,328128,328135,328153,328157,
328166,328177,328199,328202,328205,328468,328470,328624,328625,328627,
328628,329214,329297,329365:

Meltdown mitigation by PTI, PCID optimization of PTI, and kernel use of IBRS
for some mitigations of Spectre.

Tested by: emaste, Arshan Khanifar <arshankhanifar@gmail.com>
Discussed with: jkim
Sponsored by: The FreeBSD Foundation
17:23:43 - r329461
(5 days 22 hours ago)
by mjg
Affects:  /head/sys/kern/kern_exit.c
Revert r329448.

Turns out is is actually racy, reproducible with stress2/misc/truss.sh

Requested by: kib
14:44:03 - r329460
(6 days 1 hour ago)
by hselasky
Affects:  /head/sys/dev/usb/usb_lookup.c
Remove unused bus_autoconf section from usb.ko.

Sponsored by: Mellanox Technologies
14:40:28 - r329459
(6 days 1 hour ago)
by hselasky
Affects:  /head/tools/tools/bus_autoconf
Remove obsolete tool, bus_autoconf, which is replaced by devmatch(8).
14:34:47 - r329458
(6 days 1 hour ago)
by hselasky
Affects:  /head/sbin/devmatch/devmatch.c
Fix USB driver matching in devmatch(8).

Multiple drivers can match on the same USB device and the order of loading
decides which driver gets the device. Use the supplied mask value as an
indication of priority, so that vendor specific device drivers are loaded
before more generic ones.

Sponsored by: Mellanox Technologies
14:30:39 - r329457
(6 days 1 hour ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: dumpModules => lsModules

rgrimes@ notes that this behavior is more befitting of the latter name than
the former, and I'm inclined to agree.

Reported by: rgrimes
13:32:29 - r329456
(6 days 2 hours ago)
by hselasky
Affects:  /head/etc/rc.d/devmatch
Fix handling of "one_nomatch" shell variable to preserve its contents
appearing as a single argument passed to devmatch(8).

Don't depend on "sort" utility from usr/bin which might not be
available when devd is started.

Sponsored by: Mellanox Technologies
13:13:55 - r329455
(6 days 2 hours ago)
by hselasky
Affects:  /head/etc/devd/devmatch.conf
Invoke devmatch rc.d script directly instead of depending on "service"
which is installed in usr/sbin and might not be available at the time
devd is started.

Sponsored by: Mellanox Technologies
12:38:46 - r329454
(6 days 3 hours ago)
by hselasky
Affects:  /head/sys/dev/usb/usb_hub.c
Revert redundant parts of r329440 after recent devmatch(8) changes.

Sponsored by: Mellanox Technologies
12:32:53 - r329453
(6 days 3 hours ago)
by oshogbo
Affects:  /head/bin/uuidgen/uuidgen.c
Capsicumize uuidgen.
12:22:29 - r329452
(6 days 3 hours ago)
by oshogbo
Affects: 
(20 files)
/head/lib/libcasper/libcasper/*
/head/lib/libcasper/services/*
Introduce channel flags in libcasper.

Instead of passing flags (which describe a type of nvlist)
every send/recv we remember them in channel.
It's enough for use to extract them only during unwrap.
This simplify use of Casper.

Reviewed by: bruffer@, bcr@ (both man page)
Differential Revision: https://reviews.freebsd.org/D14196 (man page)
12:07:09 - r329451
(6 days 4 hours ago)
by mjg
Affects:  /head/sys/kern/kern_rwlock.c
/head/sys/kern/kern_sx.c
/head/sys/sys/lockstat.h
Undo LOCK_PROFILING pessimisation after r313454 and r313455

With the option used to compile the kernel both sx and rw shared ops would
always go to the slow path which added avoidable overhead even when the
facility is disabled.

Furthermore the increased time spent doing uncontested shared lock acquire
would be bogusly added to total wait time, somewhat skewing the results.

Restore old behaviour of going there only when profiling is enabled.

This change is a no-op for kernels without LOCK_PROFILING (which is the
default).
09:58:53 - r329450
(6 days 6 hours ago)
by hselasky
Affects:  /stable/11/sys/sys/param.h
Bump the FreeBSD version after r329383 to indicate that the
cmpxchg() macro is now fully functional in the LinuxKPI.

This is a direct commit.

Sponsored by: Mellanox Technologies
09:03:11 - r329449
(6 days 7 hours ago)
by mjg
Affects:  /head/sys/kern/kern_exit.c
exit: stop doing PROC_SLOCK just to call proc_reap

It immediately does PROC_SUNLOCK anyway and the lock plays no role.
08:48:45 - r329448
(6 days 7 hours ago)
by mjg
Affects:  /head/sys/kern/kern_exit.c
exit: get rid of PROC_SLOCK when checking a process to report

All accessed fields are protected with already held process lock.
08:12:35 - r329447
(6 days 7 hours ago)
by hselasky
Affects:  /head/sys/compat/linuxkpi/common/include/asm/atomic.h
Compile fix for GCC in the LinuxKPI.

Older versions of GCC don't allow flexible array members in a union.
Use a zero length array instead.

MFC after: 1 week
Reported by: jbeich@
Sponsored by: Mellanox Technologies
06:57:43 - r329446
(6 days 9 hours ago)
by imp
Affects:  /head/sbin/devmatch/devmatch.8
/head/sbin/devmatch/devmatch.c
Implement --hints to read hints file directly

In testing, it's often useful to copy a few files into a directory and
kldxref them to ensure that particular cases are handled correctly.
Add --hints (-h) to facilitate this testing and enable future
automated testing.

Sponsored by: Netflix
06:57:38 - r329445
(6 days 9 hours ago)
by imp
Affects:  /head/etc/devd/devmatch.conf
Pass in the NOMATCH event to devmatch

In devd/devmatch.conf, we need to pass the event to the devmatch
serivce. It gets passed to devmatch -p for matching. We always pass
this, unlike hps' original patch, so we kill two birds with one stone
and only match modules to the event passed in.

Submitted by: hps@
Sponsored by: Netflix
06:57:34 - r329444
(6 days 9 hours ago)
by imp
Affects:  /head/sbin/devmatch/devmatch.8
/head/sbin/devmatch/devmatch.c
Add option to parse NOMATCH event and suggest modules to load

Add --nomatch/-p to search for individual drivers based on a NOMATCH
event from devd.

Submitted by: hps (earlier version)
Sponsored by: Netflix
06:57:30 - r329443
(6 days 9 hours ago)
by imp
Affects:  /head/sbin/devmatch/devmatch.c
Tweak the 'I' flagged value

'I' was omitting 'zero' values. This is not quite correct, and was put
in as a hack but not documented. Remove it. If we find what the hack
was really needed for, we'll either fix the need for it, or invent a
new flagged value type.

Submitted by: hps@
Sponsored by: Netflix
06:57:25 - r329442
(6 days 9 hours ago)
by imp
Affects:  /head/sbin/devmatch/devmatch.c
Implement 'T' field matching.

Implement 'T' field matching. This is needed to prevent false
positives. However, it's not general enough. It only handles one field
and there's a ton of edge cases even with that it likely wouldn't
handle. To do it more generally and also eliminate a lot of the
hackiness that's in this program now, we'd need to creating
directories for lookups ala awk, pearl, python, etc. It appears to be
sufficient, though, to get my keyboard loaded on boot.

Sponsored by: Netflix
06:57:21 - r329441
(6 days 9 hours ago)
by imp
Affects:  /head/etc/rc.d/devmatch
If we're passed an argument, then treat it as a single NOMATCH event
to parse rather than searching for all events. Pass with new -p arg to
devmatch. devmatch will use that one event rather than walking the
entire tree.

kldload will stop at the first failure. So we need to loop. Also,
symbolic links may confused kldload into trying (and failing) to load
multiple modules at once, so guard against that.

Noticed by: hps (with similar patch)
Sponsored by: Netflix
06:57:17 - r329440
(6 days 9 hours ago)
by imp
Affects:  /head/sys/dev/usb/usb_hub.c
/head/sys/dev/usb/usbdi.h
Correct the PNP information generated by the usb driver to match the
artificial NOMATCH usb does in lieu of creating a device_t for devices
with no drivers. Also, correct bus to be 'uhub' since where USB
devices attach, even though 'usb' is more logical, we need the
physical bus here.

Submitted by: hps@
06:57:12 - r329439
(6 days 9 hours ago)
by imp
Affects:  /head/sbin/devmatch/devmatch.c
Warn when we encounter unknown PNP field specifiers.

The 'T' field went unimplemented for months due to a lack of warning.
Add a warnings to detect mistakes sooner.

Sponsored by: Netflix
06:57:08 - r329438
(6 days 9 hours ago)
by imp
Affects:  /head/share/man/man9/MODULE_PNP_INFO.9
Add description for T specifier. It's for PNP keys that are checked
programatically that must be true for a device to match, but aren't in
the table as discrete fields.

Sponsored by: Netflix
06:57:03 - r329437
(6 days 9 hours ago)
by imp
Affects:  /head/sys/sys/module.h
/head/usr.sbin/kldxref/kldxref.c
Fixup minor nits in the PNP_INFO protocol.

Sponsored by: Netflix
05:53:41 - r329436
(6 days 10 hours ago)
by kevans
Affects:  /head/stand/lua/password.lua
stand/lua: Debugging string snuck in...
05:52:25 - r329435
(6 days 10 hours ago)
by kevans
Affects: 
(7 files)
/head/stand/lua/*
stand/lua: Style pass

These are the style points that I'd like to try and maintain in our lua
scripts:
- Parentheses around conditionals
- Trailing semicolons, except on block terminators
- s:method(...) instead of string.method(s, ...) where applicable

There's likely more, but that'll get hammered out as we continue.
05:28:06 - r329434
(6 days 10 hours ago)
by kevans
Affects:  /head/stand/lua/password.lua
stand/lua: Check for nil (GELI prompt)
05:26:28 - r329433
(6 days 10 hours ago)
by kevans
Affects:  /head/stand/lua/password.lua
stand/lua: Add optional GELI passphrase prompt

Prompt for GELI passphrase when geom_eli_passphrase_prompt has been set to
"YES" in loader.conf(5).

This entailed breaking out the password prompt into its own function that
can be reused between the password compare bits and this prompt that simply
takes the entered password and passes it along in the environment as
kern.geom.eli.passphrase.

I've also added a TODO to re-evaluate later if we want the "password
masking" -- it is currently not functional, so one still can't observe the
length of the password typed at the prompt.
05:02:38 - r329432
(6 days 11 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: Try to load alternate kernels as directories first

This is the procedure that config.loadkernel tries to go through, but
reloading kernel config didn't use this function. Amend config.loadkernel to
take an optional other_kernel.

While here, be a little more verbose ("Trying to load kernel") so that it's
easy to follow where we've gone wrong.
04:46:06 - r329431
(6 days 11 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: Correct test sense, this should have been 'not nil'
04:43:41 - r329430
(6 days 11 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: Address some nits

1.) Instead of string.function(s, ...), use s:function(...)
2.) Don't try to concatenate `res`, it was just tested to be nil
3.) Note that "Loading configuration" is configured modules, and be a little
more precise in mentioning what failed ("loading of one or more modules")
04:33:37 - r329429
(6 days 11 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: Add debug method to dump modules
04:22:36 - r329428
(6 days 11 hours ago)
by kevans
Affects:  /head/stand/lua/config.lua
stand/lua: Correct some trivial errors in config

An empty module_path to start with isn't ideal, but if all modules are
contained within a kernel directory (which is what we just tested) then it
isn't strictly an error. Don't assume that module_path has a value already.

When we fail to load the kernel, printing the result (which is guaranteed to
be nil) is not intended; print the name of the kernel.
04:07:16 - r329427
(6 days 12 hours ago)
by kevans
Affects:  /head/stand/lua/menu.lua
stand/lua: Color non-default kernels blue
03:39:55 - r329426
(6 days 12 hours ago)
by kevans
Affects:  /head/stand/lua/menu.lua
stand/lua: Correct interpretation of autoboot_delay

autoboot_delay=NO is documented to wait for input and *not* autoboot, which
is the exact opposite of the current behavior.

Additionally, autoboot_delay=-1 is documented to disallow the user from
interrupting the boot (i.e. autoboot immediately), which was not previously
honored.

This also fixes the case insensitive comparison to be truly case
insensitive. This is kind of nit-picky, but the previous version would only
accept "no" and "NO".
03:13:05 - r329425
(6 days 12 hours ago)
by kevans
Affects:  /head/stand/lua/menu.lua
stand/lua: Enable menu autoboot; it seems to work
03:12:35 - r329424
(6 days 12 hours ago)
by kevans
Affects:  /head/stand/lua/menu.lua
stand/lua: Don't set autoboot_delay=NO in menu autoboot sequence

We'll set it later if "Escape to loader prompt" is actually chosen, there's
no need to be setting it here.
02:14:01 - r329423
(6 days 13 hours ago)
by kevans
Affects: 
(4 files)
/stable/11/stand/libsa/ip.c
/stable/11/stand/libsa/net.c
/stable/11/stand/libsa/tftp.c
MFC r329264: libsa: Fix IP recv timeout

[This is slightly modified to not set `t` in the middle of the loop so that
the connection will eventually timeout after MAXTMO]

readip() doesn't, at the moment, properly indicate to callers that it has
timed out. One can tell that it's timed out if errno == EAGAIN when it
returns, but this is not ideal. Restructure it a little bit to explicitly
set errno to ETIMEDOUT if we've exhausted tleft.

I found two places that care about where it timed out or not: sendrecv in
net.c and sendrecv_tftp. Both are structured to pass smaller timeout values
to readip while tracking a larger timeout. Neither of them were able to do
this properly with readip not indicating ETIMEDOUT, so fix it.

While here, straighten out the time (t/t1) usage in sendrecv_tftp.

This would have manifested itself in periodic failures to NFS/TFTP boot for
no apparent reason because MINTMO/MAXTMO were not actually being respected
properly. Problems were not reported with NFS, only TFTP.
00:24:50 - r329422
(6 days 15 hours ago)
by mjg
Affects:  /head/sys/kern/kern_exit.c
On process exit signal the parent after dropping the proctree lock.
00:23:56 - r329421
(6 days 15 hours ago)
by mjg
Affects:  /head/sys/kern/kern_exit.c
Unref the prison after proctree is dropped.
00:23:28 - r329420
(6 days 15 hours ago)
by mjg
Affects:  /head/sys/kern/kern_fork.c
Postpone sx_sunlock(&proctree_lock) on fork until after allproc is dropped.

There is a significant contention on the lock during -j 128 package build.
This change drops total wait time on this lock by 60%.
00:21:50 - r329419
(6 days 15 hours ago)
by mjg
Affects:  /head/sys/kern/kern_exit.c
Tidy up kern_wait6

- don't relock curproc in msleep
- don't relock proctree if P_STATCHILD is spotted
- reformat the proc_to_reap call in the main loop
00:12:30 - r329418
(6 days 15 hours ago)
by benno
Affects:  /head/stand/i386/boot2/boot2.c
Revert r329269.

I tried to rework a section to fit inside 80 columns but the change ended
up being functional. Back this out so I can readdress.

 


Powered by Python FreeBSD support by secnetix GmbH & Co. KG

Page generated in 42 ms, 449 revisions printed. Current time is 2018-02-23 16:08:05. All times are in UTC/GMT.