]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC r311572, r311895, r311928, r311985, r312395, r312417
asomers [Tue, 28 Feb 2017 22:18:05 +0000 (22:18 +0000)]
MFC r311572, r311895, r311928, r311985, r312395, r312417

r311572:
Fix file descriptor leaks in cmp(1)

Also, add a few test cases

Reported by: Coverity
CID: 271624 275338
Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9074

r311895:
Fix memory leaks during "tail -r" of an irregular file

* Rewrite r_buf to use standard tail queues instead of a hand-rolled
  circular linked list. Free dynamic allocations when done.
* Remove an optimization for the case where the file is a multiple of 128KB
  in size and there is a scarcity of memory.
* Add ATF tests for "tail -r" and its variants.

Reported by: Valgrind
Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9067

r311928:
Fix build of usr.bin/tail with GCC

Submitted by: pluknet
Reported by: pluknet
MFC after: 27 days
X-MFC-with: 311895
Sponsored by: Spectra Logic Corp

r311985:
Fix uninitialized variable CIDs in route6d

The variables in question are actually return arguments, but it's still good
form to initialize them.

Reported by: Coverity
CID: 979679 979680
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

r312395:
Fix several Coverity CIDs in devd

CID 13620551362054: File descriptor leaks during shutdown
CID 1362013: Potential null-termination fail with long network device names
CID 1362097: Uncaught exception during memory pressure
CID 13620171362016: Unchecked errors, possibly resulting in weird behavior
if two devd instances start at the same time.
CID 1362015: Unchecked error that will probably never fail

Reported by: Coverity
CID: 1362055 1362054 1362013 1362097 1362017 1362016 1362015
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

r312417:
Fix build of devd with GCC 4.2

Reported by: olivier
Pointy-hat-to: asomers
MFC after: 27 days
X-MFC-with: 312395
Sponsored by: Spectra Logic Corp

git-svn-id: svn://svn.freebsd.org/base/stable/10@314425 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313734:
kib [Tue, 28 Feb 2017 15:03:34 +0000 (15:03 +0000)]
MFC r313734:
Add RLIM_SAVED_MAX and RLIM_SAVED_CUR symbols.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314392 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313751: mca: fix writes to MSR_MC_CTL2 in cmci_update
avg [Tue, 28 Feb 2017 11:42:04 +0000 (11:42 +0000)]
MFC r313751: mca: fix writes to MSR_MC_CTL2 in cmci_update

git-svn-id: svn://svn.freebsd.org/base/stable/10@314386 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313744: No need to erase sense_data when sense_len is set to zero.
mav [Tue, 28 Feb 2017 06:32:01 +0000 (06:32 +0000)]
MFC r313744: No need to erase sense_data when sense_len is set to zero.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314380 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314244:
ngie [Tue, 28 Feb 2017 00:58:16 +0000 (00:58 +0000)]
MFC r314244:

Remove MK_OBJC block

It is no longer represented via src.conf(5)

git-svn-id: svn://svn.freebsd.org/base/stable/10@314368 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoNote: this change reintroduces r314020 after r314327, r314330, and r314332
ngie [Tue, 28 Feb 2017 00:56:33 +0000 (00:56 +0000)]
Note: this change reintroduces r314020 after r314327, r314330, and r314332

MFC r313404:

Improve libnetbsd compatibility with NetBSD

This change is being made to diff reduce/reduce duplication in
contrib/netbsd-tests and to facilitate further porting of software from
NetBSD

Add the following headers:
- sys/event.h:
-- sys/types.h is required for kqueue on FreeBSD, but not NetBSD.
- sys/types.h:
-- NBBY is defined in sys/param.h on FreeBSD, not sys/types.h like on NetBSD.
   Pull in sys/param.h to have parity with NetBSD.
- sys/wait.h:
-- Define wrusage as __wrusage for parity with NetBSD typedef.
- glob.h
-- Define __gl_stat_t as "struct stat" for parity with NetBSD typedef.
- pthread.h:
-- Pull in pthread_np.h for _np functions defined separately on FreeBSD.

Improve compatibility with NetBSD in the following headers:

- sha1.h:
-- define SHA1_CTX as SHA_CTX
-- define SHA1Final as SHA1_Final
- sha2.h:
-- #include sha384 to pick up all of the SHA 384 bit macros and definitions.
- util.h:
-- Add sys/types.h to util.h to pollute the header for types used in
   flags_to_string and string_to_flags (u_long) as NetBSD doesn't require them
   for the functions.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314366 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314059: zfs: move zio_taskq_basedc under SYSDC
avg [Mon, 27 Feb 2017 17:27:42 +0000 (17:27 +0000)]
MFC r314059: zfs: move zio_taskq_basedc under SYSDC

git-svn-id: svn://svn.freebsd.org/base/stable/10@314356 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314183: add jedec_ts.4 to the list of manual pages
avg [Mon, 27 Feb 2017 17:25:56 +0000 (17:25 +0000)]
MFC r314183: add jedec_ts.4 to the list of manual pages

git-svn-id: svn://svn.freebsd.org/base/stable/10@314354 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r314037: jedec_ts: fix slave address check
avg [Mon, 27 Feb 2017 17:23:42 +0000 (17:23 +0000)]
MFC r314037: jedec_ts: fix slave address check

git-svn-id: svn://svn.freebsd.org/base/stable/10@314351 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313752,r314035: mca: use time_uptime instead of ticks for CMCI throttling
avg [Mon, 27 Feb 2017 17:20:49 +0000 (17:20 +0000)]
MFC r313752,r314035: mca: use time_uptime instead of ticks for CMCI throttling

git-svn-id: svn://svn.freebsd.org/base/stable/10@314350 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313730: try to fix RACCT_RSS accounting
avg [Mon, 27 Feb 2017 17:18:07 +0000 (17:18 +0000)]
MFC r313730: try to fix RACCT_RSS accounting

git-svn-id: svn://svn.freebsd.org/base/stable/10@314348 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300966: Retune SHA2 code for improved performance on CPUs with more ILP...
avg [Mon, 27 Feb 2017 13:05:17 +0000 (13:05 +0000)]
MFC r300966: Retune SHA2 code for improved performance on CPUs with more ILP...

git-svn-id: svn://svn.freebsd.org/base/stable/10@314335 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r300903: Implement SHA-512 truncated (224 and 256 bits)
avg [Mon, 27 Feb 2017 10:40:39 +0000 (10:40 +0000)]
MFC r300903: Implement SHA-512 truncated (224 and 256 bits)

git-svn-id: svn://svn.freebsd.org/base/stable/10@314332 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agofix up r314327 (MFC of r292782): sha2 -> sha512 in sys/modules/random
avg [Mon, 27 Feb 2017 10:22:16 +0000 (10:22 +0000)]
fix up r314327 (MFC of r292782): sha2 -> sha512 in sys/modules/random

git-svn-id: svn://svn.freebsd.org/base/stable/10@314331 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r285417: Add new include path for sha256.h
avg [Mon, 27 Feb 2017 10:10:45 +0000 (10:10 +0000)]
MFC r285417: Add new include path for sha256.h

git-svn-id: svn://svn.freebsd.org/base/stable/10@314330 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r292782: Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c
avg [Mon, 27 Feb 2017 08:27:38 +0000 (08:27 +0000)]
MFC r292782: Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c

cperciva's libmd implementation is 5-30% faster
The same was done for SHA256 previously in r263218

Approved by: secteam

git-svn-id: svn://svn.freebsd.org/base/stable/10@314327 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312644, r312650
bapt [Sat, 25 Feb 2017 19:28:49 +0000 (19:28 +0000)]
MFC r312644, r312650

r312644:
Readd a feature lost in pw(8) refactoring

pw usermod foo -m

It used to be able to (re)create the home directory if it didn't exists

r312650:
Really restore the old behaviour for pw usermod -m

It again reinstall missing skel files without overwriting changed one
Add a regression test about it

PR: 216224
Reported by: ae

git-svn-id: svn://svn.freebsd.org/base/stable/10@314277 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312787:
cy [Sat, 25 Feb 2017 08:07:28 +0000 (08:07 +0000)]
MFC r312787:

Currently the fragment info is placed at the top of the linked list
under a shared read lock. This patch attempts to upgrade the lock to
an exclusive write lock. If the exclusive write lock fails to be
obtained, the current fragment is not placed at the head of the list.

This portion of the patch was inspired by NetBSD ip_frag.c r1.4 (which
effectively removed the section of code that performed the reordering).

The patch to sys/contrib/ipfilter/netinet/ip_compat.h adds the
MUTEX_TRY_UPGRADE macro to support the patch to ip_frag.c.

The patch to contrib/ipfilter/lib/rwlock_emul.c supports this patch
by emulating the mutex in userspace when exercised by ipftest(1).

Inspired by: NetBSD ip_frag.c r1.4

git-svn-id: svn://svn.freebsd.org/base/stable/10@314251 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313910: Change XCOPY memory allocations.
mav [Sat, 25 Feb 2017 01:53:45 +0000 (01:53 +0000)]
MFC r313910: Change XCOPY memory allocations.

Before this change XCOPY code could allocate memory in chunks up to 16-32MB
(VMware does XCOPY in 4MB chunks by default), that could be difficult for
VM subsystem to do due to KVA fragmentation, that sometimes created huge
allocation delays, blocking any I/O for respective LU for that time.

This change limits allocations down to TPC_MAX_IO_SIZE, which is 1MB now.
1MB is also not a cookie, but ZFS also can do that for large blocks, so
it should be less dramatic.  As drawback this increases CPU overhead, but
it still look acceptable comparing to time consumed by ZFS read/write.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314238 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313924,r313925:
ngie [Sat, 25 Feb 2017 00:42:44 +0000 (00:42 +0000)]
MFC r313924,r313925:

r313924:

Quote path to doxygen/kyua in test(1) -x check

This is a basic stopgap against ${LOCALBASE} containing spaces in it

r313925:

Include ${LOCALBASE}/bin in $PATH when running "make checkworld"

Some of the tests in devel/atf // devel/kyua rely on the tools being in $PATH,
which means that the tests fail when run via "make checkworld" because $PATH
is restricted to exclude directory elements like "${LOCALBASE}/bin".

git-svn-id: svn://svn.freebsd.org/base/stable/10@314236 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313897:
pfg [Fri, 24 Feb 2017 21:38:41 +0000 (21:38 +0000)]
MFC r313897:
ext2fs: Remove unused assignment.

The value is re-assigned a few lines later without being read.

Found by: Clang static analyzer

git-svn-id: svn://svn.freebsd.org/base/stable/10@314227 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313554:
pfg [Fri, 24 Feb 2017 21:22:13 +0000 (21:22 +0000)]
MFC r313554:
Clean redundant MIN/MAX declarations in some HighPoint drivers.

The hpt27xx(4), hptnr(4), and hptrr(4) drivers declare MIN() and MAX()
internally which match the macros from sys/param.h.

MIN() is not used, MAX is only used once and can be replaced with the
max() version in libkern.h which operates on u_ints.

MFC after: 2 weeks

git-svn-id: svn://svn.freebsd.org/base/stable/10@314224 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313893
ken [Fri, 24 Feb 2017 20:51:39 +0000 (20:51 +0000)]
MFC r313893

  ------------------------------------------------------------------------
  r313893 | ken | 2017-02-17 13:04:22 -0700 (Fri, 17 Feb 2017) | 48 lines

  Add task attribute support to camcontrol(8).

  Users can use the new generic argument, -Q task_attr, to specify a task
  attribute (simple, ordered, head of queue, aca) for the commands issued.
  The the default is simple, which works with all SCSI devices that support
  tagged queueing.

  This will mostly be useful for debugging target behavior in certain
  situations.

  You can try it out by compiling CTL with CTL_IO_DELAY turned on (in
  sys/cam/ctl/ctl_io.h) and then do something like this with one of the CTL
  LUNs:

  ctladm delay 0:0 -l done -t 10
  camcontrol tur da34 -v

  And at then before the 10 second timer is up, in another terminal:

  camcontrol inquiry da34 -Q ordered -v

  The Inquiry should complete just after the TUR completes.  Ordinarily
  it would complete first because of the delay injection, but because the
  task attribute is set to ordered in this case, CTL holds it up until the
  previous command has completed.

  sbin/camcontrol/camcontrol.c:
   Add the new generic argument, -Q, which allows the user to specify
   a SCSI task attribute.  The user can specify task attributes by
   name or numerically.

   Add a new task_attr arguments to SCSI sub-functions.

  sbin/camcontrol/attrib.c,
  sbin/camcontrol/camcontrol.h,
  sbin/camcontrol/fwdownload.c,
  sbin/camcontrol/modeedit.c,
  sbin/camcontrol/persist.c,
  sbin/camcontrol/timestamp.c,
  sbin/camcontrol/zone.c:
   Add the new task_attr argument to SCSI sub-functions.

  sbin/camcontrol/camcontrol.8:
   Document the new -Q option, and add an example.

  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------

git-svn-id: svn://svn.freebsd.org/base/stable/10@314221 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313496:
kib [Fri, 24 Feb 2017 11:34:00 +0000 (11:34 +0000)]
MFC r313496:
Increase a chance of devfs_close() calling d_close cdevsw method.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314202 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313800:
kib [Fri, 24 Feb 2017 11:30:28 +0000 (11:30 +0000)]
MFC r313800:
Do not access memory past the buffer end.
Do not accept and silently truncate too long hostname.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314201 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313494:
kib [Fri, 24 Feb 2017 11:07:49 +0000 (11:07 +0000)]
MFC r313494:
Handle protected symbols in rtld.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314199 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313493:
kib [Fri, 24 Feb 2017 09:30:51 +0000 (09:30 +0000)]
MFC r313493:
Define ELF_ST_VISIBILITY().

git-svn-id: svn://svn.freebsd.org/base/stable/10@314197 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r282774: Unbreak MIPS build following r282726 (MFCed in r314144)
avg [Thu, 23 Feb 2017 22:10:37 +0000 (22:10 +0000)]
MFC r282774: Unbreak MIPS build following r282726 (MFCed in r314144)

git-svn-id: svn://svn.freebsd.org/base/stable/10@314184 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agofixup r314143, MFC of r285366 didn't remove files that it should have
avg [Thu, 23 Feb 2017 21:54:16 +0000 (21:54 +0000)]
fixup r314143, MFC of r285366 didn't remove files that it should have

git-svn-id: svn://svn.freebsd.org/base/stable/10@314182 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r282736: Unbreak build following rev. 282726 (MFC-ed as r314144)
avg [Thu, 23 Feb 2017 18:54:33 +0000 (18:54 +0000)]
MFC r282736: Unbreak build following rev. 282726 (MFC-ed as r314144)

git-svn-id: svn://svn.freebsd.org/base/stable/10@314157 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r263219: add sha256c.c to the various modules that included sha2.c...
avg [Thu, 23 Feb 2017 16:15:42 +0000 (16:15 +0000)]
MFC r263219: add sha256c.c to the various modules that included sha2.c...

git-svn-id: svn://svn.freebsd.org/base/stable/10@314146 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r282726: Ensure libmd symbols do not clash with libcrypto
avg [Thu, 23 Feb 2017 16:07:45 +0000 (16:07 +0000)]
MFC r282726: Ensure libmd symbols do not clash with libcrypto

Add a prefix to all symbols in libmd to avoid incompatibilites
with same-named, but not binary compatible, symbols from libcrypto.

Also introduce Weak aliases to avoid the need to rebuild dependent
binaries and a major version bump.

PR: 199119

git-svn-id: svn://svn.freebsd.org/base/stable/10@314144 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r263215,r263218,r285366: replace the kernel sha256 code
avg [Thu, 23 Feb 2017 16:05:11 +0000 (16:05 +0000)]
MFC r263215,r263218,r285366: replace the kernel sha256 code

r263215 copy these files from lib/libmd in preperation for moving these
files into the kernel...

r263218 replace the kernel's version w/ cperciva's implementation...

r285366 Complete the move that was started w/ r263218..

Note that the last change is out of order with r282726 that I am going
to merge as well.

Many thanks to cperciva for the more efficient code and to jmg for
integrating it into the kernel.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314143 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312689, r312690
dexuan [Thu, 23 Feb 2017 07:07:21 +0000 (07:07 +0000)]
MFC r312689, r312690

Approved by: sephe (mentor)

r312689
    hyperv/hn: add a sysctl name for the VF interface

    This makes it easier for the userland script to find the releated
    VF interface.

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D9101

r312690
    hyperv/hn: add devctl_notify for VF_UP/DOWN events

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D9102

git-svn-id: svn://svn.freebsd.org/base/stable/10@314124 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r312688
dexuan [Thu, 23 Feb 2017 07:04:17 +0000 (07:04 +0000)]
MFC: r312688

Approved by: sephe (mentor)

r312688
    hyperv/hn: add the support for VF drivers (SR-IOV)

    Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and
    a VF NIC to work together (both NICs have the same MAC address), mainly to
    support seamless live migration.

    When the VF device becomes UP (or DOWN), the synthetic NIC driver needs
    to switch the data path from the synthetic NIC to the VF (or the opposite).

    Note: multicast/broadcast packets are still received through the synthetic
    NIC and we need to inject the packets through the VF interface (if the VF is
    UP), even if the synthetic NIC is DOWN (so we need to force the rxfilter
    to be NDIS_PACKET_TYPE_PROMISCUOUS, when the VF is UP).

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D8964

git-svn-id: svn://svn.freebsd.org/base/stable/10@314123 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r312687, r312916
dexuan [Thu, 23 Feb 2017 06:57:18 +0000 (06:57 +0000)]
MFC: r312687, r312916

Approved by: sephe (mentor)

r312687
    ifnet: introduce event handlers for ifup/ifdown events

    Hyper-V's NIC SR-IOV implementation needs a Hyper-V synthetic NIC and
    a VF NIC to work together, mainly to support seamless live migration.

    When the VF device becomes UP (or DOWN), the synthetic NIC driver needs
    to switch the data path from the synthetic NIC to the VF (or the opposite).

    So the synthetic NIC driver needs to know when a VF device is becoming
    UP or DOWN and hence the patch is made.

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D8963

r312916
    ifnet: move the new ifnet_event EVENTHANDLER_DECLARE to net/if_var.h

    Thank glebius for pointing this out:
    "The network stuff shall not be added to sys/eventhandler.h"

    Reviewed by: David_A_Bright_DELL.com, sephe, glebius
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D9345

git-svn-id: svn://svn.freebsd.org/base/stable/10@314122 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r312685, r312686
dexuan [Thu, 23 Feb 2017 06:49:46 +0000 (06:49 +0000)]
MFC: r312685, r312686

Approved by: sephe (mentor)

r312685
    hyperv/hn: remember the channel pointer in struct hn_rx_ring

    This will be used by the coming NIC SR-IOV patch.

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D8909

r312686
    hyperv/hn: remove the MTU and IFF_DRV_RUNNING checking in hn_rxpkt()

    It's unnecessary because the upper nework stack does the same checking.

    In the case of Hyper-V SR-IOV, we need to remove the checking because
    1) multicast/broadcast packets are still received through the synthetic
    NIC and we need to inject the packets through the VF interface;
    2) we must inject the packets even if the synthetic NIC is down, or has
    a different MTU from the VF device.

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D8962

git-svn-id: svn://svn.freebsd.org/base/stable/10@314121 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC: r311979
marius [Wed, 22 Feb 2017 17:57:24 +0000 (17:57 +0000)]
MFC: r311979

Reset the EIAC register to include the LINK status bit and restore
link up/down notifications.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314103 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313735: add svcpool_close to handle killed nfsd threads
avg [Tue, 21 Feb 2017 09:29:46 +0000 (09:29 +0000)]
MFC r313735: add svcpool_close to handle killed nfsd threads

PR: 204340
Reported by: Panzura
Reviewed by: rmacklem
Approved by: rmacklem

git-svn-id: svn://svn.freebsd.org/base/stable/10@314034 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313687: remove l2_padding_needed statistic from zfs arc
avg [Tue, 21 Feb 2017 09:13:38 +0000 (09:13 +0000)]
MFC r313687: remove l2_padding_needed statistic from zfs arc

git-svn-id: svn://svn.freebsd.org/base/stable/10@314032 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313686: check remaining space in zfs implementations of vptocnp
avg [Tue, 21 Feb 2017 08:57:27 +0000 (08:57 +0000)]
MFC r313686: check remaining space in zfs implementations of vptocnp

PR: 216939

git-svn-id: svn://svn.freebsd.org/base/stable/10@314029 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoRevert r314020
ngie [Tue, 21 Feb 2017 07:02:51 +0000 (07:02 +0000)]
Revert r314020

The test build I ran unfortunately didn't catch the fact that the sha384.h
compat header is missing on ^/stable/10 due to some code not being MFCed

git-svn-id: svn://svn.freebsd.org/base/stable/10@314028 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313736: Fix panic on shutdown of ramdisk LU with zero capacity.
mav [Tue, 21 Feb 2017 05:13:16 +0000 (05:13 +0000)]
MFC r313736: Fix panic on shutdown of ramdisk LU with zero capacity.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314026 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312213,r313713:
ngie [Tue, 21 Feb 2017 03:50:57 +0000 (03:50 +0000)]
MFC r312213,r313713:

r312213:

Turn COMPILER_VERSION/COMPILER_TYPE make check into a compile-time check
of the clang version

This works around breakage on ^/stable/10 when running installworld from
a ^/stable/10 host where the test wouldn't be compiled on the first
go-around and would be missing when make installworld is run.

PR: 208703

r313713:

Handle clang 4.x+ with the compile-time exception added in r312213

It also fails the assertions noted in bug 208703

PR: 208703
PR: 217084

git-svn-id: svn://svn.freebsd.org/base/stable/10@314023 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313404:
ngie [Tue, 21 Feb 2017 03:46:37 +0000 (03:46 +0000)]
MFC r313404:

Improve libnetbsd compatibility with NetBSD

This change is being made to diff reduce/reduce duplication in
contrib/netbsd-tests and to facilitate further porting of software from
NetBSD

Add the following headers:
- sys/event.h:
-- sys/types.h is required for kqueue on FreeBSD, but not NetBSD.
- sys/types.h:
-- NBBY is defined in sys/param.h on FreeBSD, not sys/types.h like on NetBSD.
   Pull in sys/param.h to have parity with NetBSD.
- sys/wait.h:
-- Define wrusage as __wrusage for parity with NetBSD typedef.
- glob.h
-- Define __gl_stat_t as "struct stat" for parity with NetBSD typedef.
- pthread.h:
-- Pull in pthread_np.h for _np functions defined separately on FreeBSD.

Improve compatibility with NetBSD in the following headers:

- sha1.h:
-- define SHA1_CTX as SHA_CTX
-- define SHA1Final as SHA1_Final
- sha2.h:
-- #include sha384 to pick up all of the SHA 384 bit macros and definitions.
- util.h:
-- Add sys/types.h to util.h to pollute the header for types used in
   flags_to_string and string_to_flags (u_long) as NetBSD doesn't require them
   for the functions.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314020 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 312250
sephe [Tue, 21 Feb 2017 03:27:59 +0000 (03:27 +0000)]
MFC 312250

    alc: Add Killer E2500 support

    Reviewed by:    jhb, yongari
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D9058

git-svn-id: svn://svn.freebsd.org/base/stable/10@314019 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 311743
sephe [Tue, 21 Feb 2017 03:14:05 +0000 (03:14 +0000)]
MFC 311743

    hyperv: Add method to read 64bit Hyper-V specific time value.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D9057

git-svn-id: svn://svn.freebsd.org/base/stable/10@314018 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 311475
sephe [Tue, 21 Feb 2017 03:00:33 +0000 (03:00 +0000)]
MFC 311475

    if: Defer the if_up until the ifnet.if_ioctl is called.

    This ensures the interface is initialized by the interface driver
    before it can be used by the rest of the system.

    Reviewed by:    jhb, karels, gnn
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8905

git-svn-id: svn://svn.freebsd.org/base/stable/10@314017 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313652:
ngie [Tue, 21 Feb 2017 02:38:14 +0000 (02:38 +0000)]
MFC r313652:

Use SRCTOP instead of .CURDIR relative paths with ".."

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@314016 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313654:
ngie [Tue, 21 Feb 2017 02:34:59 +0000 (02:34 +0000)]
MFC r313654:

Use SRCTOP to refer to awk source in contrib/awk and remove unnecessary AWKSRC prefix
for maketab.c

The former simplifies pathing in make/displayed output, whereas the latter was just
unnecessarily superfluous since .PATH referenced the path to maketab.c earlier on in
the Makefile.

git-svn-id: svn://svn.freebsd.org/base/stable/10@314014 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313679:
ngie [Tue, 21 Feb 2017 02:33:41 +0000 (02:33 +0000)]
MFC r313679:

Use SRCTOP/OBJTOP relative paths where possible; use :H manipulation in lieu
of ../ elsewhere

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@314013 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313653:
ngie [Tue, 21 Feb 2017 02:24:31 +0000 (02:24 +0000)]
MFC r313653:

Use SRCTOP instead of .CURDIR relative paths with ".."

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@314008 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313656:
ngie [Tue, 21 Feb 2017 02:23:27 +0000 (02:23 +0000)]
MFC r313656:

Use SRCTOP to define .include with usr.bin/Makefile.inc

git-svn-id: svn://svn.freebsd.org/base/stable/10@314006 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312520:
ngie [Tue, 21 Feb 2017 02:18:45 +0000 (02:18 +0000)]
MFC r312520:

Integrate contrib/netbsd-tests/usr.bin/sed/t_sed.sh into the FreeBSD test
suite as usr.bin/sed/sed_test

Don't expect :emptybackref to fail -- it succeeds on FreeBSD

Expect :preserve_leading_ws_ia to fail -- it fails on ^/stable/10, but not on
^/stable/11 or ^/head

git-svn-id: svn://svn.freebsd.org/base/stable/10@314004 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 313895:
ken [Mon, 20 Feb 2017 20:16:11 +0000 (20:16 +0000)]
MFC 313895:

  ------------------------------------------------------------------------
  r313895 | ken | 2017-02-17 13:15:27 -0700 (Fri, 17 Feb 2017) | 9 lines

  Make ctl(4) build with CTL_IO_DELAY defined.

  sys/cam/ctl/ctl.c:
   In ctl_datamove(), inside CTL_IO_DELAY, add a lun variable and fill
   it in before trying to dereference it.

  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------

git-svn-id: svn://svn.freebsd.org/base/stable/10@313998 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313693:
kib [Mon, 20 Feb 2017 10:51:46 +0000 (10:51 +0000)]
MFC r313693:
Remove MPSAFE and ARGUSED annotations, ANSI-fy syscall handlers.

git-svn-id: svn://svn.freebsd.org/base/stable/10@313991 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313819:
pfg [Sun, 19 Feb 2017 21:10:34 +0000 (21:10 +0000)]
MFC r313819:
Remove outdated claim.

Despite wishful thinking the removal of these old functions hasn't
happened yet.

git-svn-id: svn://svn.freebsd.org/base/stable/10@313971 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313797:
kib [Sun, 19 Feb 2017 03:17:11 +0000 (03:17 +0000)]
MFC r313797:
Minor style fixes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@313932 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoFix incomplete merge in r313927:
mm [Sat, 18 Feb 2017 22:13:28 +0000 (22:13 +0000)]
Fix incomplete merge in r313927:

MFC r313572:
  Vendor bugfixes:
    cpio reader sanity fix (OSS-Fuzz 504)
    WARC reader sanity fixes (OSS-Fuzz 511, 526, 532, 552)
    mtree reader time parsing fix (OSS-Fuzz 538)
    XAR reader memleak fix (OSS-Fuzz 551)

git-svn-id: svn://svn.freebsd.org/base/stable/10@313929 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313572,313782
mm [Sat, 18 Feb 2017 21:59:19 +0000 (21:59 +0000)]
MFC r313572,313782
Sync libarchive with vendor.

MFC r313572:
  Vendor bugfixes:
    cpio reader sanity fix (OSS-Fuzz 504)
    WARC reader sanity fixes (OSS-Fuzz 511, 526, 532, 552)
    mtree reader time parsing fix (OSS-Fuzz 538)
    XAR reader memleak fix (OSS-Fuzz 551)

