]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC: r302940
allanjude [Tue, 26 Jul 2016 05:26:53 +0000 (05:26 +0000)]
MFC: r302940

Fix error in bsdinstall triggered when doing a GELI encrypted install to
an MBR formatted disk

Approved by: re (gjb)
Sponsored by: ScaleEngine Inc.

7 years agoMFC: r302941
allanjude [Tue, 26 Jul 2016 05:26:07 +0000 (05:26 +0000)]
MFC: r302941

At the start of the installation process, all ZFS pools are exported and
all GELI instances are detached, to allow a restarted install to proceed.

PR: 210814
Approved by: re (gjb)

7 years agoMFC 302899: Add documentation for the sigevent structure.
jhb [Mon, 25 Jul 2016 23:37:47 +0000 (23:37 +0000)]
MFC 302899: Add documentation for the sigevent structure.

- Add a sigevent(3) manpage to give a general overview of the sigevent
  structure and the available notification mechanisms.
- Document that AIO requests contain a nested sigevent structure that can
  be used to request completion notification.
- Expand the sigevent details in other manuals to note details such as
  the extra values stored in a queued signal's information or in a posted
  kevent.

Approved by: re (gjb)

7 years agoMFC r303091
asomers [Mon, 25 Jul 2016 20:02:11 +0000 (20:02 +0000)]
MFC r303091

Fix camdd for host-aware and host-managed SMR disks.
This should've gone in as part of r300207

Approved by: re (gjb)

7 years agoMerge LLVM libunwind fixes
emaste [Mon, 25 Jul 2016 19:37:10 +0000 (19:37 +0000)]
Merge LLVM libunwind fixes

r302475: libunwind: limit stack usage in unwind cursor

This may be reworked upstream but in the interim should address the
stack usage issue reported in the PR.

r303061: libunwind: Properly align _Unwind_Exception.

_Unwind_Exception is required to be double word aligned.  GCC has
interpreted this to mean "use the maximum useful alignment for the
target" so follow that lead.

PR: 206384 (r302475)
Obtained from: LLVM review D22543 (r303061)
Approved by: re (gjb)

7 years agoMFC 302861: Fix rendering issues.
jhb [Mon, 25 Jul 2016 19:16:49 +0000 (19:16 +0000)]
MFC 302861: Fix rendering issues.

- Use Ta to separate column headers.
- Correct width of the 'Code' column in the last table.

Approved by: re (gjb)

7 years agoMFC r303195:
bdrewery [Mon, 25 Jul 2016 18:25:19 +0000 (18:25 +0000)]
MFC r303195:

  Don't run find(1) for __MPATH with NO_MODULES set.

Approved by: re (gjb)

7 years agoMFC r303043:
bdrewery [Mon, 25 Jul 2016 17:37:02 +0000 (17:37 +0000)]
MFC r303043:

  Increase vt(4) framebuffer maximum size

PR: 210382
Approved by: re (gjb)

7 years agoMFC r303199:
np [Mon, 25 Jul 2016 17:17:59 +0000 (17:17 +0000)]
MFC r303199:

ctld(8): Fix MaxBurstLength negotiation.

The target must reply with the selected value of MaxBurstSize instead of
just echoing back the initiator's offered value.

Reviewed by: mav@
Approved by: re@ (gjb@)
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7278

7 years agoMFC 302860: Fix aio system call wrappers in librt.
jhb [Mon, 25 Jul 2016 15:56:37 +0000 (15:56 +0000)]
MFC 302860: Fix aio system call wrappers in librt.

- Update aio_return/waitcomplete wrappers for the ssize_t return type.
- Fix the aio_return() wrapper to fail with EINVAL on a pending job.
  This matches the semantics of the in-kernel system call.  Also,
  aio_return() returns errors via errno, not via the return value.

Approved by: re (gjb)
Sponsored by: Chelsio Communications

7 years agoMFC r302911:
pfg [Mon, 25 Jul 2016 15:03:14 +0000 (15:03 +0000)]
MFC r302911:
mail(1): Avoid closing negative file descriptors.

CID: 10081051008106
Approved by: re (gjb)

7 years agoFix bspatch heap overflow vulnerability.
delphij [Mon, 25 Jul 2016 14:52:12 +0000 (14:52 +0000)]
Fix bspatch heap overflow vulnerability.

Obtained from: Chromium
Reported by: Lu Tung-Pin
Security: FreeBSD-SA-16:25.bspatch
Approved by: re (so@ blanket)

7 years agoMFC r302542:
delphij [Mon, 25 Jul 2016 14:35:48 +0000 (14:35 +0000)]
MFC r302542:

Use _PATH_DEVNULL instead of hardcoding.

Approved by: re (kib)

7 years agoMFC r303157: libcxxrt: add padding in __cxa_allocate_* to fix alignment
emaste [Mon, 25 Jul 2016 14:16:28 +0000 (14:16 +0000)]
MFC r303157: libcxxrt: add padding in __cxa_allocate_* to fix alignment

The addition of the referenceCount to __cxa_allocate_exception put the
unwindHeader at offset 0x58 in __cxa_exception, but it requires 16-byte
alignment. In order to avoid changing the current __cxa_exception ABI
(and thus breaking its consumers), add explicit padding in the
allocation routines (and account for it when freeing).

