]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMerge ^/head r317971 through r318379.
Dimitry Andric [Tue, 16 May 2017 19:54:47 +0000 (19:54 +0000)]
Merge ^/head r317971 through r318379.

7 years agonewfs_msdos: clarify description of -T (timestamp) option
Ed Maste [Tue, 16 May 2017 19:03:26 +0000 (19:03 +0000)]
newfs_msdos: clarify description of -T (timestamp) option

Submitted by: Siva Mahadevan <smahadevan@freebsdfoundation.org>
Reported by: Daniel Shahaf <danielsh apache org>
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

7 years agoImport libxo-0.7.2; add xo_options.7.
Phil Shafer [Tue, 16 May 2017 18:46:56 +0000 (18:46 +0000)]
Import libxo-0.7.2; add xo_options.7.

Submitted by: phil
Reviewed by: sjg
Approved by: sjg (mentor)

7 years agoSkip tests depending on coredumps if coredumps are disabled via kern.coredump.
John Baldwin [Tue, 16 May 2017 18:42:44 +0000 (18:42 +0000)]
Skip tests depending on coredumps if coredumps are disabled via kern.coredump.

The kern.coredump sysctl can be set to 0 to disable coredumps.  Skip the
'status_coredump' and 'wait6_coredumped' tests if this sysctl is set to 0
rather than reporting a failure.

Submitted by: brooks
Reviewed by: ngie
Obtained from: CheriBSD
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D10665

7 years agoImport libxo 0.7.2
Phil Shafer [Tue, 16 May 2017 18:41:36 +0000 (18:41 +0000)]
Import libxo 0.7.2

7 years agoFix p_endcopy.
John Baldwin [Tue, 16 May 2017 18:39:23 +0000 (18:39 +0000)]
Fix p_endcopy.

For p_endcopy to work correctly, it must be the name of the next element
in struct proc after the end of the copy region, not the name of the
last element in the copy region.  Currently, the last element
(p_elf_flags) is not being copied.  In addition, the p_xexit and
p_xsig fields should not be copied on fork, so move them out of the
copy region.

Reviewed by: kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D10677

7 years agoAdd version tag to the driver.
Sean Bruno [Tue, 16 May 2017 18:05:34 +0000 (18:05 +0000)]
Add version tag to the driver.

Start at version 1.0.0.0

Submitted by: bhargava.marreddy@broadcom.com
Reviewed by: venkatkumar.duvvuru@broadcom.com
Differential Revision: https://reviews.freebsd.org/D10616

7 years agolibstand: increase nfs max read size to 16k
Toomas Soome [Tue, 16 May 2017 17:35:05 +0000 (17:35 +0000)]
libstand: increase nfs max read size to 16k

With ip fragment reassembly implemented, it makes sense to allow
larger nfs reads. Note due to loader heap size limit, we do not want
to set too large maximum read size. Also we do not change default read size.

Reviewed by: bcr, allanjude
Differential Revision: https://reviews.freebsd.org/D10754

7 years agonewfs_msdos: add -T (timestamp) option for reproducible builds
Ed Maste [Tue, 16 May 2017 17:04:50 +0000 (17:04 +0000)]
newfs_msdos: add -T (timestamp) option for reproducible builds

This includes some whitespace and minor bug fixes relative to NetBSD,
which will be submitted upstream at the conclusion of the makefs
msdos update.

NetBSD revs:
mkfs_msdos.c 1.11
mkfs_msdos.h 1.4
newfs_msdos.8 1.22
newfs_msdos.c 1.44

Submitted by: Siva Mahadevan <smahadevan@freebsdfoundation.org>
Reviewed by: emaste
Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation

7 years agoCorrect page frame mask constant used in pmap_change_attr_locked
Conrad Meyer [Tue, 16 May 2017 16:20:22 +0000 (16:20 +0000)]
Correct page frame mask constant used in pmap_change_attr_locked

This was introduced in r290156.  It's present in 11.0, but not any 10.x
release unless someone decided to MFC it.

It affects ordinary pages right above the DMAP limit, which is effectively
system memory rounded up to a 1 GB (3rd level superpage) boundary (or up to
a minimum of 4 GB, on small systems).

Reported by: vangyzen
Reviewed by: kib, alc
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D4030

7 years agoAvoid use of contiguous memory allocations in busdma when possible.
Hans Petter Selasky [Tue, 16 May 2017 14:21:37 +0000 (14:21 +0000)]
Avoid use of contiguous memory allocations in busdma when possible.

This patch improves the boundary checks in busdma to allow more cases
using the regular page based kernel memory allocator. Especially in
the case of having a non-zero boundary in the parent DMA tag. For
example AMD64 based platforms set the PCI DMA tag boundary to
PCI_DMA_BOUNDARY, 4GB, which before this patch caused contiguous
memory allocations to be preferred when allocating more than PAGE_SIZE
bytes. Even if the required alignment was less than PAGE_SIZE bytes.

This patch also fixes the nsegments check for using kmem_alloc_attr()
when the maximum segment size is less than PAGE_SIZE bytes.

Updated some comments describing the code in question.

Differential Revision: https://reviews.freebsd.org/D10645
Reviewed by: kib, jhb, gallatin, scottl
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoRename rtld's parse_libdir to parse_integer.
Jonathan Anderson [Tue, 16 May 2017 13:27:44 +0000 (13:27 +0000)]
Rename rtld's parse_libdir to parse_integer.

This is a more accurate name, as the integer doesn't have to be a library
directory descriptor. It is also a prerequisite for more argument parsing
coming in the near future (e.g., parsing explicit binary descriptors).

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: NSERC

7 years agoAdd the Marvell SDHCI controller to the list of supported devices in
Luiz Otavio O Souza [Tue, 16 May 2017 05:10:15 +0000 (05:10 +0000)]
Add the Marvell SDHCI controller to the list of supported devices in
sdhci_fdt.

Enable the SDHCI controller, bus and devices on ARMADA38X kernel.

Tested on: ClearFog Pro
Reviewed by: Marcin Wojtas <mw at semihalf.com>
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D10606

7 years agoAdd the SDHCI Address Decoder registers and routines for ARMADA 38X.
Luiz Otavio O Souza [Tue, 16 May 2017 04:47:50 +0000 (04:47 +0000)]
Add the SDHCI Address Decoder registers and routines for ARMADA 38X.

Tested on: ClearFog Pro
Reviewed by: Marcin Wojtas <mw at semihalf.com>
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D10601