MFC r313782:
  Vendor changes:
    Make SCHILY.acl.ace header more compact (NFSv4 ACLs)

  Vendor bugfixes:
    zip reader integer parsing fix (OSS-Fuzz 556)
    spelling fixes (issue #863)

git-svn-id: svn://svn.freebsd.org/base/stable/10@313927 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoPull in r242377 from upstream libc++ trunk (by Marshall Clow):
dim [Sat, 18 Feb 2017 14:44:14 +0000 (14:44 +0000)]
Pull in r242377 from upstream libc++ trunk (by Marshall Clow):

  Make sure that __libcpp_compressed_pair_imp default-constructs its'
  members, rather than value-initializing them. Fixes PR#24137

This ensures std::make_shared<>'s default constructor properly
initializes to zero.

Direct commit to stable/9 and stable/10, since stable/11 and head
already have a newer version of libc++, including this fix.

Reported by: martin.beran@kernun.cz
PR: 217200

git-svn-id: svn://svn.freebsd.org/base/stable/10@313916 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313563: kldxref: bump MAXSEGS to 3
emaste [Fri, 17 Feb 2017 00:49:01 +0000 (00:49 +0000)]
MFC r313563: kldxref: bump MAXSEGS to 3

ld.bfd generates two PT_LOAD segments, but certain linkers or linker
configurations generate three PT_LOAD segments (one additional for
RELRO).

PR: 216975

git-svn-id: svn://svn.freebsd.org/base/stable/10@313848 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313562: kldxref: s/sections/segments/ in warning message
emaste [Fri, 17 Feb 2017 00:47:43 +0000 (00:47 +0000)]
MFC r313562: kldxref: s/sections/segments/ in warning message

The message refers to program header segments, not sections.

PR: 216975

git-svn-id: svn://svn.freebsd.org/base/stable/10@313847 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313715:
kib [Fri, 17 Feb 2017 00:38:32 +0000 (00:38 +0000)]
MFC r313715:
Order alphabetically.

git-svn-id: svn://svn.freebsd.org/base/stable/10@313844 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311702
grehan [Thu, 16 Feb 2017 17:08:43 +0000 (17:08 +0000)]
MFC r311702
  Use correct PCI device id for virtio-rng.
  This prevented the device from attaching with a
  Windows guest (most other guests use the device type
  for matching)

  PR:   212711

git-svn-id: svn://svn.freebsd.org/base/stable/10@313812 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313477:
garga [Thu, 16 Feb 2017 09:19:29 +0000 (09:19 +0000)]
MFC r313477:

Cleanup on usr.sbin/arp/arp.c

* 'blackhole' and 'reject' are mutually exclusive, replace printf() by errx()
  when both are selected.
* 'trail' option is no longer supported since first import of arp from 4.4BSD.
  XXX message was added 13 years ago in r128192. I believe it's time to remove
  it.
* Use warnx() to print some informative messages instead of printf()
* Replace strncmp() by strcmp() when validating parameters and exit when invalid
  parameter is found

Reviewed by: allanjude, vangyzen, cem
Approved by: allanjude
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D9504

git-svn-id: svn://svn.freebsd.org/base/stable/10@313803 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311285,312335: zlib 1.2.11.
delphij [Thu, 16 Feb 2017 06:16:50 +0000 (06:16 +0000)]
MFC r311285,312335: zlib 1.2.11.

git-svn-id: svn://svn.freebsd.org/base/stable/10@313796 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313692:
kib [Thu, 16 Feb 2017 06:00:57 +0000 (06:00 +0000)]
MFC r313692:
Style: wrap long line.

git-svn-id: svn://svn.freebsd.org/base/stable/10@313794 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoFix mismerge in r313790
ngie [Thu, 16 Feb 2017 05:22:08 +0000 (05:22 +0000)]
Fix mismerge in r313790

Use ${.TARGET}, not Kyuafile.auto* for the fmake case

This is a direct commit to ^/stable/10

Sponsored by: Dell EMC Isilon

git-svn-id: svn://svn.freebsd.org/base/stable/10@313792 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r295643:
ngie [Thu, 16 Feb 2017 05:17:40 +0000 (05:17 +0000)]
MFC r295643:

r295643 (by bdrewery):

Test directories can build in parallel fine.

git-svn-id: svn://svn.freebsd.org/base/stable/10@313791 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r285119,r292502,r295380:
ngie [Thu, 16 Feb 2017 05:14:07 +0000 (05:14 +0000)]
MFC r285119,r292502,r295380:

r285119 (by jmmv):

Add support for TEST_METADATA

Allow Makefiles to define generic metadata settings that apply to all test
programs defined by a Makefile.  The generic TEST_METADATA variable extends
the per-test program settings already supported via TEST_METADATA.<program>.

This feature will be useful to easily apply some settings to all programs
in a directory.  In particular, Kyua 0.12 will support parallel execution
of test programs and a bunch of them will need to be tagged as is_exclusive
to indicate that they cannot be run in parallel with anything else due to
their side-effects.  It will be reasonable to set this setting on whole
directories.

r292502:

Always expose LOCALBASE, not just when CROSS_TOOLCHAIN is defined

Instead of using which(1) to look for doxygen, look for it in <LOCALBASE>/bin .
$PATH gets mangled by make buildenv, etc so it's better to just be explicit
about the path if someone uses that for instance.

r295380:

Simplify running the FreeBSD test suite

Replace `make regress` (legacy test make target) and `make test` (incomplete
test make target added with the FreeBSD test suite) with make check as it's
consistent with other open source projects.

`make check` defaults to running tests from `.OBJDIR`, but can be overridden
with the `CHECKDIR` variable.

Add `make checkworld` target to simplify running the FreeBSD test suite from
`TESTSBASE` (i.e. the top-level tests directory), similar to buildworld.

Document `make check` and `make checkworld` in build(7).

Other minor changes:

- Rename intermediate file (`Kyuafile.auto`) to `Kyuafile` to simplify
  `make check`.
- Remove terse warnings attached to `beforetest`/`aftertest`.
- Add kyua binary check to check target in suite.test.mk; error out if it's
  not found

The MFC is [partly] contingent on other build related changes being MFCed.

X-MFC to: stable/10
Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@313790 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r288241:
ngie [Thu, 16 Feb 2017 04:23:45 +0000 (04:23 +0000)]
MFC r288241:

r288241 (by bdrewery):

Remove 'set -e' that are no longer needed as it is already default.

When bmake was initially imported at r241298 shell commands were no longer
ran with 'set -e' as they were before.  This was fixed in r254980 so they
again always use 'set -e'.

git-svn-id: svn://svn.freebsd.org/base/stable/10@313789 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313457:
garga [Wed, 15 Feb 2017 09:18:08 +0000 (09:18 +0000)]
MFC r313457:

Fix style(9)

Reviewed by: vangyzen, allanjude, cem
Approved by: allanjude
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D9494

git-svn-id: svn://svn.freebsd.org/base/stable/10@313765 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313448:
garga [Wed, 15 Feb 2017 09:15:51 +0000 (09:15 +0000)]
MFC r313448:

bsdinstall: Make sure chroot filesystems are umounted after use

* DISTDIR_IS_UNIONFS is set every time BSDINSTALL_DISTDIR is mounted inside
  BSDINSTALL_CHROOT. Use this flag to decide if it needs to be umounted
* BSDINSTALL_CHROOT/dev is mounted when 'bsdinstall mount' is called, there is
  no need to mount it again when user goes to shell after installation

Reviewed by: allanjude
Obtained from: pfSense
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D8573

git-svn-id: svn://svn.freebsd.org/base/stable/10@313764 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311893, r313008, r313081
asomers [Wed, 15 Feb 2017 00:16:52 +0000 (00:16 +0000)]
MFC r311893, r313008, r313081

I had to modify the tests slightly for the MFC to stable/10, because
stable/10 lacks r294037, which enabled /sbin/md5 to work on md(4)
devices.

r311893:
ATFify the geom gate tests.

This ensures their cleanup routines will be run even if they should timeout.

tests/sys/geom/class/gate/ggate_test.sh
tests/sys/geom/class/gate/Makefile
Add an ATF test with three testcases, one for each TAP test. Use
ATF-style cleanup functions, and convert sleeps to polling loops.

ObsoleteFiles.inc
tests/sys/geom/class/gate/conf.sh
tests/sys/geom/class/gate/1_test.sh
tests/sys/geom/class/gate/2_test.sh
tests/sys/geom/class/gate/3_test.sh
Delete TAP test files

Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8891

r313008:
Wait for /dev/ggate* to appear after calling `ggatel create` in :ggatel_{file,md}

The test assumed that `ggatel create` created a device on completion, but that's
incorrect. This squashes the race by waiting for the device to appear, as
`ggatel create` daemonizes before issuing an ioctl to geom_gate(4) if not called
with `-v`.

Discussed with: asomers
MFC after: 1 week
PR: 204616
Sponsored by: Dell EMC Isilon

r313081:
Replace for/retry loops with "wait_for_ggate_device" calls and check
results of commands

As noted in r313008, the underlying issue was that geom_gate device
creation wasn't created at ggatel command completion, but some short
time after. ggatec(8) employs similar logic when creating geom_gate(4)
devices.

Switch from retry loops (after the ggatec/dd write calls) to
wait_for_ggate_device function calls after calling ggatec(8) instead
to detect the presence of the /dev/ggate* device, as this function is
sufficient for determining whether or not the character device is ready
for testing

While here, use atf_check consistently with all dd calls to ensure that
data output is as expected.

MFC after: 1 week
Reviewed by: asomers
Differential Revision: D9409
Sponsored by: Dell EMC Isilon

git-svn-id: svn://svn.freebsd.org/base/stable/10@313754 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311349, r311445
asomers [Tue, 14 Feb 2017 21:02:27 +0000 (21:02 +0000)]
MFC r311349, r311445

r311349:
tabs -> spaces in etc/mtree

MFC after: 4 weeks

r311445:
Fix typo from r311349

Reported by: lwhsu
Pointy-hat-to: asomers
MFC after: 4 weeks
X-MFC-with: 311349

git-svn-id: svn://svn.freebsd.org/base/stable/10@313743 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312991: put very expensive sanity checks of advisory locks under DIAGNOSTIC
avg [Tue, 14 Feb 2017 13:45:38 +0000 (13:45 +0000)]
MFC r312991: put very expensive sanity checks of advisory locks under DIAGNOSTIC

Sponsored by: Panzura

git-svn-id: svn://svn.freebsd.org/base/stable/10@313729 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313356:
ngie [Tue, 14 Feb 2017 04:52:24 +0000 (04:52 +0000)]
MFC r313356:

Fix typos in comments (returing -> returning)

git-svn-id: svn://svn.freebsd.org/base/stable/10@313726 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313378,r313379:
ngie [Tue, 14 Feb 2017 04:49:24 +0000 (04:49 +0000)]
MFC r313378,r313379:

r313378:

Wrap strcmp/wcscmp calls with ATF_CHECK_MSG and drop atf_tc_fail use

The reasoning here was the same as what was done in r313376:
- Gather as many results as possible instead of failing early and
  not testing the rest of the cases.
- Simplify logic when checking test inputs vs outputs and printing
  test result.

r313379:

Expect :int_within_limits to fail when ptrdiff_t/*intmax_t differ in base type

The %t{d,u} (ptrdiff_t) tests fail for the following reasons:
- ptrdiff_t is by definition int32_t on !LP64 architectures and int64_t on
  LP64 architectures.
- intmax_t is by definition fixed to int64_t on all architectures.
- Some of the code in lib/libc/stdio/... is promoting ptrdiff_t to *intmax_t
  when parsing/representing the value.

PR: 191674

git-svn-id: svn://svn.freebsd.org/base/stable/10@313723 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313376:
ngie [Tue, 14 Feb 2017 04:46:19 +0000 (04:46 +0000)]
MFC r313376:

Fix :hexadecimal_floating_point on i386

Don't exclude i386 from LDBL_MANT_DIG == 64; it works properly in
that case.

While here, replace strcmp + atf_tc_fail with ATF_CHECK_MSG for 2
reasons:
- Gather as many results as possible instead of failing early and
  not testing the rest of the cases.
- Simplify logic when checking test inputs vs outputs and printing
  test result.

Tested on: amd64, i386

git-svn-id: svn://svn.freebsd.org/base/stable/10@313720 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313377:
ngie [Tue, 14 Feb 2017 04:42:47 +0000 (04:42 +0000)]
MFC r313377:

Expect :floatunditf to fail on FreeBSD/i386

The precision error on FreeBSD/i386 doesn't match the expected output in
long double form.

git-svn-id: svn://svn.freebsd.org/base/stable/10@313718 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313358,r313360:
ngie [Tue, 14 Feb 2017 04:38:37 +0000 (04:38 +0000)]
MFC r313358,r313360:

r313358:

Sort sys/ #includes and zap an unnecessary trailing space nearby

r313360:

Sort sys/ #includes some more

git-svn-id: svn://svn.freebsd.org/base/stable/10@313716 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313568:
ken [Mon, 13 Feb 2017 16:11:37 +0000 (16:11 +0000)]
MFC r313568:

  ------------------------------------------------------------------------
  r313568 | ken | 2017-02-10 15:02:45 -0700 (Fri, 10 Feb 2017) | 68 lines

  Change the isp(4) driver to not adjust the tag type for REQUEST SENSE.

  The isp(4) driver was changing the tag type for REQUEST SENSE
  commands to Head of Queue, when the CAM CCB flag
  CAM_TAG_ACTION_VALID was NOT set.  CAM_TAG_ACTION_VALID is set
  when the tag action in the XPT_SCSI_IO is not CAM_TAG_ACTION_NONE
  and when the target has tagged queueing turned on.

  In most cases when CAM_TAG_ACTION_VALID is not set, it is because
  the target is not doing tagged queueing.  In those cases, trying to
  send a Head of Queue tag may cause problems.  Instead, default to
  sending a simple tag.

  IBM tape drives claim to support tagged queueing in their standard
  Inquiry data, but have the DQue bit set in the control mode page
  (mode page 10).  CAM correctly detects that these drives do not
  support tagged queueing, and clears the CAM_TAG_ACTION_VALID flag
  on CCBs sent down to the drives.

  This caused the isp(4) driver to go down the path of setting the
  tag action to a default value, and for Request Sense commands only,
  set the tag action to Head of Queue.

  If an IBM tape drive does get a Head of Queue tag, it rejects it with
  Invalid Message Error (0x49,0x00).  (The Qlogic firmware translates that
  to a Transport Error, which the driver translates to an Unrecoverable
  HBA Error, or CAM_UNREC_HBA_ERROR.) So, by default, it wasn't possible
  to get a good response from a REQUEST SENSE to an FC-attached IBM
  tape drive with the isp(4) driver.

  IBM tape drives (tested on an LTO-5 with G9N1 firmware and a TS1150
  with 4470 firmware) also have a bug in that sending a command with a
  non-simple tag attribute breaks the tape drive's Command Reference
  Number (CRN) accounting and causes it to ignore all subsequent
  commands because it and the initiator disagree about the next
  expected CRN.  The drives do reject the initial command with a head
  of queue tag with an Invalid Message Error (0x49,0x00), but after that
  they ignore any subsequent commands.  IBM confirmed that it is a bug,
  and sent me test firmware that fixes the bug.  However tape drives in
  the field will still exhibit the bug until they are upgraded.

  Request Sense is not often sent to targets because most errors are
  reported automatically through autosense in Fibre Channel and other
  modern transports.  ("Modern" meaning post SCSI-2.)  So this is not
  an error that would crop up frequently.  But Request Sense is useful on
  tape devices to report status information, aside from error reporting.

  This problem is less serious without FC-Tape features turned on,
  specifically precise delivery of commands (which enables Command
  Reference Numbers), enabled on the target and initiator.  Without
  FC-Tape features turned on, the target would return an error and
  things would continue on.

  And it also does not cause problems for targets that do tagged
  queueing, because in those cases the isp(4) driver just uses the
  tag type that is specified in the CCB, assuming the
  CAM_TAG_ACTION_VALID flag is set, and defaults to sending a Simple
  tag action if it isn't an ordered or head of queue tag.

  sys/dev/isp/isp.c:
   In isp_start(), don't try to send Request Sense commands
   with the Head of Queue tag attribute if the CCB doesn't
   have a valid tag action.  The tag action likely isn't valid
   because the target doesn't support tagged queueing.

  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------

git-svn-id: svn://svn.freebsd.org/base/stable/10@313700 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313174: Clean up documentation of AF_UNIX control messages.
jilles [Sun, 12 Feb 2017 18:52:01 +0000 (18:52 +0000)]
MFC r313174: Clean up documentation of AF_UNIX control messages.

Document AF_UNIX control messages in unix(4) only, not split between unix(4)
and recv(2).

Also, warn about LOCAL_CREDS effective uid/gid fields, since the write could
be from a setuid or setgid program (with the explicit SCM_CREDS and
LOCAL_PEERCRED, the credentials are read at such a time that it can be
assumed that the process intends for them to be used in this context).

git-svn-id: svn://svn.freebsd.org/base/stable/10@313685 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r313273:
ngie [Sun, 12 Feb 2017 09:27:34 +0000 (09:27 +0000)]
MFC r313273:

style(9) cleanup

- Delete trailing whitespace
- Fix alignment/variable sorting
- Delete single-line enclosing braces

git-svn-id: svn://svn.freebsd.org/base/stable/10@313682 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoUnbreak lib/csu for i386 and amd64 (MK_LIB32 == yes) after r313582
ngie [Sat, 11 Feb 2017 20:46:49 +0000 (20:46 +0000)]
Unbreak lib/csu for i386 and amd64 (MK_LIB32 == yes) after r313582

I accidentally goofed up the directory for lib/libc in the CFLAGS

This is a direct commit to this branch

Pointyhat to: ngie

git-svn-id: svn://svn.freebsd.org/base/stable/10@313658 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311950 (by bz):
cy [Sat, 11 Feb 2017 18:10:55 +0000 (18:10 +0000)]
MFC r311950 (by bz):

Get rid of a compiler warning which I saw too often.
Include netinet/in.h before ip_compat.t which will then check if
IPPROTO_IPIP is defined or not.  Doing it the other way round,
ip_compat.h would not find it defined and netinet/in.h then
redefine it.

git-svn-id: svn://svn.freebsd.org/base/stable/10@313648 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312102,r312108:
ngie [Sat, 11 Feb 2017 07:35:27 +0000 (07:35 +0000)]
MFC r312102,r312108:

r312102:

Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD

r312108:

Delete trailing whitespace and use __arraycount instead of nitems in contrib code

git-svn-id: svn://svn.freebsd.org/base/stable/10@313632 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312513:
ngie [Sat, 11 Feb 2017 07:14:45 +0000 (07:14 +0000)]
MFC r312513:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@313631 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312514:
ngie [Sat, 11 Feb 2017 07:13:12 +0000 (07:13 +0000)]
MFC r312514:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@313630 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312523:
ngie [Sat, 11 Feb 2017 07:11:43 +0000 (07:11 +0000)]
MFC r312523:

Add some basic -s flag testcases for cut(1)

The remaining functionality seems to be covered in one form or
another via the NetBSD ATF testcase.

git-svn-id: svn://svn.freebsd.org/base/stable/10@313629 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312508:
ngie [Sat, 11 Feb 2017 07:03:54 +0000 (07:03 +0000)]
MFC r312508:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@313628 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312507:
ngie [Sat, 11 Feb 2017 07:03:10 +0000 (07:03 +0000)]
MFC r312507:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@313627 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312506:
ngie [Sat, 11 Feb 2017 07:02:04 +0000 (07:02 +0000)]
MFC r312506:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@313626 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312505:
ngie [Sat, 11 Feb 2017 07:01:17 +0000 (07:01 +0000)]
MFC r312505:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@313625 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312504:
ngie [Sat, 11 Feb 2017 07:00:31 +0000 (07:00 +0000)]
MFC r312504:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@313624 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312502:
ngie [Sat, 11 Feb 2017 06:59:03 +0000 (06:59 +0000)]
MFC r312502:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@313623 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312501:
ngie [Sat, 11 Feb 2017 06:58:24 +0000 (06:58 +0000)]
MFC r312501:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@313622 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312500:
ngie [Sat, 11 Feb 2017 06:57:22 +0000 (06:57 +0000)]
MFC r312500:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@313621 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r312499:
ngie [Sat, 11 Feb 2017 06:56:38 +0000 (06:56 +0000)]
MFC r312499:

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output

git-svn-id: svn://svn.freebsd.org/base/stable/10@313620 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f