This is intended as a lower-risk change for FreeBSD 11. A "more correct"
fix should be prepared for upstream and -CURRENT.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

7 years agoMFC r302567:
kib [Mon, 25 Jul 2016 13:28:59 +0000 (13:28 +0000)]
MFC r302567:
In vgonel(), postpone setting BO_DEAD until VOP_RECLAIM() is called,
if vnode is VMIO.  For VMIO vnodes, set BO_DEAD in vm_object_terminate().

MFC r302580:
Fix grammar.

Approved by: re (gjb)

7 years agoMFC r303032
sbruno [Sun, 24 Jul 2016 16:32:34 +0000 (16:32 +0000)]
MFC r303032
Fixup DA cable detection routines to not set the cable type to
unknown if they do not match one of two cable types.

PR: 150249
Approved by: re (gjb)

7 years agoMFC r302904:
tuexen [Sun, 24 Jul 2016 14:50:16 +0000 (14:50 +0000)]
MFC r302904:
Fix a bug which results in a core dump when running netstat with
the -W option and having a listening SCTP socket.
The bug was introduced in r279122 when adding support for libxo.

MFC r302907:
When calling netstat -Laptcp the local address values are not aligned
with the corresponding entry in the table header. r295136
increased the value width from 14 to 32 without the corresponding
change to the table header. This commit adds the change to the table
header width.

MFC r302917:
Ensure that the -a, -W, -L options for SCTP behave similar
as for TCP.

MFC r302928:
Address a potential memory leak found a the clang static code analyzer
running on the userland stack.

MFC r302930:
Don't free a data chunk twice.
Found by the clang static code analyzer running for the userland stack.

MFC r302935:
Deal with a portential memory allocation failure, which was reported
by the clang static code analyzer.
Joint work with rrs@.

MFC r302942:
Add missing sctps_reasmusrmsgs counter.
Joint work with rrs@.

MFC r302945:
Don't duplicate code for SCTP, just use the ones used for UDP and TCP.
This fixes a bug with link local addresses. This will require and
upcoming change in the kernel to bring SCTP to the same behaviour
as UDP and TCP.

MFC r302949:
Fix the PR-SCTP behaviour.
This is done by rrs@.

MFC r302950:
Add a constant required by RFC 7496.

MFC r303024:
netstat and sockstat expect the IPv6 link local addresses to
have an embedded scope. So don't recover.

MFC r303025:
Use correct order of conditions to avoid NULL deref.

MFC r303073:
Fix a bug in deferred stream reset processing which results
in using a length field before it is set.
Thanks to Taylor Brandstetter for reporting the issue and
providing a fix.

Approved by: re (kib)

7 years agoMFC r303132:
trasz [Sun, 24 Jul 2016 10:00:29 +0000 (10:00 +0000)]
MFC r303132:

Add documentation for "ctld -u", the UCL configuration file format.

Submitted by: jceel@
Approved by: re (kib)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7222

7 years agoMFC: r303219
bapt [Sun, 24 Jul 2016 09:00:16 +0000 (09:00 +0000)]
MFC: r303219

Add weekday to the date format of more locales
Approved by: re (kib)

7 years agoiDo not try to delete the home of the user if is is not a directory for example
bapt [Sun, 24 Jul 2016 08:12:23 +0000 (08:12 +0000)]
iDo not try to delete the home of the user if is is not a directory for example
"/dev/null"

PR: 211195
Submitted by: rday <ryan@ryanday.net>
Reported by: eniorm <eniorm@gmail.com>
Approved by: re (kib)

7 years agoMFC r303101
alc [Sat, 23 Jul 2016 21:56:52 +0000 (21:56 +0000)]
MFC r303101
  Add a comment describing the 'fast path' that was introduced in r270011.

Approved by: re (gjb)

7 years agoMFC 302858: Move nested include of <sys/queue.h> inside _KERNEL.
jhb [Sat, 23 Jul 2016 17:37:59 +0000 (17:37 +0000)]
MFC 302858: Move nested include of <sys/queue.h> inside _KERNEL.

This removes namespace pollution for userland brought in by r299122.

PR: 210319
Approved by: re (kib)

7 years agoMFC r302936:
kib [Sat, 23 Jul 2016 08:23:57 +0000 (08:23 +0000)]
MFC r302936:
Explicitely check for the valid range of file descriptor values.

Approved by: re (gjb)

7 years agoMFC r302919:
kib [Fri, 22 Jul 2016 17:34:58 +0000 (17:34 +0000)]
MFC r302919:
In ptrace_vm_entry(), do not call vmspace_free() while owning a vm
object lock.

Approved by: re (gjb)

7 years agoMFC libunwind improvements
emaste [Fri, 22 Jul 2016 17:34:28 +0000 (17:34 +0000)]
MFC libunwind improvements

r302450: libunwind: update to upstream snapshot r272680

The key improvement is that it may be built without cross-unwinding
support, which significantly reduces the stack space requirement.

r302456: libunwind: enable only the native unwinder by default

This significantly reduces stack space requirements, and runtimes
require only native unwinding.

r302475: libunwind: limit stack usage in unwind cursor

This may be reworked upstream but in the interim should address the
stack usage issue reported in the PR.

r303016: llvm-libunwind: use conventional (non-Darwin) X86 register numbers

For historical reasons Darwin/i386 has ebp and esp swapped in the
eh_frame register numbering.  That is:

              Darwin      Other
    Reg #    eh_frame    eh_frame    DWARF
    =====    ========    ========    =====
      4        ebp         esp        esp
      5        esp         ebp        ebp

Although the UNW_X86_* constants are not supposed to be coupled to
DWARF / eh_frame numbering they are currently conflated in LLVM
libunwind, and thus we require the non-Darwin numbering.

PR: 206384
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

7 years agoMFC r302908:
bdrewery [Fri, 22 Jul 2016 17:24:36 +0000 (17:24 +0000)]
MFC r302908:

  Fix dlsym(RTLD_NEXT) handling to only return the next library in last library
  cases.

Approved by: re (gjb)

7 years agoMFC r302893:
kib [Fri, 22 Jul 2016 17:22:37 +0000 (17:22 +0000)]
MFC r302893:
Do not allow creation of char or block special nodes with VNOVAL dev_t.

Approved by: re (gjb)

7 years agoMFC r303031: clang++: Always use --eh-frame-hdr on FreeBSD, even for -static
emaste [Fri, 22 Jul 2016 12:55:31 +0000 (12:55 +0000)]
MFC r303031: clang++: Always use --eh-frame-hdr on FreeBSD, even for -static

FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and we expect to
use it more widely in the future) and it requires the EH frame segment
in static binaries.

Approved by: re (kib)

7 years agoUpdate stable/11 to BETA2 as part of the 11.0-RELEASE cycle.
gjb [Fri, 22 Jul 2016 00:00:09 +0000 (00:00 +0000)]
Update stable/11 to BETA2 as part of the 11.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

7 years agoDisable debugging options in arm configurations.
ian [Thu, 21 Jul 2016 22:13:40 +0000 (22:13 +0000)]
Disable debugging options in arm configurations.

Approved by: re (gjb)

7 years agoMFC r302980
alc [Thu, 21 Jul 2016 20:11:43 +0000 (20:11 +0000)]
MFC r302980
  Break up vm_fault()'s implementation of the read-ahead and delete-behind
  optimizations into two distinct pieces.  The first piece consists of the
  code that should only be performed once per page fault and requires the
  map to be locked.  The second piece consists of the code that should be
  performed each time a pager is called on an object in the shadow chain.
  (This second piece expects the map to be unlocked.)

  Previously, the entire implementation could be executed multiple times.
  Moreover, the second and subsequent executions would occur with the map
  unlocked.  Usually, the ensuing unsynchronized accesses to the map were
  harmless because the map was not changing.  Nonetheless, it was possible
  for a use-after-free error to occur, where vm_fault() wrote to a freed
  map entry.  This change corrects that problem.

Approved by: re (gjb)

7 years agoMerge r302894, r303098: fix regression caused by r302350. Stopping a
glebius [Thu, 21 Jul 2016 19:18:49 +0000 (19:18 +0000)]
Merge r302894, r303098: fix regression caused by r302350. Stopping a
not scheduled not running callout should return (-1).

PR: 210884
Approved by: re (gjb)

7 years agoMFC r302981:
kib [Thu, 21 Jul 2016 12:50:23 +0000 (12:50 +0000)]
MFC r302981:
Fix another bug after r302350.

Approved by: re (gjb)

7 years agoMFC r302960: Restore PIM_ATA_EXT flag handling, lost at r300207.
mav [Thu, 21 Jul 2016 12:15:04 +0000 (12:15 +0000)]
MFC r302960: Restore PIM_ATA_EXT flag handling, lost at r300207.

This re-enables NCQ TRIM usage on capable hardware (bhyve).

Approved by: re (kib)

7 years agoMFC r302957: Fix NCQ TRIM emulation.
mav [Thu, 21 Jul 2016 11:57:41 +0000 (11:57 +0000)]
MFC r302957: Fix NCQ TRIM emulation.

When this code was written, there was no guests using it to test.

Approved by: re (kib)

7 years agoUpdate if_hwassist when interface options are changed.
mav [Thu, 21 Jul 2016 11:39:43 +0000 (11:39 +0000)]
Update if_hwassist when interface options are changed.

In particular for me this fixes checksum problem when if_bridge attached
to the interface requests TXCSUM to be disabled, but effectively ignored.

Approved by: re (kib)

7 years agoMFC r303003:
gjb [Thu, 21 Jul 2016 10:44:26 +0000 (10:44 +0000)]
MFC r303003:

 Make sure we clean up the rdoc and reldoc directories if NODOC
 is not set.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

7 years agoMFC: r302916
bapt [Wed, 20 Jul 2016 20:12:58 +0000 (20:12 +0000)]
MFC: r302916

Revert 302324 and properly fix the crash with ISO-8859-5 locales

PR: 211135
Reported by: jkim
Tested by: jkim
Approved by: re (gjb)

7 years agoMFC r302770:
kib [Wed, 20 Jul 2016 15:02:37 +0000 (15:02 +0000)]
MFC r302770:
Trace timeval parameters to the getitimer(2) and setitimer(2) syscalls.

Approved by: re (gjb)

7 years agoMFC r302973:
pfg [Wed, 20 Jul 2016 04:45:59 +0000 (04:45 +0000)]
MFC r302973:
sed(1): Fix off by one introduced in r299211.

Detected by running the gsed tests.

Submitted by: Mikhail Teterin
PR: 195929
Approved by: re (gjb)

7 years agoMFC r302673
slm [Tue, 19 Jul 2016 16:46:27 +0000 (16:46 +0000)]
MFC r302673
Use real values to calculate Max I/O size instead of guessing.

Reviewed by: ken, scottl
Approved by: re(gjb), ken, scottl, ambrisko (mentors)
Differential Revision: https://reviews.freebsd.org/D7043

7 years agoReduce the disc1.iso size from 850+M to just over 650M.
gjb [Tue, 19 Jul 2016 16:22:50 +0000 (16:22 +0000)]
Reduce the disc1.iso size from 850+M to just over 650M.

As a result of this change, the 'kernel-dbg.txz' distribution
is no longer provided on disc1.iso, and deselected by default
in bsdinstall(8).  When 'kernel-dbg.txz' is selected, network
configuration happens before the installer proceeds, to fetch
the distribution from the mirrors.

This is a direct commit to stable/11, as there is intention
to solve this differently for 12.0-RELEASE.

Reviewed by: nwhitehorn (glanced at)
Approved by: re (hrs)
Sponsored by: The FreeBSD Foundation

7 years agoMFC r302518, r302626:
dchagin [Mon, 18 Jul 2016 16:39:53 +0000 (16:39 +0000)]
MFC r302518, r302626:

Add linux_mmap.c to the appropriate conf/files.

Approved by: re (gjb)

7 years agoMFC r302517:
dchagin [Mon, 18 Jul 2016 16:38:06 +0000 (16:38 +0000)]
MFC r302517:

Fix a copy/paste bug introduced during X86_64 Linuxulator work.
FreeBSD support NX bit on X86_64 processors out of the box, for i386 emulation
use READ_IMPLIES_EXEC flag, introduced in r302515.

While here move common part of mmap() and mprotect() code to the files in compat/linux
to reduce code dupcliation between Linuxulator's

Approved by: re (gjb)

7 years agoMFC r302516:
dchagin [Mon, 18 Jul 2016 16:35:44 +0000 (16:35 +0000)]
MFC r302516:

Regen for r302515 (Linux personality).

Approved by: re (gjb)

7 years agoMFC r302515:
dchagin [Mon, 18 Jul 2016 16:34:11 +0000 (16:34 +0000)]
MFC r302515:

Implement Linux personality() system call mainly due to READ_IMPLIES_EXEC flag.
In Linux if this flag is set, PROT_READ implies PROT_EXEC for mmap().
Linux/i386 set this flag automatically if the binary requires executable stack.

READ_IMPLIES_EXEC flag will be used in the next Linux mmap() commit.

Approved by: re (gjb)

7 years agoMFC r302772: re-apply r299908: zfsctl_snapdir_lookup: clear VV_ROOT of
avg [Mon, 18 Jul 2016 07:06:44 +0000 (07:06 +0000)]
MFC r302772: re-apply r299908: zfsctl_snapdir_lookup: clear VV_ROOT of
snapshot's root

The change has been undone in r301275 on the assumption that it was no
longer required.  But that was incorrect, because in this case (and only
in this case) the snapshot root vnode is looked up before z_parent is
fixed up.

Approved by: re (delphij)

7 years agoMFC r302573:
kib [Mon, 18 Jul 2016 04:33:12 +0000 (04:33 +0000)]
MFC r302573:
Fill tf_trapno for trap frames created for syscall.

Approved by: re (gjb)

7 years agoMFC r302561,302565:
ae [Mon, 18 Jul 2016 04:16:53 +0000 (04:16 +0000)]
MFC r302561,302565:
  Flush buffer after output. This fixes adding new data to already
  printed flows.

  PR: 210882
Approved by: re (kib)

7 years agoMFC r302511, r302771, r302845:
pfg [Sun, 17 Jul 2016 18:23:20 +0000 (18:23 +0000)]
MFC r302511, r302771, r302845:
mail(1): check for out of memory conditions when calling calloc(3).

Approved by: re (gjb)

7 years agoMFC r302857:
jamie [Sun, 17 Jul 2016 14:07:51 +0000 (14:07 +0000)]
MFC r302857:

  Start jails non-parallel if jail_parallel_start is NO.  This was true
  for an explicitly specified jail list; now it's also true for all jails.

PR: 209112
Approved by: re (gjb)

7 years agoMFC r302856:
jamie [Sun, 17 Jul 2016 14:06:17 +0000 (14:06 +0000)]
MFC r302856:

  Fix up the order in which jail creation processes are run, to preserve
  the config file's order in the non-parallel-start case.

PR: 209112
Approved by: re (gjb)

7 years agoMFC r302855:
jamie [Sun, 17 Jul 2016 14:05:11 +0000 (14:05 +0000)]
MFC r302855:

  Wait for jails to complete startup if jail_parallel_start is YES,
  instead of assuming they'll take less than one second.

PR: 203172
Submitted by: dmitry2004@yandex.ru
Approved by: re (gjb)

7 years agoMFC r302787
vangyzen [Sat, 16 Jul 2016 15:52:14 +0000 (15:52 +0000)]
MFC r302787

zpool(8): update Hot Spares section to mention zfsd(8)

Approved by: re (gjb)

7 years agoMFC r302784:
dim [Sat, 16 Jul 2016 10:50:28 +0000 (10:50 +0000)]
MFC r302784:

Fix a page fault in ip6_setpktopt(), occurring when the pflog module is
loaded, and syncthing is started, which uses setsockopt(IPV6_PKGINFO).

This is because pflog interfaces do not normally have an IPv6 address,
causing the ND_IFINFO() macro to dereference a NULL pointer.

Approved by: re (kib)
Reviewed by: ae
PR: 210943

7 years agoMFC r302667
truckman [Sat, 16 Jul 2016 06:41:02 +0000 (06:41 +0000)]
MFC r302667

Fix problems in the FQ-PIE AQM cleanup code that could leak memory or
cause a crash.

Because dummynet calls pie_cleanup() while holding a mutex, pie_cleanup()
is not able to use callout_drain() to make sure that all callouts are
finished before it returns, and callout_stop() is not sufficient to make
that guarantee.  After pie_cleanup() returns, dummynet will free a
structure that any remaining callouts will want to access.

Fix these problems by allocating a separate structure to contain the
data used by the callouts.  In pie_cleanup(), call callout_reset_sbt()
to replace the normal callout with a cleanup callout that does the cleanup
work for each sub-queue.  The instance of the cleanup callout that
destroys the last flow will also free the extra allocated block of memory.
Protect the reference count manipulation in the cleanup callout with
DN_BH_WLOCK() to be consistent with all of the other usage of the reference
count where this lock is held by the dummynet code.

Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7174

7 years agoMFC r302502, r302505:
ian [Fri, 15 Jul 2016 21:30:19 +0000 (21:30 +0000)]
MFC r302502, r302505:

  Consolidate debugging options from all arm kernel configs to std.arm[v6].

  Correct syntax errors that only show up when compiled with INVARIANTS.

Approved by: re (gjb)

7 years agoMFC r302507:
markj [Fri, 15 Jul 2016 20:26:28 +0000 (20:26 +0000)]
MFC r302507:
Avoid truncating the return value of DTrace predicates.

Approved by: re (gjb)

7 years agoMFC r302674:
bdrewery [Fri, 15 Jul 2016 19:58:05 +0000 (19:58 +0000)]
MFC r302674:

  META_MODE: Don't require filemon(4) for mergemaster(8)/etcupdate(8)

Approved by: re (gjb)

7 years agoMFC r302635:
royger [Fri, 15 Jul 2016 09:44:48 +0000 (09:44 +0000)]
MFC r302635:

xen: automatically disable MSI-X interrupt migration

Approved by: re (kib)

7 years agoMFC 302541,302605
sephe [Fri, 15 Jul 2016 02:24:39 +0000 (02:24 +0000)]
MFC 302541,302605

302541
    hyperv/stor: Fix the INQUIRY checks

    Don't check the area that the host has not filled.

    PR:         https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209443
    PR:         https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210425
    Submitted by:       Hongjiang Zhang <honzhan microsoft com>
    Reviewed by:        sephe, Dexuan Cui <decui microsoft com>
    Sponsored by:       Microsoft OSTC
    Differential Revision:      https://reviews.freebsd.org/D6955

302605
    hyperv/stor: Save the response status and xfer length properly.

    The current command response handling discards status and xfer
    length unconditionally, so that all of the commands would be
    considered successful, even if errors happened.  When errors
    really happens, this causes all kinds of wiredness, since the
    buffer will not be filled on the host side and sense data will
    be ignored.

    Most of the time, errors do not happen, however, error does
    happen for the request sent immediately after the disk resizing.
    Discarding the SCSI status (SCSI_STATUS_CHECK_COND) and sense
    data (capacity changes) prevents the disk resizing from working
    properly.

    This commit saves the response status and xfer length properly
    for later use.

    Submitted by:       Dexuan Cui <decui microsoft com>
    Noticed by: sephe
    Sponsored by:       Microsoft OSTC
    Differential Revision:      https://reviews.freebsd.org/D7181

Approved by: re (gjb)

7 years agoRemove GENERIC-NODEBUG kernel configurations, missed during
gjb [Thu, 14 Jul 2016 08:20:17 +0000 (08:20 +0000)]
Remove GENERIC-NODEBUG kernel configurations, missed during
the stable/11 branch.

This is a direct commit to stable/11.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

7 years agoRemove the 'debug.witness.trace' entry, as WITNESS is not
gjb [Thu, 14 Jul 2016 08:19:25 +0000 (08:19 +0000)]
Remove the 'debug.witness.trace' entry, as WITNESS is not
enabled on stable branches by default.

This is a direct commit to stable/11.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

7 years agoMFC r302476:
pfg [Wed, 13 Jul 2016 15:51:58 +0000 (15:51 +0000)]
MFC r302476:
ng_mppc(4):: basic code readability cleanups.

In particular use __unreachable() to appease static analyzers.
No functional change.

CID: 1356591
Approved by: re (gjb)

7 years agoMFC r302439:
bdrewery [Tue, 12 Jul 2016 17:22:13 +0000 (17:22 +0000)]
MFC r302439:

  iflib: Fix typo in 'iflib_rx_miss_bufs' sysctl name

Approved by: re (gjb)

7 years agoMFC r302503:
trasz [Tue, 12 Jul 2016 13:12:01 +0000 (13:12 +0000)]
MFC r302503:

Fix ctld(8) to not exit when reloading configuration with invalid
initiator-portal clause.

Approved by: re (gjb)

7 years agoMFC r302448:
ed [Tue, 12 Jul 2016 06:25:28 +0000 (06:25 +0000)]
MFC r302448:

  Don't forget to set sa->narg for CloudABI system calls.

  It turns out that this value is not used within the system call code
  under normal conditions, except when using tracing tools like ktrace.
  If we forget to set this value, it is set to random garbage. This may
  cause ktrace to hang indefinitely, making it impossible to kill.

Approved by: re@
Reported by: Michael Plass
PR: 210800

7 years agoMFC r302532:
ngie [Tue, 12 Jul 2016 06:06:10 +0000 (06:06 +0000)]
MFC r302532:

Correct OLD_LIBS change done in r298840

libkvm.so lives in /lib, not /usr/lib

Approved by: re (gjb)

7 years agoFix the branch name in the release notes.
gjb [Mon, 11 Jul 2016 14:24:50 +0000 (14:24 +0000)]
Fix the branch name in the release notes.

Approved by: re (implicit, relnotes)
Sponsored by: The FreeBSD Foundation

7 years agoMFC r302534:
delphij [Mon, 11 Jul 2016 04:50:32 +0000 (04:50 +0000)]
MFC r302534:

Allow - in distribution names.  This is needed for freebsd-update to
work with 11.0+, where the debugging symbols use a new naming scheme
for release distribution files.

Errata candidate.

Approved by: re (gjb)

7 years agoTurn off WITNESS, INVARIANTS, etc., in the powerpc GENERIC64
gjb [Sun, 10 Jul 2016 17:16:56 +0000 (17:16 +0000)]
Turn off WITNESS, INVARIANTS, etc., in the powerpc GENERIC64
kernel configuration, missed after the stable/11 branch.

Approved by: re (kib)
PR: 210974
Sponsored by: The FreeBSD Foundation

7 years agoMFC r302449:
bdrewery [Fri, 8 Jul 2016 21:19:48 +0000 (21:19 +0000)]
MFC r302449:

  Use TARGET here to fix check/delete-old after r302391.

Approved by: re (gjb)

7 years agoMFC r302438:
ngie [Fri, 8 Jul 2016 18:54:28 +0000 (18:54 +0000)]
MFC r302438:

Revert r302403

lang/gcc{48,49,5} lacks -fformat-extensions support (causing build errors, which
is what prompted r302403 to be committed). devel/amd64-gcc on the other hand
(which is used by Jenkins), has the support.

This fixes the Jenkins failure emails due to excessive warnings being produced
with "make buildkernel".

Discussed with: lwhsu
Approved by: re (gjb)

7 years agoSwitch 11.0 from -ALPHA6 to -BETA1 to prepare for builds.
gjb [Fri, 8 Jul 2016 00:26:38 +0000 (00:26 +0000)]
Switch 11.0 from -ALPHA6 to -BETA1 to prepare for builds.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

7 years agoMissed a few entries in the previous commit, documentation related.
gjb [Fri, 8 Jul 2016 00:25:32 +0000 (00:25 +0000)]
Missed a few entries in the previous commit, documentation related.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

7 years ago- Remove debugging from GENERIC* kernel configurations
gjb [Fri, 8 Jul 2016 00:22:14 +0000 (00:22 +0000)]
- Remove debugging from GENERIC* kernel configurations
- Enable MALLOC_PRODUCTION
- Default dumpdev=NO
- Remove UPDATING entry regarding debugging features

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

7 years agoCopy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
gjb [Fri, 8 Jul 2016 00:04:57 +0000 (00:04 +0000)]
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

7 years agoDo not use -fformat-extensions with non-base versions of gcc
ngie [Thu, 7 Jul 2016 22:44:23 +0000 (22:44 +0000)]
Do not use -fformat-extensions with non-base versions of gcc

Ports versions of gcc do not have -fformat-extensions support.

This unbreaks compiling the kernel/modules with non-base gcc (4.8,
5.0, etc) if MK_FORMAT_EXTENSIONS=yes (the default).

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7150
Reviewed by: bdrewery
Sponsored by: EMC / Isilon Storage Division

7 years agoFix ahci(4) driver attach to controller with 32 ports.
mav [Thu, 7 Jul 2016 22:10:10 +0000 (22:10 +0000)]
Fix ahci(4) driver attach to controller with 32 ports.

Incorrect sign expansion in variables that supposed to be a bit fields
caused infinite loop.  Fixing this allows system properly detect maximal
possible 32 devices configured on AHCI HBA of BHyVe.  That case did not
happen in a wild before due to lack of hardware AHCI HBAs with 32 ports.

Approved by: re (gjb@)
MFC after: 1 week

7 years agofcntl(2): Document interrupt/restart for file locks.
jilles [Thu, 7 Jul 2016 21:44:59 +0000 (21:44 +0000)]
fcntl(2): Document interrupt/restart for file locks.

Since r302216, thread suspension causes advisory file locks to restart
(instead of continuing to wait) and for a long time SA_RESTART has
affected advisory file locks. These are both not compliant to POSIX.1.

To clarify that restarting means something, add a paragraph about fair
queuing. Note that the network lock manager does not implement fair
queuing.

Reviewed by: kib (previous version)
Approved by: re (gjb)

7 years agoWITH_SYSTEM_COMPILER: Don't enable for xdev or native-xtools.
bdrewery [Thu, 7 Jul 2016 21:03:50 +0000 (21:03 +0000)]
WITH_SYSTEM_COMPILER: Don't enable for xdev or native-xtools.

Otherwise they get no compiler.

Reported by: swills
Tested by: swills
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

7 years agoChange the type of the map entry's next_read field from a vm_pindex_t to a
alc [Thu, 7 Jul 2016 20:58:16 +0000 (20:58 +0000)]
Change the type of the map entry's next_read field from a vm_pindex_t to a
vm_offset_t.  (This field is used to detect sequential access to the virtual
address range represented by the map entry.)  There are three reasons to
make this change.  First, a vm_offset_t is smaller on 32-bit architectures.
Consequently, a struct vm_map_entry is now smaller on 32-bit architectures.
Second, a vm_offset_t can be written atomically, whereas it may not be
possible to write a vm_pindex_t atomically on a 32-bit architecture.  Third,
using a vm_pindex_t makes the next_read field dependent on which object in
the shadow chain is being read from.

Replace an "XXX" comment.

Reviewed by: kib
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

7 years agolorder: produce locale-independent symbol ordering
emaste [Thu, 7 Jul 2016 20:50:59 +0000 (20:50 +0000)]
lorder: produce locale-independent symbol ordering

Found by the Debian reproducible builds effort -- Debian bug 830259.

Reported by: Reiner Herrmann <reiner@reiner-h.de>
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

7 years agoTidy up loose ends from Netflix I/O sched rename to dynamic I/O sched.
imp [Thu, 7 Jul 2016 20:31:35 +0000 (20:31 +0000)]
Tidy up loose ends from Netflix I/O sched rename to dynamic I/O sched.
Rename kern.cam.do_netflix_iosched sysctl to
kern.cam.do_dynamic_iosched.

Approved by: re (kib@)

7 years agoFix a lockup in tx path for cspw.
loos [Thu, 7 Jul 2016 20:01:03 +0000 (20:01 +0000)]
Fix a lockup in tx path for cspw.

Sometimes the software loses the race when appending more descriptors to
the tx ring and the tx queue stops.

This commit detects this condition and restart the tx queue whenever it stall.

Tested by: sobomax@, Keith White <kwhite@site.uottawa.ca>,
Paul Mather <paul@gromit.dlib.vt.edu>
Sponsored by: Rubicon Communications (Netgate)
Approved by: re (kib)

7 years agoAutotune the number of pages set aside for UMA startup based on the number
cperciva [Thu, 7 Jul 2016 18:37:12 +0000 (18:37 +0000)]
Autotune the number of pages set aside for UMA startup based on the number
of CPUs present.  On amd64 this unbreaks the boot for systems with 92 or
more CPUs; the limit will vary on other systems depending on the size of
their uma_zone and uma_cache structures.

The major consumer of pages during UMA startup is the 19 zone structures
which are set up before UMA has bootstrapped itself sufficiently to use
the rest of the available memory:  UMA Slabs, UMA Hash, 4 / 6 / 8 / 12 /
16 / 32 / 64 / 128 / 256 Bucket, vmem btag, VM OBJECT, RADIX NODE, MAP,
KMAP ENTRY, MAP ENTRY, VMSPACE, and fakepg.  If the zone structures occupy
more than one page, they will not share pages and the number of pages
currently needed for startup is 19 * pages_per_zone + N, where N is the
number of pages used for allocating other structures; on amd64 N = 3 at
present (2 pages are allocated for UMA Kegs, and one page for UMA Hash).

This patch adds a new definition UMA_BOOT_PAGES_ZONES, currently set to 32,
and if a zone structure does not fit into a single page sets boot_pages to
UMA_BOOT_PAGES_ZONES * pages_per_zone instead of UMA_BOOT_PAGES (which
remains at 64).  Consequently this patch has no effect on systems where the
zone structure fits into 2 or fewer pages (on amd64, 59 or fewer CPUs), but
increases boot_pages sufficiently on systems where the large number of CPUs
makes this structure larger.  It seems safe to assume that systems with 60+
CPUs can afford to set aside an additional 128kB of memory per 32 CPUs.

The vm.boot_pages tunable continues to override this computation, but is
unlikely to be necessary in the future.

Tested on: EC2 x1.32xlarge
Relnotes: FreeBSD can now boot on 92+ CPU systems without requiring
vm.boot_pages to be manually adjusted.
Reviewed by: jeff, alc, adrian
Approved by: re (kib)

7 years ago[ath] obey the short-GI vap config flag when transmitting.
adrian [Thu, 7 Jul 2016 17:22:13 +0000 (17:22 +0000)]
[ath] obey the short-GI vap config flag when transmitting.

This makes 'ifconfig wlanX -shortgi' work correctly.

Tested:

* AR9380, STA mode

Approved by: re (gjb)

7 years agoStop deleting ofwdump.8.gz on arm and arm64 when running make delete-old,
andrew [Thu, 7 Jul 2016 15:25:14 +0000 (15:25 +0000)]
Stop deleting ofwdump.8.gz on arm and arm64 when running make delete-old,
it is installed on these architectures.