7 years agoCorrect pa argument type for pmap_kenter_attr()
Justin Hibbits [Tue, 16 May 2017 03:31:49 +0000 (03:31 +0000)]
Correct pa argument type for pmap_kenter_attr()

Physical addresses are vm_paddr_t, not vm_offset_t.  This can make a difference
when sizeof(vm_offset_t) != sizeof(vm_paddr_t).

7 years agoEnable llvm-objdump by default per r310775
Bryan Drewery [Tue, 16 May 2017 03:12:51 +0000 (03:12 +0000)]
Enable llvm-objdump by default per r310775

7 years agoImplement ippool command line IPv6 address parse support (for the -i
Cy Schubert [Tue, 16 May 2017 02:48:46 +0000 (02:48 +0000)]
Implement ippool command line IPv6 address parse support (for the -i
option).

PR: 218433

7 years ago- Revert r317171. [1]
Jung-uk Kim [Mon, 15 May 2017 23:12:04 +0000 (23:12 +0000)]
- Revert r317171. [1]
- Fix overlapping corners and fix an off-by-one bug.

MFC after: 3 days
Requested by: emaste [1]

7 years agoStart writing up some basic feature tests for procstat
Enji Cooper [Mon, 15 May 2017 22:52:25 +0000 (22:52 +0000)]
Start writing up some basic feature tests for procstat

These tests query a running process for information related to the -b,
-c, -e, and -f flags; the -f testcase is largely stubbed out, pending
additional work to determine a good, deterministic descriptor.

Core file test support is coming soon--it requires a bit more effort
due to the fact that:
- coredumps can be disabled (kern.coredump=0).
- corefiles can be put in different directories than the current
  directory, or be named something other than `<prog>.core`
  (`kern.corefile`).

MFC after: 2 months
Sponsored by: Dell EMC Isilon

7 years agoReduce in_pcbinfo_init() by two params. No users supply any flags to this
Gleb Smirnoff [Mon, 15 May 2017 21:58:36 +0000 (21:58 +0000)]
Reduce in_pcbinfo_init() by two params.  No users supply any flags to this
function (they used to say UMA_ZONE_NOFREE), so flag parameter goes away.
The zone_fini parameter also goes away.  Previously no protocols (except
divert) supplied zone_fini function, so inpcb locks were leaked with slabs.
This was okay while zones were allocated with UMA_ZONE_NOFREE flag, but now
this is a leak.  Fix that by suppling inpcb_fini() function as fini method
for all inpcb zones.

7 years agoloader: add ip layer code into libstand
Toomas Soome [Mon, 15 May 2017 21:50:34 +0000 (21:50 +0000)]
loader: add ip layer code into libstand

Implement simple separate ip module and fragment re-assembly.

The work is based on send and receive previously implemented in udp.c,
moved to ip.c and added the ip fragment re-assembly.

This change allows to specify larger tftp or nfs payload, such as:
tftp.blksize=4096 or nfs.read_size=4096

Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D10631

7 years agoEnsure that profile and tick probes provide a non-zero PC value.
Mark Johnston [Mon, 15 May 2017 21:44:40 +0000 (21:44 +0000)]
Ensure that profile and tick probes provide a non-zero PC value.

The idle thread may process callouts while reloading the timer in
cpu_activeclock(). In this case, provide a representative value, &cpu_idle,
instead of 0 for args[0] so that the active thread can be more easily
identified from the probe.

This addresses intermittent failures of the profile-n/tst.argtest.d test.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D10651

7 years agoEnsure that resume path on amd64 only accesses page tables for normal
Konstantin Belousov [Mon, 15 May 2017 20:52:43 +0000 (20:52 +0000)]
Ensure that resume path on amd64 only accesses page tables for normal
operation after processor is configured to allow all required
features.

In particular, NX must be enabled in EFER, otherwise load of page
table element with nx bit set causes reserved bit page fault.  Since
malloc uses direct mapping for small allocations, in particular for
the suspension pcbs, and DMAP is nx after r316767, this commit tripped
fault on resume path.

Restore complete state of EFER while wakeup code is still executing
with custom page table, before calling resumectx, instead of trying to
guess which features might be needed before resumectx restored EFER on
its own.

Bisected and tested by: trasz
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agobsdgrep: add more tests for different binary flags
Ed Maste [Mon, 15 May 2017 20:41:29 +0000 (20:41 +0000)]
bsdgrep: add more tests for different binary flags

The existing 'binary' test in netbsd-tests/ does a basic check of the
default treatment for binary behavior, but not much more than that.
Given some opportunity for breakage recently that did not trigger any
failures, add some tests to cover the three different binary file
behaviors (a, -I, -U) and their --binary-files= equivalent values.

Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: cem, ngie
Differential Revision: https://reviews.freebsd.org/D10620

7 years agouniq: allow -c to be used with -d or -u
Ed Maste [Mon, 15 May 2017 20:18:14 +0000 (20:18 +0000)]
uniq: allow -c to be used with -d or -u

Bring in some bits from NetBSD and lift the restriction in uniq(1) that
-c cannot be used with the -d and -u options.  This restriction seems
unnecessary and is supported at least by GNU, OpenBSD, and NetBSD.  Lift
the restriction and simplify the show() logic a little bit to maintain
functionality when -c is provided with -d/-u.

Also with this change, -d and -u are now actually a mutually exclusive,
albeit valid, combination.  Given that they both indicate opposite
behavior, uniq(1) will no longer output anything if both -d and -u are
supplied.  This is in line with NetBSD as well as GNU.

Adjust the man page and usage() to reflect that -c is its own standalone
option.

PR: 200553
Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: cem, emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10694

7 years agolib/libc/gen/realpath_test: make check result from getcwd(3)
Enji Cooper [Mon, 15 May 2017 19:58:01 +0000 (19:58 +0000)]
lib/libc/gen/realpath_test: make check result from getcwd(3)

This is being done to avoid dereferencing a NULL pointer via strlcat,
obscuring the underlying issue with the getcwd(3) call.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoAdd information to open(2) man page about the O_VERIFY flag.
Stephen J. Kiernan [Mon, 15 May 2017 19:32:26 +0000 (19:32 +0000)]
Add information to open(2) man page about the O_VERIFY flag.

Reviewed by: bjk wblock
Approved by: sjg (mentor)
Obtained from: Juniper Networks, Inc.

7 years agoMake ld-elf.so.1 directly executable.
Konstantin Belousov [Mon, 15 May 2017 18:48:58 +0000 (18:48 +0000)]
Make ld-elf.so.1 directly executable.

Check if passed phdr is actually phdr of the interpreter itself, and
decide that this is the case of direct execution.  In this case, the
binary to activate is specified in the argv[1].  After opening it,
shift down on-stack structure with argv, env and aux vectors to
emulate execution of the binary and not of the interpreter.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D10701

7 years agoFix the AT_EXECFD functionality.
Konstantin Belousov [Mon, 15 May 2017 18:47:25 +0000 (18:47 +0000)]
Fix the AT_EXECFD functionality.

If the mapped object is linked at specific address, we must obey it.
If AT_EXECFD is not used, only in-kernel ELF image activator needed to
keep the mapping address, since only binaries are linked at the fixed
address, and binaries are mapped by kernel in this case.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
X-Differential revision: https://reviews.freebsd.org/D10701

7 years agocxgbe(4): Avoid an out of bounds access when an attempt to unbind a tx
Navdeep Parhar [Mon, 15 May 2017 18:18:32 +0000 (18:18 +0000)]
cxgbe(4): Avoid an out of bounds access when an attempt to unbind a tx
queue from a traffic class fails.

Reported by: x ksi <s3810 at pjwstk edu pl>
MFC after: 3 days

7 years agomakeman: reword description, based on feedback from wblock
Ed Maste [Mon, 15 May 2017 18:02:13 +0000 (18:02 +0000)]
makeman: reword description, based on feedback from wblock

7 years agogetusershell: don't write past end of line buffer reading local shells
Ed Maste [Mon, 15 May 2017 17:57:09 +0000 (17:57 +0000)]
getusershell: don't write past end of line buffer reading local shells

_local_initshells did not reset cp to the beginning of the line buffer
for every iteration that it called fgets(3), leading to writing past the
end of line with fairly long /etc/shells or excessively long line
lengths. Correct this by properly resetting cp.

PR: 192528
Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: cem, jilles
Differential Revision: https://reviews.freebsd.org/D10690

7 years agoStyle.
Konstantin Belousov [Mon, 15 May 2017 17:54:36 +0000 (17:54 +0000)]
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agobsdgrep: don't allow negative -A / -B / -C
Ed Maste [Mon, 15 May 2017 17:51:01 +0000 (17:51 +0000)]
bsdgrep: don't allow negative -A / -B / -C

Previously, when given a negative -A/-B/-C argument bsdgrep would
overflow the respective context flag(s) and exhibited surprising
behavior.

Fix this by removing unsignedness of Aflag/Bflag and erroring out if
we're given a value < 0.  Also adjust the type used to track 'tail'
context in procfile() so that it accurately reflects the Aflag value
rather than overflowing and losing trailing context.

This also fixes an inconsistency previously existing between -n and
-C "n" behavior.  They are now both limited to LLONG_MAX, to be
consistent.

Add some test cases to make sure grep errors out properly for both
negative context values as well as non-numeric context values rather
than giving bogus matches.

Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D10675

7 years agoSimplify cleanup on failure in realpath(3).
Konstantin Belousov [Mon, 15 May 2017 17:34:17 +0000 (17:34 +0000)]
Simplify cleanup on failure in realpath(3).

If realpath() allocated memory for result and failed, the memory is
freed in each place where return is performed.  More, the function
needs to track the allocation status, to not free user-supplied
buffer.

Consolidate the memory handling in the wrapper, freeing the buffer if
the actual worker failed.

Reviewed by: emaste (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D10670

7 years agoFix several buffer overflows in realpath(3).
Konstantin Belousov [Mon, 15 May 2017 17:14:53 +0000 (17:14 +0000)]
Fix several buffer overflows in realpath(3).
- The statement "left_len -= s - left;" does not take the slash into
  account if one was found. This results in the invariant
  "left[left_len] == '\0'" being violated (and possible buffer
  overflows). The patch replaces the variable "s" with a size_t
  "next_token_len" for more clarity.
- "slen" from readlink(2) can be 0 when encountering empty
  symlinks. Then, further down, "symlink[slen - 1]" underflows the
  buffer. When slen == 0, realpath(3) should probably return ENOENT
  (http://austingroupbugs.net/view.php?id=825,
  https://lwn.net/Articles/551224/).

Some other minor issues:
- The condition "resolved_len >= PATH_MAX" cannot be true.
- Similarly, "s - left >= sizeof(next_token)" cannot be true, as long
  as "sizeof(next_token) >= sizeof(left)".
- Return ENAMETOOLONG when a resolved symlink from readlink(2) is too
  long for the symlink buffer (instead of just truncating it).
- "resolved_len > 1" below the call to readlink(2) is always true as
  "strlcat(resolved, next_token, PATH_MAX);" always results in a
  string of length > 1. Also, "resolved[resolved_len - 1] = '\0';" is
  not needed; there can never be a trailing slash here.
- The truncation check for "strlcat(symlink, left, sizeof(symlink));"
  should be against "sizeof(symlink)" (the third argument to strlcat)
  instead of "sizeof(left)".

Submitted by: Jan Kokemц╪ller <jan.kokemueller@gmail.com>
PR: 219154
MFC after: 2 weeks

7 years agoe1000api: misleading-indentation
Toomas Soome [Mon, 15 May 2017 16:53:02 +0000 (16:53 +0000)]
e1000api: misleading-indentation

Two blocks in e1000_ich8lan.c are misaligned, causing noise with some
compilers (gcc 6).

Reviewed by: imp, erj
Differential Revision: https://reviews.freebsd.org/D10741

7 years agoCorrect the URL to instructions for updated system sources.
Glen Barber [Mon, 15 May 2017 15:18:36 +0000 (15:18 +0000)]
Correct the URL to instructions for updated system sources.

MFC after: 3 days
Submitted by: schaiba <at> gmail <dot> com
PR: 219303
Sponsored by: The FreeBSD Foundation

7 years agoMake nfscl_mtofh() return ENXIO when *nfhpp == NULL.
Rick Macklem [Mon, 15 May 2017 13:14:13 +0000 (13:14 +0000)]
Make nfscl_mtofh() return ENXIO when *nfhpp == NULL.

r317272 introduced a case where nfscl_mtofh() could return 0 when
*nfhpp is NULL. This patch makes it return ENXIO for this case.

MFC after: 1 week

7 years agomnt_vnode_next_active: use conventional lock order when trylock fails.
Konstantin Belousov [Mon, 15 May 2017 10:02:45 +0000 (10:02 +0000)]
mnt_vnode_next_active: use conventional lock order when trylock fails.

Previously, when the VI_TRYLOCK failed, we would spin under the mutex
that protects the vnode active list until we either succeeded or
noticed that we had hogged the CPU. Since we were violating the lock
order, this would guarantee that we would become a hog under any
deadlock condition (e.g. a race with vdrop(9) on the same vnode). In
the presence of many concurrent threads in sync(2) or vdrop etc, the
victim could hang for a long time.

Now, avoid spinning by dropping and reacquiring the locks in the
conventional lock order when the trylock fails. This requires a dance
with the vnode hold count.

Submitted by: Tom Rix <trix@juniper.net>
Tested by: pho
Differential revision: https://reviews.freebsd.org/D10692

7 years agoJust like r318173, which was for outputting IPv6 addresses in tree
Cy Schubert [Mon, 15 May 2017 03:39:35 +0000 (03:39 +0000)]
Just like r318173, which was for outputting IPv6 addresses in tree
pools, implement outputting of IPv6 addresses in the ippool debug list
of hash type pools (ippool -l -d -t hash). Currently IPv6 in ippool tree
type pool handling is mostly implemented.
This continues theseries of commits to remediate ippool.

This will be MFCed with a yet to be committed series of fixes to ippool
after it has been fully remediated.

PR: 218433

7 years agoAs of r318281, there is no need to put a colon (:) in the message
Cy Schubert [Sun, 14 May 2017 23:45:10 +0000 (23:45 +0000)]
As of r318281, there is no need to put a colon (:) in the message
string.

MFC after: 3 days
X-MFC with: r318281

7 years ago- Unlike as in the PCI case, when attached to ACPI, Intel Bay Trail
Marius Strobl [Sun, 14 May 2017 21:33:01 +0000 (21:33 +0000)]
- Unlike as in the PCI case, when attached to ACPI, Intel Bay Trail
  and Braswell eMMC and SDXC controllers share the same IDs. Like in
  the PCI case, Braswell eMMC needs the SDHCI_QUIRK_DATA_TIMEOUT_1MHZ
  quirk (see r311794 for the corresponding change to the sdhci(4) PCI
  PCI front-end), though. However, due to the shared ACPI IDs, this
  is trickier to do.
- Intel Apollo Lake eMMC and SDXC controllers are affected by the
  APL18 ("Using 32-bit Addressing Mode With SD/eMMC Controller May
  Lead to Unpredictable System Behavior") silicon bug [1]. When this
  erratum hits, typically both SDHCI and XHCI controllers wedge.
  According to Intel, using ADMA2 with 64-bit addressing and 96-bit
  descriptors serves as a workaround. Until such times when sdhci(4)
  has ADMA2 support, flag DMA as broken for affected interfaces.
  This turns out to work around the problem, too, at the cost of
  performance.
- In the sdhci(4) ACPI front-end, probe the Intel Apollo Lake eMMC
  and SDXC controllers, too.

1: http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/pentium-celeron-n-series-j-series-datasheet-spec-update.pdf

7 years agoSeparate the ipfilter function/static string from the error with a
Cy Schubert [Sun, 14 May 2017 21:18:01 +0000 (21:18 +0000)]
Separate the ipfilter function/static string from the error with a
colon (:) in error messages to assist the user in parsing out the error
from where or which object the error message refers to.

MFC after: 3 days

7 years agogetconf: use nitems(..) to compute NWORDS instead of hardcoding
Enji Cooper [Sun, 14 May 2017 20:39:01 +0000 (20:39 +0000)]
getconf: use nitems(..) to compute NWORDS instead of hardcoding
the equivalent macro

MFC after:  1 month
Sponsored by: Dell EMC Isilon

7 years agoMark errf _Noreturn, and mark errf and warn __printflike
Enji Cooper [Sun, 14 May 2017 18:47:09 +0000 (18:47 +0000)]
Mark errf _Noreturn, and mark errf and warn __printflike

The _Noreturn attribute was added to placate Coverity and other static
analysis tools. The __printflike attribute was added to catch issues
with the calls related to printf(3) abuse.

- Modify the code to facilitate the __printflike attribute addition.
- Convert errf calls in to_mb(..) and to_mb_string(..) to warn(..) so
  the calls will return instead of exiting, as the code suggests it
  should.

Differential Revision: D10704
MFC after: 1 month
Reviewed by: pfg
Sponsored by: Dell EMC Isilon

7 years agoDescribe Intel Apollo Lake and Braswell USB 3.0 controllers.
Marius Strobl [Sun, 14 May 2017 14:27:59 +0000 (14:27 +0000)]
Describe Intel Apollo Lake and Braswell USB 3.0 controllers.

7 years agosh: Fix '-' from quoted arithmetic in case/glob pattern range.
Jilles Tjoelker [Sun, 14 May 2017 13:14:19 +0000 (13:14 +0000)]
sh: Fix '-' from quoted arithmetic in case/glob pattern range.

It does not make much sense to generate the '-' in a pattern bracket
expression using arithmetic expansion, but it does not make sense to forbid
it either.

Try to avoid reprocessing the string if it is unnecessary.

7 years agocxgbe(4): netmap-only interrupts for a VI do not have an associated rxq
Navdeep Parhar [Sun, 14 May 2017 09:07:13 +0000 (09:07 +0000)]
cxgbe(4): netmap-only interrupts for a VI do not have an associated rxq
or ofld_rxq and should be ignored by vi_intr_iq.

MFC after: 3 days.
Sponsored by: Chelsio Communications

7 years agoChange the default uid/gid values for nobody/nogroup to 65534/65533.
Rick Macklem [Sun, 14 May 2017 00:38:41 +0000 (00:38 +0000)]
Change the default uid/gid values for nobody/nogroup to 65534/65533.

The default values found in /etc/passwd and /etc/group are 65534, 65533.
In mountd.c, the defaults were -2, which was 65534 back when uid_t was 16bits.
Without this patch, a file created by root on an NFS exported volume without
the "-root=" export option will end up owned by uid 4**32 - 2.
When discussed on freebsd-current@, it seemed that users preferred the
values being changed to 65534/65533.
I have not added code to acquire these values from the databases, since
the mountd daemon might get "stuck" during startup waiting for a non-responsive
password database server.

Discussed on: freebsd-current

7 years agoSilence a -Wunused warning about the junk variable being used to raise
Dimitry Andric [Sat, 13 May 2017 22:36:54 +0000 (22:36 +0000)]
Silence a -Wunused warning about the junk variable being used to raise
an inexact floating point exception.  The variable cannot be eliminated,
unfortunately, otherwise the desired addition triggering the exception
will be emitted neither by clang, nor by gcc.

Reviewed by: Steve Kargl, bde
MFC after: 3 days

7 years agosh: Add test for arithmetic expansion in [x-y] pattern range.
Jilles Tjoelker [Sat, 13 May 2017 20:28:32 +0000 (20:28 +0000)]
sh: Add test for arithmetic expansion in [x-y] pattern range.

It does not make much sense to generate the '-' in a pattern bracket
expression using arithmetic expansion, but it does not make sense to forbid
it either.

This test already passes.

7 years agostyle(9): sort headers
Enji Cooper [Sat, 13 May 2017 19:59:03 +0000 (19:59 +0000)]
style(9): sort headers

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoIn _rtld(), reorder local declarations to compact the block and
Konstantin Belousov [Sat, 13 May 2017 18:59:27 +0000 (18:59 +0000)]
In _rtld(), reorder local declarations to compact the block and
partially sort them by style(9).  Move locals declarations from nested
blocks into the block at function start.

Discussed with: emaste
MFC after: 1 week

7 years agoAdd missing braces around MCAST_EXCLUDE check when KTR support is
Enji Cooper [Sat, 13 May 2017 18:41:24 +0000 (18:41 +0000)]
Add missing braces around MCAST_EXCLUDE check when KTR support is
compiled into the kernel

This ensures that .iss_asm (the number of ASM listeners) isn't incorrectly
decremented for MLD-layer source datagrams when inspecting im*s_st[1]
(the second state in the structure).

MFC after: 2 months
PR: 217509 [1]
Reported by: Coverity (Isilon)
Reviewed by: ae ("This patch looks correct to me." [1])
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
Sponsored by: Dell EMC Isilon

7 years agoFix __pthread_mutex_trylock() to call THR_CRITICAL_LEAVE() on failure rather
Jason Evans [Sat, 13 May 2017 17:49:53 +0000 (17:49 +0000)]
Fix __pthread_mutex_trylock() to call THR_CRITICAL_LEAVE() on failure rather
than on success.  This regression was introduced by r300043 (Add implementation
of robust mutexes...).

MFC after: 1 day

7 years agoAllocate a cacheline when reading or writing to write through memory. The
Andrew Turner [Sat, 13 May 2017 13:03:20 +0000 (13:03 +0000)]
Allocate a cacheline when reading or writing to write through memory. The
hardware will still write to memory, however following reads will be from
the cache.

MFC after: 1 week
Sponsored by: DARPA, AFRL

7 years agoAdd the VM_MEMATTR_WRITE_THROUGH memory type to arm64 and use it to support
Andrew Turner [Sat, 13 May 2017 13:01:15 +0000 (13:01 +0000)]
Add the VM_MEMATTR_WRITE_THROUGH memory type to arm64 and use it to support
VM_MEMATTR_WRITE_COMBINING in the kernel. This fixes a bug where Xorg would
use write back cached memory for its graphics buffers. This would produce
artifacts on the screen as cachelines were written to memory.

MFC after: 1 week
Sponsored by: DARPA, AFRL

7 years agoClarify usage rules for pmap_remap_vm_attr().
Michal Meloun [Sat, 13 May 2017 10:00:24 +0000 (10:00 +0000)]
Clarify usage rules for pmap_remap_vm_attr().
Not a functional change.

MFC with: r318021
MFC after: 2 weeks

7 years agoHandle the logfiles in newsyslog and syslogd conditionally, based on
Enji Cooper [Sat, 13 May 2017 03:10:50 +0000 (03:10 +0000)]
Handle the logfiles in newsyslog and syslogd conditionally, based on
src.conf(5) knobs

This will allow consumers of FreeBSD to use the unmodified configuration
files out of the box more than previously.

Both newsyslog.conf and syslog.conf:
- /var/log/lpd-errs (MK_LPR != no)
- /var/log/ppp.log (MK_PPP != no)
- /var/log/xferlog (MK_FTP != no)

newsyslog.conf:
- /var/log/amd.log (MK_AMD != no)
- /var/log/pflog (MK_PF != no)
- /var/log/sendmail.st (MK_SENDMAIL != no)

MFC after:      3 weeks
Sponsored by:   Dell EMC Isilon

7 years agoAdd a regression test for r318191.
Mark Johnston [Fri, 12 May 2017 18:02:57 +0000 (18:02 +0000)]
Add a regression test for r318191.

Reviewed by: badger
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D10684

7 years agoDo not wake up sleeping thread in reschedule_signals() if the signal
Konstantin Belousov [Fri, 12 May 2017 15:34:59 +0000 (15:34 +0000)]
Do not wake up sleeping thread in reschedule_signals() if the signal
is blocked.  The spurious wakeup might result in spurious EINTR.

The reschedule_signals() function is called when the calling thread
has the signal mask changed.  For each newly blocked signal, we try to
find a thread which might have the signal not blocked.  If no such
thread exists, sigtd() returns random thread, which must not be waken
up.  I decided that re-checking, as suggested by PR submitter, is more
reasonable change than to change sigtd() interface, due to other uses
of sigtd().  signotify() already performs this check.

Submitted by: Duane <parakleta@darkreality.org>
PR: 219228
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRefine and update blacklist support in sshd
Kurt Lidl [Fri, 12 May 2017 15:20:12 +0000 (15:20 +0000)]
Refine and update blacklist support in sshd

Adjust notification points slightly to catch all auth failures,
rather than just the ones caused by bad usernames.

Modify notification point for bad usernames to send new type of
BLACKLIST_BAD_USER. (Support in libblacklist will be forthcoming soon.)
Add guards to allow library headers to expose the enum of action values.

Reviewed by: des
Approved by: des
Sponsored by: The FreeBSD Foundation

7 years ago[iwm] Recognize IWM_FW_PAGING_BLOCK_CMD wide cmd response correctly.
Adrian Chadd [Fri, 12 May 2017 06:35:20 +0000 (06:35 +0000)]
[iwm] Recognize IWM_FW_PAGING_BLOCK_CMD wide cmd response correctly.

Obtained from: dragonflybsd.git ef688cebb9b29b67f7a011846589971987949e0d

7 years ago[iwm] Revert "if_iwm - SCAN_ABORT_UMAC response doesn't use a wide id"
Adrian Chadd [Fri, 12 May 2017 06:34:43 +0000 (06:34 +0000)]
[iwm] Revert "if_iwm - SCAN_ABORT_UMAC response doesn't use a wide id"

This reverts commit cef47a9cbb0a3ce5f18369fed9403d2764884bc2.

Obtained from: dragonflybsd.git f62d325820ee7f7c2bcf721ada9cef8b70f74471

7 years ago[iwm] Fix iwm_mvm_send_cmd_pdu(_status) declarations. Make id a uint32_t.
Adrian Chadd [Fri, 12 May 2017 06:33:55 +0000 (06:33 +0000)]
[iwm] Fix iwm_mvm_send_cmd_pdu(_status) declarations. Make id a uint32_t.

* This fixes cases where the group id of wide commands got lost, e.g. this
  happened to the IWM_SCAN_ABORT_UMAC command.

Obtained from: dragonflybsd.git 71310fab0caca79bb5da43d9d642e77a4c27eea2

7 years ago[iwm] Adjust if_iwm_sta.h prototypes, don't pass iwm_node to rm_sta().
Adrian Chadd [Fri, 12 May 2017 06:33:07 +0000 (06:33 +0000)]
[iwm] Adjust if_iwm_sta.h prototypes, don't pass iwm_node to rm_sta().

* Since a RUN -> INIT/SCAN transition seems to immediately destroy the
  ieee80211_node for the AP, we can't read the in_assoc value from there.
  Instead just directly pass that information via a boolean_t argument.

* Adds iwm_mvm_rm_sta_id() function, which just unconditionally removes
  the station from the firmware.

* The iwm_mvm_rm_sta() function shouldn't actually remove the station from
  firmware when we are still associated (i.e. during a RUN -> INIT/SCAN
  transition).

 * So when disassociating we will first call iwm_mvm_rm_sta() to drain the
   queues/fifos. Later during disassociation we will then use
   iwm_mvm_rm_sta_id() to actually remove the station.

Inspired-By: Linux iwlwifi
Obtained from: dragonflybsd.git 81b3c1fe9122fa22f33d97103039cc375f656231

7 years ago[iwm] Make powersaving more similar to Linux iwlwifi behaviour.
Adrian Chadd [Fri, 12 May 2017 06:31:57 +0000 (06:31 +0000)]
[iwm] Make powersaving more similar to Linux iwlwifi behaviour.

* Add a per-vap ps_disabled flag, and use it for a workaround which fixes
  an association issue when powersaving is enabled.

* Compute flag that should correpsond to the mvmif->bss_conf.ps flag in
  Linux's iwlwifi (e.g. this disallows powersaving when not associated
  yet).

Inspired-By: Linux iwlwifi
Obtained from: dragonflybsd.git dc2e69bdfe8c9d7049c8a28da0adffbfbc6de5c0

7 years ago[iwm] Clean up if_iwm_power.c a bit. Fix iwm_power_scheme debug print.
Adrian Chadd [Fri, 12 May 2017 06:30:50 +0000 (06:30 +0000)]
[iwm] Clean up if_iwm_power.c a bit. Fix iwm_power_scheme debug print.

Obtained from: dragonflybsd.git 52c3adbee676d8558065618e5ad694ea5c6697e0

7 years ago[iwm] Switch arguments from iwm_node* to iwm_vap* in if_iwm_power.c.
Adrian Chadd [Fri, 12 May 2017 06:30:06 +0000 (06:30 +0000)]
[iwm] Switch arguments from iwm_node* to iwm_vap* in if_iwm_power.c.

* Power management handling is per-vap, not per-node, so we should pass
  the iwm_vap in these arguments.

Obtained from: dragonflybsd.git 62a4e7957a736b4de38938b02fa7eb9b45bc5d0d

7 years ago[iwm] Already call iwm_mvm_power_update_mac() during SCAN<->AUTH paths.
Adrian Chadd [Fri, 12 May 2017 06:21:03 +0000 (06:21 +0000)]
[iwm] Already call iwm_mvm_power_update_mac() during SCAN<->AUTH paths.

* Otherwise we would never update powersaving settings until we complete
  an association, after the first authentication attempt.

* This corresponds to what Linux iwlwifi seems to do.

Obtained from: dragonflybsd.git aa128dc02a17c2e616232ef0fa997121e969c995

7 years ago[iwm] Refuse connection to APs with beacon interval < 16.
Adrian Chadd [Fri, 12 May 2017 06:16:11 +0000 (06:16 +0000)]
[iwm] Refuse connection to APs with beacon interval < 16.

Obtained from: dragonflybsd.git aba448de727e9b122adadeb36fd00a8ad6018d4f

7 years ago[iwm] Handle AUTH->SCAN/INIT and ASSOC->SCAN/INIT better
Adrian Chadd [Fri, 12 May 2017 06:05:34 +0000 (06:05 +0000)]
[iwm] Handle AUTH->SCAN/INIT and ASSOC->SCAN/INIT better

* Tear down the relevant firmware state (i.e. the station, the vif binding)
  in these transition cases.

* Before this case would leave the firmware state lying around, resulting
  in errors and firmware panics in the subsequent association attempts.

Obtained from: dragonflybsd.git 94b501399fde6368ae388a669c95b099a6e66e93

7 years ago[iwm] Factor out firmware station handling into if_iwm_sta.c.
Adrian Chadd [Fri, 12 May 2017 06:03:23 +0000 (06:03 +0000)]
[iwm] Factor out firmware station handling into if_iwm_sta.c.

* This adds iwm_mvm_rm_sta(), which will be used to tear down firmware
  state for better/cleaner iwm_newstate() handling.

* Makes iwm_enable_txq() and iwm_mvm_flush_tx_path() non-static, add
  the declarations to if_iwm_util.h for now.

Obtained from: dragonflybsd.git 85d1c6190c4c3564b1a347f253e823aa95c202b2

7 years ago[iwm] Deduplicate code in iwm_auth() from an if condition.
Adrian Chadd [Fri, 12 May 2017 05:53:28 +0000 (05:53 +0000)]
[iwm] Deduplicate code in iwm_auth() from an if condition.

Obtained from: dragonflybsd.git 03c6e6970115727c9d39f9358e0500ab4f4634cd

7 years ago[iwm] No need for iwm_assoc() in AUTH->ASSOC transition.
Adrian Chadd [Fri, 12 May 2017 05:51:50 +0000 (05:51 +0000)]
[iwm] No need for iwm_assoc() in AUTH->ASSOC transition.

* Hence no need to keep stuff in separate iwm_assoc() function, just
  inline the stuff into iwm_newstate().

Obtained from: dragonflybsd.git e8f7d88e0d030f138f95ecdb7c1a729d9fb0d6ab

7 years ago[iwm] Properly implement iwm_wme_update callback function.
Adrian Chadd [Fri, 12 May 2017 05:50:38 +0000 (05:50 +0000)]
[iwm] Properly implement iwm_wme_update callback function.

* Inspired by iwn(4) and Linux iwlwifi.

* Read wme parameters into a buffer within struct iwm_vap in
  iwm_wme_update().

* If we aren't associated yet, the new settings will soon be sent
  by iwm_mvm_mac_ctxt_changed() during association.

* If we are already associated, explicitly call iwm_mvm_mac_ctxt_changed()
  from iwm_wme_update() to send the new settings to the firmware.

* Change iwm_mvm_ac_to_tx_fifo mapping, to fit the freebsd net80211
  WME stream class numbering, instead of Linux's enum ieee80211_ac_numbers.

Obtained from: dragonflybsd.git b8bd6cd746d1f45e616ccfcbeed06dfe452a1108

7 years ago[iwm] Process multiple frames per RX buffer.
Adrian Chadd [Fri, 12 May 2017 05:49:24 +0000 (05:49 +0000)]
[iwm] Process multiple frames per RX buffer.

* Factor out iwm_handle_rxb() function from iwm_notif_intr().

* Removing the IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK flag allows
  the device to put multiple frames (both command responses and 80211
  frames) into a single RX buffer.

* Uses m_copym() to split up the receive buffers when multiple 80211
  frames are received in one RX buffer. The effect is basically the same
  as when using m_split(), but we want to keep the original mbuf around
  when calling iwm_mvm_rx_rx_mpdu() to make error handling a bit easier
  for now.

* Contains a small optimization to avoid the m_copym() when only a single
  80211 frame is received in one RX buffer (i.e. matching the existing
  behaviour).

Obtained from: dragonflybsd.git b5eb43f0280bbcfd26af51cf5a4b8e8ff3590b67

7 years ago[iwm] Change UCODE_TLV_API #define-s from bitmasks to indexes.
Adrian Chadd [Fri, 12 May 2017 05:30:01 +0000 (05:30 +0000)]
[iwm] Change UCODE_TLV_API #define-s from bitmasks to indexes.

* Fixes oversight from commit 757eecf0e6c92745aa2eee95811e573c8300850e.
  fw_has_api now uses the isset macro instead of a simple logical-and.

Obtained from: dragonflybsd.git c00575de8491dc402abf52c8c7e1cca1ef79e257

7 years ago[iwm] Sync iwm_read_firmware()'s loop to iwlwifi's code.
Adrian Chadd [Fri, 12 May 2017 05:28:49 +0000 (05:28 +0000)]
[iwm] Sync iwm_read_firmware()'s loop to iwlwifi's code.

Obtained from: dragonflybsd.git d1c10ccfcf2d6d2a664f17197add0b4f93333181

7 years ago[iwm] change the check for ADD_STA status, use IWM_ADD_STA_STATUS_MASK.
Adrian Chadd [Fri, 12 May 2017 05:22:29 +0000 (05:22 +0000)]
[iwm] change the check for ADD_STA status, use IWM_ADD_STA_STATUS_MASK.

Obtained from: dragonflybsd.git 74d41163ddac72b0d7ea7b7873d53fe134723a12

7 years ago[iwm] Sanity check channel for IEEE80211_CHAN_ANYC in if_iwm_mac_ctxt.c.
Adrian Chadd [Fri, 12 May 2017 05:21:50 +0000 (05:21 +0000)]
[iwm] Sanity check channel for IEEE80211_CHAN_ANYC in if_iwm_mac_ctxt.c.

* This avoids panicing in some broken vap state handling cases.

Obtained from: dragonflybsd.git 10d5b77b5421e7cbcc426160edbe858d1d610a29

7 years ago[if_iwm] Get rid of another usage of the IWM_DEFAULT_MACID/_COLOR constant.
Adrian Chadd [Fri, 12 May 2017 05:21:02 +0000 (05:21 +0000)]
[if_iwm] Get rid of another usage of the IWM_DEFAULT_MACID/_COLOR constant.

Obtained from: dragonflybsd.git c009badecf7b1389cd86adde9fd35f6113c75b5b

7 years ago[if_iwm] Partly sync if_iwm_binding.c to Linux iwlwifi code.
Adrian Chadd [Fri, 12 May 2017 05:19:08 +0000 (05:19 +0000)]
[if_iwm] Partly sync if_iwm_binding.c to Linux iwlwifi code.

* Store macid and color values in struct iwm_vap, to avoid hardcoded
  constants a bit.

* Add iwm_mvm_binding_remove_vif() function (will be used in disconnecting
  from an access point without resetting the whole device).

* Not adding code from Linux iwlwifi yet, to handle one PHY context to
  be bound to several VAPs/virtual-interfaces, it's definitely not needed
  in the near future.

Obtained from: dragonflybsd.git f16ef74977e51e1bfc7a625dd18b98b02158e0e5

7 years agoFix up previous commit
Enji Cooper [Fri, 12 May 2017 05:17:49 +0000 (05:17 +0000)]
Fix up previous commit

- Apply the logic to the FreeBSD block
- Fix a typo with the getconf(1) call that I would have caught, were
  it not for the fact that I got the blocks wrong.
- Consolidate the hardcoded buffer sizes to the NetBSD block.

This would have been discovered had I run the test on a system where
PATH_MAX != 1024 (I don't have that at my disposal right at this moment).

MFC after: 3 weeks
MFC with: r318210
Sponsored by: Dell EMC Isilon

7 years agossp_test:read:: query the value of MAXPATHLEN via getconf(1)
Enji Cooper [Fri, 12 May 2017 05:06:48 +0000 (05:06 +0000)]
ssp_test:read:: query the value of MAXPATHLEN via getconf(1)

In the event the value of PATH_MAX was changed, the assumption that
MAXPATHLEN is 1024 (and hence the buffer length required to trigger
SSP to fail for read(2)) would be invalidated. Query getconf(1) for
the actual value of MAXPATHLEN via _XOPEN_PATH_MAX instead, and
increment the value by 1 to ensure that the SSP support tests the
stack smashing support properly.

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse UMA_ALIGN_PTR to specify pointer alignment
Justin Hibbits [Fri, 12 May 2017 04:10:02 +0000 (04:10 +0000)]
Use UMA_ALIGN_PTR to specify pointer alignment

Suggested by: jhb

7 years agoAdd missing linefeed in debug output.
Cy Schubert [Fri, 12 May 2017 01:09:24 +0000 (01:09 +0000)]
Add missing linefeed in debug output.

7 years agoTell bmake (meta mode) to ignore changes to /usr/local/etc/libmap.d/*
Simon J. Gerraty [Thu, 11 May 2017 19:49:22 +0000 (19:49 +0000)]
Tell bmake (meta mode) to ignore changes to /usr/local/etc/libmap.d/*

Differential Revision: D10685
Reviewed by: bdrewery

7 years agoSet the right variable when overriding the default console speed.
Mark Johnston [Thu, 11 May 2017 18:53:28 +0000 (18:53 +0000)]
Set the right variable when overriding the default console speed.

MFC after: 1 week

7 years agoLet ptracestop() suspend threads sleeping in an SBDRY section.
Mark Johnston [Thu, 11 May 2017 17:03:45 +0000 (17:03 +0000)]
Let ptracestop() suspend threads sleeping in an SBDRY section.

When a thread enters ptracestop(), for example because it had received
SIGSTOP from ptrace(PT_ATTACH), it attempts to suspend other threads in
the same process. In the case of a thread sleeping interruptibly in an
SBDRY section, sig_suspend_threads() must wake the thread and allow it to
reach the user-mode boundary. However, sig_suspend_threads() would
erroneously avoid waking up such threads, resulting in an apparent hang.

Reviewed by: kib
Tested by: pho
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoUpdate release/scripts/atlas-upload.sh to account for API changes
Glen Barber [Thu, 11 May 2017 16:37:29 +0000 (16:37 +0000)]
Update release/scripts/atlas-upload.sh to account for API changes
made recently by Atlas Hashicorp.  The data returned from GET and
POST requests has changed, which caused a number of regex patterns
to fail to be properly identified as 'success' or 'failure', which
ended up in upload/publish failures.

Tested with: 12-CURRENT
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agovdev_geom may associate multiple vdevs per g_consumer
Alan Somers [Thu, 11 May 2017 16:26:56 +0000 (16:26 +0000)]
vdev_geom may associate multiple vdevs per g_consumer

vdev_geom.c currently uses the g_consumer's private field to point to a
vdev_t. That way, a GEOM event can cause a change to a ZFS vdev. For
example, when you remove a disk, the vdev's status will change to REMOVED.
However, vdev_geom will sometimes attach multiple vdevs to the same GEOM
consumer. If this happens, then geom events will only be propagated to one
of the vdevs.

Fix this by storing a linked list of vdevs in g_consumer's private field.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c

* g_consumer.private now stores a linked list of vdev pointers associated
  with the consumer instead of just a single vdev pointer.

* Change vdev_geom_set_physpath's signature to more closely match
  vdev_geom_set_rotation_rate

* Don't bother calling g_access in vdev_geom_set_physpath. It's guaranteed
  that we've already accessed the consumer by the time we get here.

* Don't call vdev_geom_set_physpath in vdev_geom_attach. Instead, call it
  in vdev_geom_open, after we know that the open has succeeded.

PR: 218634
Reviewed by: gibbs
MFC after: 1 week
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D10391

7 years agoImprove error messages during command timeout for the mpr and mps
Scott Long [Thu, 11 May 2017 15:19:04 +0000 (15:19 +0000)]
Improve error messages during command timeout for the mpr and mps
drivers.

Sponsored by: Netflix

7 years agoAdd LTO-8 density codes.
Kenneth D. Merry [Thu, 11 May 2017 13:46:30 +0000 (13:46 +0000)]
Add LTO-8 density codes.

lib/libmt/mtlib.c:
Add the LTO-8 density code to the density table in libmt.

usr.bin/mt/mt.1:
Add the LTO-8 density code, tracks, bpmm, and bpi to the density
table in the mt(1) man page.

MFC after: 3 days
Sponsored by: Spectra Logic

7 years agoImprove build(7): add missing "buildkernel" and "installkernel"
Edward Tomasz Napierala [Thu, 11 May 2017 08:39:55 +0000 (08:39 +0000)]
Improve build(7): add missing "buildkernel" and "installkernel"
to the example, change the architectures to something more common,
and improve description of defaults for TARGET.

Reviewed by: bdrewery, ngie, imp (older revisions)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10654

7 years agocpio/tests/test_option_lz4: fix a use after free in the failure case
Enji Cooper [Thu, 11 May 2017 08:22:01 +0000 (08:22 +0000)]
cpio/tests/test_option_lz4: fix a use after free in the failure case

This change will be upstreamed to the libarchive project.

MFC after: 6 days
MFC with: r317782
Reported by: Coverity
Sponsored by: Dell EMC Isilon

7 years agoMark all md tests as requiring unsafe AIO in order to function
Enji Cooper [Thu, 11 May 2017 08:06:46 +0000 (08:06 +0000)]
Mark all md tests as requiring unsafe AIO in order to function

These tests have been flapping (failing<->passing) on Jenkins for months.
It passes reliably for me if unsafe AIO is permitted, but it doesn't
pass on Jenkins reliably if unsafe AIO is disabled (the current default).

Mark the tests as requiring unsafe AIO to mitigate the intermittent
failures when unsafe AIO isn't permitted. If the kernel code is changed
to reliably function with md(4) devices using unsafe AIO, this commit can
be reverted.

MFC after: 2 months
PR: 217261
Reported by: Jenkins
Sponsored by: Dell EMC Isilon

7 years agoprocstat(1): also reference icmp(4) and sctp(4)
Enji Cooper [Thu, 11 May 2017 07:58:04 +0000 (07:58 +0000)]
procstat(1): also reference icmp(4) and sctp(4)

This was missed in the previous commit by accident.

MFC after: 3 weeks
MFC with: r318178
Sponsored by: Dell EMC Isilon

7 years agoprocstat(1): document all possible `PRO` (network protocol) values
Enji Cooper [Thu, 11 May 2017 07:55:38 +0000 (07:55 +0000)]
procstat(1): document all possible `PRO` (network protocol) values

Reference the appropriate section 4 manpages for networking
protocols.

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon