MFC r245783:

Simplify and fix a bug in cc_ack_received()'s "are we congestion window limited"
logic (refer to [1] for associated discussion). snd_cwnd and snd_wnd are
unsigned long and on 64 bit hosts, min() will truncate them to 32 bits and could
therefore potentially corrupt the result (although under normal operation,
neither variable should legitmately exceed 32 bits).

[1] http://lists.freebsd.org/pipermail/freebsd-net/2013-January/034297.html

Submitted by:	jhb
MFC r245328:
Freeze device queue before returning errors to CAM.  This is required
for proper error recovery, including keeping original request order.
MFC r245647 (by kan):
Do not pretend to have autosense data when no such data is available.

Make umass return an error code if SCSI sense retrieval request
has failed. Make sure scsi_error_action honors SF_NO_RETRY and
SF_NO_RECOVERY in all cases, even if it cannot parse sense bytes.
MFC r249846:

When rebooting (exiting) from the BTX loader, make sure to restore the
GDT from the correct segment, otherwise a triple fault would be caused.
In some virtual environments (VMware, VirtualBox, etc) this could lead
to a unhandled error or hang in the guest emulation software.

Thanks to avg and jhb for a few hints in the right direction.

Noticed by:	Jeremy Chadwick <jdc@koitsu.org> (and many others)
MFC r250075:
Properly terminate the result string for intermediate results.
MFC: r249548
Allow the vnode to be unlocked for the weird case of
LK_EXCLOTHER. LK_EXCLOTHER is only used to acquire a
usecount on a vnode during NFSv4 recovery from an
expired lease.
MFC r249489,249555

  Run configtest before restarting so that the system is not
  left without a running sshd.

  Also call configtest before reload to ensure working config.
MFC r233473,233512,233518,233992,233994,238808,238920,250209-250211.

libc/locale: sync mdoc changes with head.

 r233473:
  mdoc: document title should be all caps.

 r233512:
  mdoc: remove empty lines.

 r233518:
  mdoc: remove unknown macro.

 r233992:
  mdoc: fix column names, indentation, column separation within each row, and
  quotation. Also make sure we have the same amount of columns in each row as
  the number of columns we specify in the head arguments.

 r233994:
  mdoc: fix function type.

 r238808:
  Start manpage with Dd macro and also remove a trailing whitespace
  while here.

 r238920:
  Remove trailing whitespace.

 r250209:
  querylocale(3): remove the STANDARDS section.

 r250210,r250211:
  Remove an extra comma, add a missing period.
MFC r228269,228921:

- libc: Eliminate 13 relative relocations in wctype().
- libc: Eliminate some relative relocations in setlocale().
MFC r244091:

Improve style(9) compliance of function declarations.
MFC r250000:
  Move IPPROTO_IPV6 from #ifdef __BSD_VISIBLE to #if __POSIX_VISIBLE >= 201112
  since POSIX 2001 states that it shall be defined.
MFC r249983: syslogd: Use closefrom() instead of getdtablesize()/close()
loop.

When syslogd forks a process for '|' destinations, it closes all file
descriptors greater than 2.

Use closefrom() for this instead of a getdtablesize()/close() loop because
it is both faster and avoids leaving file descriptors open because the limit
was lowered after they were opened.
MFC r245304 (by theraven):

  Merge new version of libcxxrt.  This brings in three fixes:

  - Don't treat pointers to members as pointers in catch blocks
    (they're usually fat pointers).

  - Correctly catch foreign exceptions in catchalls.

  - Ensure that a happens-before relationship is established when
    setting terminate handlers in one thread and calling them in
    another.

MFC r245327 (by theraven):

  Fix libcxxrt / libc++ build with the clang in head.

  Pointy hat to:	theraven

MFC r245745 (by theraven):

  Import new fix from libcxxrt.  This fixes the case where you attempt
  to rethrow an exception when you haven't caught one.  This is largely
  a cosmetic fix, as (unless you have a very unusual terminate handler
  installed) it will print a nice error and then abort, rather than
  just aborting.

MFC r246462 (by theraven):

  Fix a copy-and-paste error in libcxxrt.

MFC r249993:

  Merge libcxxrt c812a07cd2f95c1403baf0bbe0366e7618d1d6d3:

  * Don't call the _fast version of the TLS accessor in terminate() or
    unexpected().
    1) TLS may not have been set up yet.
    2) When we're in one of these functions, Really Bad Stuff has
       happened and potentially saving a few cycles really isn't
       important.
  * Merge in fixes from FreeBSD trunk to make atomics work with recent
    clang.
MFC r248933:

Use a shared lock for VOP_GETEXTATTR, as it is a read-like operation.
MFC: r249623
Both NFS clients can deadlock when using the "rdirplus" mount
option. This can occur when an nfsiod thread that already holds
a buffer lock attempts to acquire a vnode lock on an entry in
the directory (a LOR) when another thread holding the vnode lock
is waiting on an nfsiod thread. This patch avoids the deadlock by disabling
readahead for this case, so the nfsiod threads never do readdirplus.
Since readaheads for directories need the directory offset cookie
from the previous read, they cannot normally happen in parallel.
As such, testing by jhb@ and myself didn't find any performance
degredation when this patch is applied. If there is a case where
this results in a significant performance degradation, mounting
without the "rdirplus" option can be done to re-enable readahead
for directories.
MFC: r249630
When an NFS unmount occurs, once vflush() writes the last dirty
buffer for the last vnode on the mount back to the server, it
returns. At that point, the code continues with the unmount,
including freeing up the nfs specific part of the mount structure.
It is possible that an nfsiod thread will try to check for an
empty I/O queue in the nfs specific part of the mount structure
after it has been free'd by the unmount. This patch avoids this problem by
setting the iodmount entries for the mount back to NULL while holding the
mutex in the unmount and checking the appropriate entry is non-NULL after
acquiring the mutex in the nfsiod thread.
MFC r250026:

Convert panic() into KASSERT().
MFC r250028:
Assert that the object type for the vnode' non-NULL v_object, passed
to vnode_pager_setsize(), is either OBJT_VNODE, or, if vnode was
already reclaimed, OBJT_DEAD.

More, if the object is terminated, do not perform the resizing operation.
Merge r246619 from head:
  Correct spelling of "daemon".  No .Dd bump.
  Noticed by:   Nathan Rich <Nathan.Rich dynastysystems com>
Merge r247915 from head:
  The ZyXEL ZyAIR G-202 is also supported by zyd(4)