Approved by: re (kib)
Sponsored by: ABT Systems Ltd

7 years agoDocument 299786, Support for X-Powers AXP813 and AXP818 PMIC
skreuzer [Thu, 7 Jul 2016 14:29:23 +0000 (14:29 +0000)]
Document 299786, Support for X-Powers AXP813 and AXP818 PMIC

Approved by: re (gjb, implicit, relnotes)

7 years agoAdd new unmount(2) flag, MNT_NONBUSY, to check whether there are
trasz [Thu, 7 Jul 2016 09:03:57 +0000 (09:03 +0000)]
Add new unmount(2) flag, MNT_NONBUSY, to check whether there are
any open vnodes before proceeding. Make autounmound(8) use this flag.
Without it, even an unsuccessfull unmount causes filesystem flush,
which interferes with normal operation.

Reviewed by: kib@
Approved by: re (gjb@)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7047

7 years agoARM64: move to GPT scheme in sysinstall
wma [Thu, 7 Jul 2016 05:47:42 +0000 (05:47 +0000)]
ARM64: move to GPT scheme in sysinstall

     It's time to abandon MBR installations on
     ARM64 platforms.

     Obtained from:         Semihalf
     Submitted by:          Dominik Ermel <der@semihalf.com>
     Sponsored by:          Cavium
     Reviewed by:           gjb, emaste, marcel
     Approved by:           re (gjb)
     Differential Revision: https://reviews.freebsd.org/D6798

7 years agoDo not initialize the adapter on MTU change when adapter status is down.
sbruno [Thu, 7 Jul 2016 03:39:18 +0000 (03:39 +0000)]
Do not initialize the adapter on MTU change when adapter status is down.
This fixes long-standing problems when changing settings of the adapter.

Discussed in:
https://lists.freebsd.org/pipermail/freebsd-net/2016-June/045509.html

Submitted by: arnaud.ysmal@stormshield.eu
Reviewed by: erj@freebsd.org
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7030

7 years agoFix ZFS ARC min / max tunable
smh [Wed, 6 Jul 2016 23:49:19 +0000 (23:49 +0000)]
Fix ZFS ARC min / max tunable

Due to ARC initial configuration not being done and kmem information
not being available we need to blindly set zfs_arc_max and zfs_arc_min
when configured via the tunable.

This fixes vfs.zfs.arc_(min|max) configuration via loader.conf broken by
r302265.

Approved by: re(gjb)
MFC after: 1 week

7 years agoHandle IOC_VOID special case of passing an integer IOCTL argument through CUSE.
hselasky [Wed, 6 Jul 2016 22:21:22 +0000 (22:21 +0000)]
Handle IOC_VOID special case of passing an integer IOCTL argument through CUSE.

Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru>
Approved by: re (gjb)

7 years agoisci: fix ATA PASSTHROUGH fixed sense data format
jimharris [Wed, 6 Jul 2016 20:48:42 +0000 (20:48 +0000)]
isci: fix ATA PASSTHROUGH fixed sense data format

PR: kern/191717
Submitted by: martin@lispworks.com
Approved by: re (gjb)
MFC after: 3 days

7 years agoCorrect locking annotation for p_comm.
jhb [Wed, 6 Jul 2016 18:55:46 +0000 (18:55 +0000)]
Correct locking annotation for p_comm.

p_comm is changed during exec, it is not read-only after fork.

Pointed out by: rwatson
Approved by: re (gjb, kib)
MFC after: 1 week

7 years agoAdd variable declaration missing in r302372.
nwhitehorn [Wed, 6 Jul 2016 17:46:49 +0000 (17:46 +0000)]
Add variable declaration missing in r302372.

Submitted by: andrew
Approved by: re (gjb, kib)

7 years agoRemove the old pre-INTRNG arm64 interrupt framework. GENERIC was switched
andrew [Wed, 6 Jul 2016 16:20:10 +0000 (16:20 +0000)]
Remove the old pre-INTRNG arm64 interrupt framework. GENERIC was switched
to INTRNG in r301565 with the old code no longer being built by default with
no reports of issues on any supported hardware.

Approved by: re (gjb)
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoThe TCPPCAP debugging feature caches recently-used mbufs for use in
jtl [Wed, 6 Jul 2016 16:17:13 +0000 (16:17 +0000)]
The TCPPCAP debugging feature caches recently-used mbufs for use in
debugging TCP connections. This commit provides a mechanism to free those
mbufs when the system is under memory pressure.

Because this will result in lost debugging information, the behavior is
controllable by a sysctl. The default setting is to free the mbufs.

Reviewed by: gnn
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D6931
Input from: novice_techie.com

7 years agoFix CTASSERT issue in a more clean way
ngie [Wed, 6 Jul 2016 16:02:15 +0000 (16:02 +0000)]
Fix CTASSERT issue in a more clean way

- Replace all CTASSERT macro instances with static_assert's.
- Remove the WRAPPED_CTASSERT macro; it's now an unnecessary obfuscation.
- Localize all static_assert's to the structures being tested.
- Sort some headers per-style(9).

Approved by: re (hrs)
Differential Revision: https://reviews.freebsd.org/D7130
MFC after: 1 week
X-MFC with: r302364
Reviewed by: ed, grehan (maintainer)
Submitted by: ed
Sponsored by: EMC / Isilon Storage Division