]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r311893, r313008, r313081
asomers [Wed, 15 Feb 2017 00:15:24 +0000 (00:15 +0000)]
MFC r311893, r313008, r313081

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

7 years agoMFC r311349, r311445
asomers [Tue, 14 Feb 2017 21:02:17 +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

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

Sponsored by: Panzura

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

Fix typos in comments (returing -> returning)

7 years agoMFC r313374:
ngie [Tue, 14 Feb 2017 04:51:21 +0000 (04:51 +0000)]
MFC r313374:

hcreate(3): fix the ERRORS section and bump .Dd

- Add missing comma between functions that trigger ENOMEM error.
- Fix the description for ESRCH. The action that triggers this error is
  FIND, not SEARCH (SEARCH does not exist).

7 years agoMFC r313378,r313379:
ngie [Tue, 14 Feb 2017 04:49:06 +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

7 years agoMFC r313376:
ngie [Tue, 14 Feb 2017 04:47:13 +0000 (04:47 +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

7 years agoMFC r313377:
ngie [Tue, 14 Feb 2017 04:43:03 +0000 (04:43 +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.

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

r313358:

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

r313360:

Sort sys/ #includes some more

7 years agoMFC r313052:
dim [Mon, 13 Feb 2017 18:39:21 +0000 (18:39 +0000)]
MFC r313052:

Pull in r293536 from upstream compiler-rt trunk:

  Recommit: Stop intercepting some malloc-related functions on FreeBSD
  and macOS

  Summary:
  In https://bugs.freebsd.org/215125 I was notified that some configure
  scripts attempt to test for the Linux-specific `mallinfo` and
  `mallopt` functions by compiling and linking small programs which
  references the functions, and observing whether that results in
  errors.

  FreeBSD and macOS do not have the `mallinfo` and `mallopt` functions,
  so normally these tests would fail, but when sanitizers are enabled,
  they incorrectly succeed, because the sanitizers define interceptors
  for these functions.  This also applies to some other malloc-related
  functions, such as `memalign`, `pvalloc` and `cfree`.

  Fix this by not intercepting `mallinfo`, `mallopt`, `memalign`,
  `pvalloc` and `cfree` for FreeBSD and macOS, in all sanitizers.

  Also delete the non-functional `cfree` wrapper for Windows, to fix the
  test cases on that platform.

  Reviewers: emaste, kcc, rnk

  Subscribers: timurrrr, eugenis, hans, joerg, llvm-commits, kubamracek

  Differential Revision: https://reviews.llvm.org/D27654

This prevents autoconf scripts from incorrectly detecting that functions
like mallinfo, mallopt, memalign, pvalloc and cfree are supported.

PR: 215125, 215455

7 years agoMFC r313568:
ken [Mon, 13 Feb 2017 16:06:38 +0000 (16:06 +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

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

7 years agoMFC r313185:
ae [Mon, 13 Feb 2017 12:07:08 +0000 (12:07 +0000)]
MFC r313185:
  Check that primary GPT header is valid before wiping partitioning.

  This allows safely destroy corrupted GPT when primary header was
  rewritten by some data, that do not want to destroy.

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

style(9) cleanup

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

7 years agoMFC r312008:
ngie [Sun, 12 Feb 2017 09:24:18 +0000 (09:24 +0000)]
MFC r312008:

Upgrade NetBSD tests to 01.11.2017_23.20 snapshot

This contains some new testcases in /usr/tests/...:

- .../lib/libc
- .../lib/libthr
- .../lib/msun
- .../sys/kern

Tested on: amd64, i386

7 years agoMFC r311850:
ian [Sat, 11 Feb 2017 20:02:39 +0000 (20:02 +0000)]
MFC r311850:

  Use the post-reset hook to force the controller to host mode.  This will
  make both usb ports work on imx6 systems (the OTG port of course will only
  work in host mode).

7 years agoMFC r313194:
kib [Sat, 11 Feb 2017 02:00:56 +0000 (02:00 +0000)]
MFC r313194:
Define the vm_ooffset_t and vm_pindex_t types as machine-independend.

7 years agoMFC r310866,310868,310870,311903,313074:
mm [Sat, 11 Feb 2017 00:54:16 +0000 (00:54 +0000)]
MFC r310866,310868,310870,311903,313074:
Sync libarchive with vendor.

MFC r310866:
  PR #771: Add NFSv4 ACL support to pax and restricted pax

  NFSv4 ACL information may now be stored to and restored from tar archives.
  ACL must be non-trivial and supported by the underlying filesystem, e.g.
  natively by ZFS or by UFS with the NFSv4 ACL enable flag set.

MFC r310868:
  PR #843: Fix memory leak of struct archive_entry in cpio/cpio.c
  PR #851: Spelling fixes
  Fix two protoypes in manual page archive_read_disk.3

MFC r310870:
  Use __LA_DEPRECATED macro with functions deprecated in 379867e

MFC r311903:
  #691: Support for SCHILY.xattr extended attributes
  #854: Spelling fixes

  Multiple fixes in ACL code:
  - prefer acl_set_fd_np() to acl_set_fd()
  - if acl_set_fd_np() fails, do no fallback to acl_set_file()
  - do not warn if trying to write ACLs to a filesystem without ACL support
  - fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs

MFC r313074:
  - support extracting NFSv4 ACLs from Solaris tar archives
  - bugfixes and optimizations in the ACL code
  - multiple fixes in the test suite
  - typo and other small bugfixes

  Security fixes:
  - cab reader: endless loop when parsing MSZIP signature (OSS-Fuzz 335)
  - LHA reader: heap-buffer-overflow in lha_read_file_header_1()
    (CVE-2017-5601)
  - LZ4 reader: null-pointer dereference in lz4_filter_read_legacy_stream()
    (OSS-Fuzz 453)
  - mtree reader: heap-buffer-overflow in detect_form() (OSS-Fuzz 421, 443)
  - WARC reader: heap-buffer-overflow in xstrpisotime() (OSS-Fuzz 382, 458)

  Memory leak fixes:
  - ACL support: free memory allocated by acl_get_qualifier()
  - disk writer: missing free in create_filesystem_object()
  - file reader: fd leak (Coverity 1016755)
  - gnutar writer: fix free in archive_write_gnutar_header()
    (Coverity 101675)
  - iso 9660 reader: missing free in parse_file_info()
    (partial Coverity 1016754)
  - program reader: missing free in __archive_read_program()
  - program writer: missing free in __archive_write_program_free()
  - xar reader: missing free in xar_cleanup()
  - xar reader: missing frees in expat_xmlattr_setup()
    (Coverity 1229979-1229981)
  - xar writer: missing free in file_free()
  - zip reader: missing free in zip_read_local_file_header()

List of all libarchive issues at OSS-Fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/list?can=1&q=libarchive

Security: CVE-2017-5601

7 years agoMFC 311568,311584,312387:
jhb [Fri, 10 Feb 2017 19:49:42 +0000 (19:49 +0000)]
MFC 311568,311584,312387:
Set MORETOCOME for AIO write requests on a socket.

311568:
Set MORETOCOME for AIO write requests on a socket.

Add a MSG_MOREOTOCOME message flag.  When this flag is set, sosend*
set PRUS_MOREOTOCOME when invoking the protocol send method.  The aio
worker tasks for sending on a socket set this flag when there are
additional write jobs waiting on the socket buffer.

311584:
Unbreak lib/libsysdecode after r311568 by decoding MSG_MORETOCOME flag
in msgflags

(Actually, this change excludes MSG_MORETOCOME from being decoded)

312387:
Fix regression from r311568: collision of MSG_NOSIGNAL with MSG_MORETOCOME
lead to delayed send of data sent with sendto(MSG_NOSIGNAL).

Sponsored by: Chelsio Communications

7 years agoMFC r313174: Clean up documentation of AF_UNIX control messages.
jilles [Fri, 10 Feb 2017 15:03:54 +0000 (15:03 +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).

7 years agoMFC r308312: vidcontrol: improve error handling in vt(4) font loading
emaste [Fri, 10 Feb 2017 14:58:24 +0000 (14:58 +0000)]
MFC r308312: vidcontrol: improve error handling in vt(4) font loading

PR: 209078

7 years agoMFC r304430: vt: fix old keyboard release in CONS_SETKBD
emaste [Fri, 10 Feb 2017 14:54:20 +0000 (14:54 +0000)]
MFC r304430: vt: fix old keyboard release in CONS_SETKBD

On the first switch we previously released the newly allocated keyboard
instead of the old one. Keyboard state was very confused afterwards for
further keyboard switches.

Submitted by: bde

7 years agoMFC r312520:
ngie [Fri, 10 Feb 2017 07:59:41 +0000 (07:59 +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

7 years agoMFC r312514:
ngie [Fri, 10 Feb 2017 07:58:45 +0000 (07:58 +0000)]
MFC r312514:

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

This simplifies pathing in make/displayed output

7 years agoMFC r312513:
ngie [Fri, 10 Feb 2017 07:57:14 +0000 (07:57 +0000)]
MFC r312513:

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

This simplifies pathing in make/displayed output

7 years agoMFC r312523:
ngie [Fri, 10 Feb 2017 07:55:39 +0000 (07:55 +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.

7 years agoMFC r312418,r312422:
ngie [Fri, 10 Feb 2017 07:38:39 +0000 (07:38 +0000)]
MFC r312418,r312422:

r312418:

Conditionalize hyperv support in gettimeofday(2) based on MK_HYPERV

The effect at runtime is negligible as the hyperv timer isn't available
except when hyperv is loaded.

This is a prerequisite for conditionalizing the header build/install out
of the build

r312422:

Only conditionally add in hyperv support if we're building amd64

This unbreaks the build because the assembly is written for x64.

Pointyhat to: ngie

7 years agoMFC r312452-r312512:
ngie [Fri, 10 Feb 2017 07:32:40 +0000 (07:32 +0000)]
MFC r312452-r312512:

r312452-r312512:

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

  This simplifies pathing in make/displayed output

- Use .CURDIR:H instead of .CURDIR to simplify pathing in output, etc

7 years agoMerge r309649, r313048, r313083, r313104:
glebius [Fri, 10 Feb 2017 07:22:12 +0000 (07:22 +0000)]
Merge r309649, r313048, r313083, r313104:

  tcpdump 4.9.0

7 years agoMFC r306349:
ngie [Fri, 10 Feb 2017 06:31:31 +0000 (06:31 +0000)]
MFC r306349:
r306349 (by pfg):

hash(3): protect in-memory page when using cross-endianness.

When writing out pages in the "other endian" format, make a copy
instead of trashing the in-memory one.

Obtained from: NetBSD (CVS rev. 1.29)

7 years agoMFC r313401
vangyzen [Fri, 10 Feb 2017 05:14:19 +0000 (05:14 +0000)]
MFC r313401

Fix garbage IP addresses in UDP log_in_vain messages

If multiple threads emit a UDP log_in_vain message concurrently,
or indeed call inet_ntoa() for any other reason,
the IP addresses could be garbage due to concurrent usage of a
single string buffer inside inet_ntoa().  Use inet_ntoa_r() with
two stack buffers instead.

Relnotes: yes
Sponsored by: Dell EMC

7 years agoMFC r308430, r309782: libelftc: add elf{32,64}-trad{big,little}mips
emaste [Fri, 10 Feb 2017 02:27:48 +0000 (02:27 +0000)]
MFC r308430, r309782: libelftc: add elf{32,64}-trad{big,little}mips

7 years agoMFC r311946: readelf: add S390 relocation types
emaste [Fri, 10 Feb 2017 01:18:15 +0000 (01:18 +0000)]
MFC r311946: readelf: add S390 relocation types

From https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries.html

7 years agoMFC r313109:
kib [Thu, 9 Feb 2017 04:42:21 +0000 (04:42 +0000)]
MFC r313109:
Use ANSI definitions for some i386 functions.

7 years agoMFC r312791:
cy [Thu, 9 Feb 2017 02:08:42 +0000 (02:08 +0000)]
MFC r312791:

Use normal KNF cuddling of elses.

Reported by: bde

7 years agoMFC r311901:
markj [Thu, 9 Feb 2017 00:28:03 +0000 (00:28 +0000)]
MFC r311901:
Do not set BIO_DONE if the BIO specifies a completion handler.

7 years agoMFC r313180
vangyzen [Wed, 8 Feb 2017 20:08:38 +0000 (20:08 +0000)]
MFC r313180

PCIe HotPlug: remove tests for DL active link capability

As of r313097, the HotPlug code requires the link to support
reporting of the data-link status.  Remove tests for this capability
from code that can now assume its presence.

Sponsored by: Dell EMC

7 years agoRegen after r313450.
jhb [Wed, 8 Feb 2017 18:33:00 +0000 (18:33 +0000)]
Regen after r313450.

7 years agoMFC 310638:
jhb [Wed, 8 Feb 2017 18:32:35 +0000 (18:32 +0000)]
MFC 310638:
Rename the 'flags' argument to getfsstat() to 'mode' and validate it.

This argument is not a bitmask of flags, but only accepts a single value.
Fail with EINVAL if an invalid value is passed to 'flag'.  Rename the
'flags' argument to getmntinfo(3) to 'mode' as well to match.

This is a followup to r308088.

7 years agoMFC r312767: Partially workaround ASMedia HBA error recovery.
mav [Wed, 8 Feb 2017 16:06:19 +0000 (16:06 +0000)]
MFC r312767: Partially workaround ASMedia HBA error recovery.

Taking closer look on my ASM1062 I found that it has bunch of issues around
error recovery: reported wrong CCS, failed commands reported as completed,
READ LOG EXT times out after NCQ error.  This patch workarounds first two
problems, that were making ATAPI devices close to unusable on these HBAs.

7 years agoMFC r312750: Add Timeout and Protect mode page description from MMC-6.
mav [Wed, 8 Feb 2017 16:00:40 +0000 (16:00 +0000)]
MFC r312750: Add Timeout and Protect mode page description from MMC-6.

7 years agoMFC r312777, r312780:
cy [Wed, 8 Feb 2017 13:37:57 +0000 (13:37 +0000)]
MFC r312777, r312780:

Issue an error message when an incorrect flush argument is encountered
(and style fixup).

7 years agoMFC r312392:
ngie [Wed, 8 Feb 2017 08:34:59 +0000 (08:34 +0000)]
MFC r312392:

Use SRCTOP instead of .CURDIR-relative path in .PATH directive

7 years agoMFC 313097: Require Data Layer Active reporting for native PCI-e HotPlug.
jhb [Tue, 7 Feb 2017 22:40:38 +0000 (22:40 +0000)]
MFC 313097: Require Data Layer Active reporting for native PCI-e HotPlug.

Some PCI-e bridges report that they support HotPlug in the slot
capabilities but do not report support for Data Layer Active events
in the link capabilities register.  These bridges do not work correctly
when HotPlug is used.  Further, while the description of HotPlug in
the spec does not mention that DL active events are required, the
description of the link capabilities register says that DL active is
required for HotPlug.  Thanks to Dave Baukus for finding that language
in the spec.

PR: 211699

7 years agoMFC r312544
rstone [Tue, 7 Feb 2017 15:13:19 +0000 (15:13 +0000)]
MFC r312544

  Fix reference to free memory in ixgbe/if_media.c

  When ixgbe receives an interrupt indicating that a new optical module
  may have been inserted, it discards all of its current media types
  by calling ifmedia_removeall() and then creates a new set of media
  types for the supported media on the new module.  However,
  ifmedia_removeall() was maintaining a pointer to whatever the
  current media type was before the call to ifmedia_removealL().
  The result of this was that any attempt to read the current media
  type of the interface (e.g. via ifconfig) would return potentially
  garbage data from free memory (or if one were particularly unlucky
  on an architecture that does not malloc() from a direct map, page
  fault the kernel).

  Fix this by NULL'ing out the current media field in if_media.c,
  and have ixgbe update the current media type after recreating
  them.

  Submitted by: Matt Joras <matt.joras AT gmail DOT com>
  Reviewed by:  sbruno, erj
  MFC after:    1 week
  Sponsored by: Dell EMC Isilon
  Differential Revision:        https://reviews.freebsd.org/D9164

7 years agoMFC r313249:
kib [Tue, 7 Feb 2017 08:31:07 +0000 (08:31 +0000)]
MFC r313249:
Style, use tab after #define.

7 years agoMFC r313182:
ngie [Tue, 7 Feb 2017 05:44:13 +0000 (05:44 +0000)]
MFC r313182:

Fix typo in variable name (_REDUNDENT_LIB_DIRS -> _REDUNDANT_LIB_DIRS)

7 years agoMFC r312694: Make CTL ramdisk backend a real RAM disk.
mav [Tue, 7 Feb 2017 01:57:29 +0000 (01:57 +0000)]
MFC r312694: Make CTL ramdisk backend a real RAM disk.

If "capacity" LU option is set, ramdisk backend now implements featured
thin provisioned disk, storing data in malloc(9) allocated memory blocks
of pblocksize bytes (default PAGE_SIZE or 4KB).  Additionally ~0.2% of LU
size is used for indirection tree (bigger pblocksize reduce the overhead).
Backend supports all unmap and anchor operations.  If configured capacity
is overflowed, proper error conditions are reported.

If "capacity" LU option is not set, the backend operates mostly the same
as before without allocating real storage: writes go to nowhere, reads
return zeroes, reporting that all LBAs are unmapped.

This backend is still mostly oriented on testing and benchmarking (it is
still a volatile RAM disk), but now it should allow to run real FS tests,
not only simple dumb dd.

7 years agoMFC r312603: Add initial support for CTL module unloading.
mav [Tue, 7 Feb 2017 01:55:48 +0000 (01:55 +0000)]
MFC r312603: Add initial support for CTL module unloading.

It is only a first step and not perfect, but better then nothing.
The main blocker is CAM target frontend, that can not be unloaded,
since CAM does not have mechanism to unregister periph driver now.

7 years agoMFC r312348: Remove writing 'residual' field of struct ctl_scsiio.
mav [Tue, 7 Feb 2017 01:43:45 +0000 (01:43 +0000)]
MFC r312348: Remove writing 'residual' field of struct ctl_scsiio.

This field has no practical use and never readed.  Initiators already
receive respective residual size from frontends.  Removed field had
different semantics, which looks useless, and was never passed through
by any frontend.

While there, fix kern_data_resid field support in case of HA, missed in
r312291.

7 years agoMFC r312291, r312669:
mav [Tue, 7 Feb 2017 01:42:13 +0000 (01:42 +0000)]
MFC r312291, r312669:
Make CTL frontends report kern_data_resid for under-/overruns.

It seems like kern_data_resid was never really implemented.  This change
finally does it.  Now frontends update this field while transferring data,
while CTL/backends getting it can more flexibly handle the result.
At this point behavior should not change significantly, still reporting
errors on write overrun, but that may be changed later, if we decide so.

CAM target frontend still does not properly handle overruns due to CAM API
limitations.  We may need to add some fields to struct ccb_accept_tio to
pass information about initiator requested transfer size(s).

7 years agoMFC r312343: Improve error message on duplicate iSCSI port.
mav [Tue, 7 Feb 2017 01:38:48 +0000 (01:38 +0000)]
MFC r312343: Improve error message on duplicate iSCSI port.

7 years agoMFC r309369,310850,310853:
tsoome [Mon, 6 Feb 2017 22:03:07 +0000 (22:03 +0000)]
MFC r309369,310850,310853:

libstand: dosfs cstyle cleanup for return keyword.
dosfs support in libstand is broken since r298230

PR: 214423
Submitted by: Mikhail Kupchik
Reported by: Mikhail Kupchik
Approved by: imp (mentor)

7 years agoMFC r310845: boot2 will deadlock if extended keys are used on text input
tsoome [Mon, 6 Feb 2017 20:57:17 +0000 (20:57 +0000)]
MFC r310845: boot2 will deadlock if extended keys are used on text input

Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D8608

7 years agoMFC r312982:
cy [Mon, 6 Feb 2017 13:32:22 +0000 (13:32 +0000)]
MFC r312982:

Correct comment grammar and make it easier to understand.

7 years agoMFC r312663: When creating record file, use umask 077 instead of the default.
delphij [Mon, 6 Feb 2017 05:29:35 +0000 (05:29 +0000)]
MFC r312663: When creating record file, use umask 077 instead of the default.

7 years agoMFC r312664: Always initialize 'c'.
delphij [Mon, 6 Feb 2017 05:22:55 +0000 (05:22 +0000)]
MFC r312664: Always initialize 'c'.

7 years agoMFC r303802:
bcr [Sun, 5 Feb 2017 22:18:45 +0000 (22:18 +0000)]
MFC r303802:
Update with the members of the 9th core team.

7 years agoMFC r308583:
bcr [Sun, 5 Feb 2017 21:56:36 +0000 (21:56 +0000)]
MFC r308583:
Fix a broken link to the USB audio class specs.

PR: 214240
Submitted by: Tobias Kortkamp t@tobik.me

7 years agoMFC r310096: reaper: Make REAPER_KILL_SUBTREE actually work.
jilles [Sun, 5 Feb 2017 20:55:01 +0000 (20:55 +0000)]
MFC r310096: reaper: Make REAPER_KILL_SUBTREE actually work.

7 years agoMFC r312721: skel: Remove reference to deleted part in previous commit
jilles [Sun, 5 Feb 2017 14:25:31 +0000 (14:25 +0000)]
MFC r312721: skel: Remove reference to deleted part in previous commit
to this file.

7 years agoMFC r312954:
kib [Sun, 5 Feb 2017 00:39:44 +0000 (00:39 +0000)]
MFC r312954:
Do not leave stale 4K TLB entries on pde (superpage) removal or
protection change.

7 years agoMFC r311585:
ngie [Sat, 4 Feb 2017 17:26:28 +0000 (17:26 +0000)]
MFC r311585:

Conditionalize building libwrap support into sshd

Only build libwrap support into sshd if MK_TCP_WRAPPERS != no

This will unbreak the build if libwrap has been removed from the system

PR: 210141

7 years agoMFC r311174:
ngie [Sat, 4 Feb 2017 17:21:17 +0000 (17:21 +0000)]
MFC r311174:

Make /usr/lib/libbsnmptools.so.0 into an INTERRNALLIB

Although it increases the size of the bsnmp{get,set,walk} binaries by
four on my [amd64] system, it removes the need for producing .debug
files, profiled libraries, and for installing the library itself,
reducing the overall size use on disk by the utilities noted
previously.

Plus, it guards against ABI/API compatibility issues with the library
as it's only used internal to the tools themselves.

7 years agoMFC r311394:
ngie [Sat, 4 Feb 2017 17:18:49 +0000 (17:18 +0000)]
MFC r311394:

op_usm_users: don't deref uusers if it's NULL when SETting the value

Add an XXX comment to note that the conditional seems suspect given
how it's handled elsewhere in the SNMP_OP_SET case.

CID: 1008573

7 years agoMFC r312332,r312446,r312451:
ngie [Sat, 4 Feb 2017 17:17:38 +0000 (17:17 +0000)]
MFC r312332,r312446,r312451:

r312332:

Use SRCTOP where possible and use :H to manipulate .CURDIR to get rid of
unnecessarily long relative path .PATH values with make

r312446 (by emaste):

libc: remove reference to nonexistent lib/locale directory

As far as I can tell this was introduced in r72406 and updated in several
subsequent revisions, but the lib/locale directory it referenced never
existed.

r312451:

Replace dot-dot relative pathing with SRCTOP-relative paths where possible

This reduces build output, need for recalculating paths, and makes it clearer
which paths are relative to what areas in the source tree. The change in
performance over a locally mounted UFS filesystem was negligible in my testing,
but this may more positively impact other filesystems like NFS.

LIBC_SRCTOP was left alone so Juniper (and other users) can continue to
manipulate lib/libc/Makefile (and other Makefile.inc's under lib/libc) as
include Makefiles with custom options.

Discussed with: marcel, sjg

7 years agoMFC r311744,r312328,r312329,r312330:
ngie [Sat, 4 Feb 2017 17:10:19 +0000 (17:10 +0000)]
MFC r311744,r312328,r312329,r312330:

r311744:

Document bsd.snmpmod.mk from a high-level

r312328:

Add a make target (smilint) for running smilint tool against BMIBS

Running smilint against MIB definitions is useful in finding
functional problems with MIB definitions/descriptions.

This is inspired by the smilint targets defined in
usr.sbin/bsnmpd/modules/{snmp_hostres,snmp_mibII}/Makefile

Document all of the variables that are involved in running the
smilint target, as well as all of the prerequisites to running
it.

r312329:

Remove ad hoc smilint targets made standard in bsd.snmpmod.mk in r312328

r312330:

Add smilint target to subdir targets so "make smilint" here will run
the smilint target in subdirs

While here, convert a path that's .CURDIR relative to SRCTOP

7 years agoMFC r310467:
ngie [Sat, 4 Feb 2017 17:08:21 +0000 (17:08 +0000)]
MFC r310467:

Provide some guidance when dealing with sections and variables contained
within them

For example, using variables designated for %usm requires uncommenting
%usm section header

7 years agoMFC r303841,r312012,r312213:
ngie [Sat, 4 Feb 2017 17:06:51 +0000 (17:06 +0000)]
MFC r303841,r312012,r312213:

r303841 (by bdrewery):

Revert r298434 which should be fixed by r301287, r301394, and r301403.

PR: 208703, 208963

r312012:

fmaxmin_test still fails with clang 3.9.x.. bypass the test

PR: 208703

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

7 years agoMFC r312114:
ngie [Sat, 4 Feb 2017 17:02:54 +0000 (17:02 +0000)]
MFC r312114:

Enable WARNS?= 6 across all of tests/sys

7 years agoMFC r312120:
ngie [Sat, 4 Feb 2017 17:01:53 +0000 (17:01 +0000)]
MFC r312120:

Fix warnings

- Staticize test_num
- Promote i to size_t to deal with -Wsign-compare issues

Tested with: clang, gcc, gcc49

7 years agoMFC r312110:
ngie [Sat, 4 Feb 2017 16:58:06 +0000 (16:58 +0000)]
MFC r312110:

Fix -Wsign-compare warnings

The loop index (i) doesn't need to be size_t as its comparison is signed

7 years agoMFC r312164:
ngie [Sat, 4 Feb 2017 16:56:51 +0000 (16:56 +0000)]
MFC r312164:

Fix -Wformat issue

Use %zu for printing out results from nitems, as it's size_t based

7 years agoMFC r311473:
ngie [Sat, 4 Feb 2017 16:55:46 +0000 (16:55 +0000)]
MFC r311473:

Conditionalize all code that uses tcpd.h behind `LIBWRAP` guard

This will allow the code to stand by itself without libwrap

7 years agoMFC r311471:
ngie [Sat, 4 Feb 2017 16:54:44 +0000 (16:54 +0000)]
MFC r311471:

Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
always building support into sendmail.

7 years agoMFC r311469:
ngie [Sat, 4 Feb 2017 16:52:48 +0000 (16:52 +0000)]
MFC r311469:

Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
always building support into ypserv.

7 years agoMFC r311972:
ngie [Sat, 4 Feb 2017 16:49:50 +0000 (16:49 +0000)]
MFC r311972:

Add __BIT and __BITS macros from NetBSD to help support new testcases

7 years agoMFC r311925,r311968,r311969,r312102,r312108:
ngie [Sat, 4 Feb 2017 16:47:56 +0000 (16:47 +0000)]
MFC r311925,r311968,r311969,r312102,r312108:

r311925:

Import testcase updates with code contributed back to NetBSD

This also (inadvertently) contains an update to
contrib/netbsd-tests/lib/libc/sys/t_wait.c (new testcases).

In collaboration with: christos@NetBSD.org

r311968:

Fix lib/libc/sys/access_test after r311925

sys/param.h needs to be #included in order for __FreeBSD_version to be checked

r311969:

Remove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile

This is to enable support in other testcases

Inspired by lib/msun/tests/Makefile .

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

7 years agoMFC r312119,r312216,r312226:
ngie [Sat, 4 Feb 2017 16:02:48 +0000 (16:02 +0000)]
MFC r312119,r312216,r312226:

r312119:

encode_long, encode_timeval: mechanically replace `exp` with `exponent`

This helps fix a -Wshadow issue with exp(3) with tests/sys/acct/acct_test,
which include math.h, which in turn defines exp(3)

Tested with: clang, gcc 4.2.1, gcc 4.9

r312216:

Revert r312119 and reword the intent to fix -Wshadow issues
between exp(3) and `exp` var.

The approach taken previously was not ideal for multiple
functional and stylistic reasons.

Add to existing sed call in Makefile to replace `exp` with
`exponent` instead.

Requested by: bde

r312226:

Fix typo in r312216

I meant to replace "exp" with "exponent", not "expected"

Pointyhat to: ngie

7 years agoMFC r311472:
ngie [Sat, 4 Feb 2017 16:00:19 +0000 (16:00 +0000)]
MFC r311472:

Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
always building support into amd(8).

7 years agoMFC r311470:
ngie [Sat, 4 Feb 2017 15:56:24 +0000 (15:56 +0000)]
MFC r311470:

Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
always building support into rpcbind.

7 years agoFreeBSD 11.0 release date added.
sevan [Sat, 4 Feb 2017 15:53:34 +0000 (15:53 +0000)]
FreeBSD 11.0 release date added.

7 years agoAdd NetBSD 5.1.4, 5.2.2 & 7.0.1 releases to the tree.
sevan [Sat, 4 Feb 2017 15:52:49 +0000 (15:52 +0000)]
Add NetBSD 5.1.4, 5.2.2 & 7.0.1 releases to the tree.
Ammend the position of NetBSD 6.0.2 release in the tree as it came
after OpenBSD[1] & DragonFlyBSD[2] release according to the release
information.
The entries for the 6.0.5 & 6.1.5 releases were incorrect (fetched from
NetBSD CVS copy) and confirmed with history page[3]

[1] http://www.openbsd.org/53.html
[2] https://www.dragonflybsd.org/releases/
[3] http://netbsd.org/releases/formal.html#history

Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8099

7 years agoOpenBSD 6.0 added.
sevan [Sat, 4 Feb 2017 15:51:45 +0000 (15:51 +0000)]
OpenBSD 6.0 added.

7 years agoDragonFly 4.6.0 release added.
sevan [Sat, 4 Feb 2017 15:50:47 +0000 (15:50 +0000)]
DragonFly 4.6.0 release added.

7 years agoMFC r312105,r312162:
ngie [Sat, 4 Feb 2017 15:49:50 +0000 (15:49 +0000)]
MFC r312105,r312162:

r312105:

Conditionalize libwrap support into inetd based on MK_TCP_WRAPPERS

This will allow inetd to stand by itself without libwrap.

Relnotes: yes

r312162:

Fix up r312105

- Only #include tcpd.h when LIBWRAP is true to avoid header include errors
- Only define whichaf when LIBWRAP is true to avoid -Wunused warning and
  to avoid issues with structs being defined that should only be defined
  when tcpd.h is included.

Pointyhat to: ngie

7 years agoFix the previous commit to the family tree file. It is too early
sevan [Sat, 4 Feb 2017 15:48:53 +0000 (15:48 +0000)]
Fix the previous commit to the family tree file.  It is too early
to list 11.0, and we do not list -CURRENT here.

Submitted by: maxim
Sponsored by: The FreeBSD Foundation

7 years agoMFC r311263:
ngie [Sat, 4 Feb 2017 15:45:39 +0000 (15:45 +0000)]
MFC r311263:

Use calloc instead of malloc with buffers in snmp_{recv,send}_packet

This doesn't fix the issue noted in the PR, but at the very least it
cleans up the error so it looks a bit more sane, and in the event
that bsnmp did wander off into the weeds, the likelihood of it
crashing with more sensible output is greater, in my opinion

MFC counter set high so I have enough time to resolve the real
underlying bug in bsnmpwalk

PR: 215721

7 years agoMFC r312937:
ngie [Sat, 4 Feb 2017 15:43:54 +0000 (15:43 +0000)]
MFC r312937:

Fix typo in lib/Makefile

The SUBDIR_DEPEND variable should be for librpcsec_gss, not
liblibrpc_gss

PR: 216409

7 years agoBelatedly add FreeBSD 11.0 and 12.0 to the family tree file.
sevan [Sat, 4 Feb 2017 15:41:59 +0000 (15:41 +0000)]
Belatedly add FreeBSD 11.0 and 12.0 to the family tree file.

Submitted by: des (a while back)
Sponsored by: The FreeBSD Foundation

7 years agoMFC r312935:
ngie [Sat, 4 Feb 2017 15:41:44 +0000 (15:41 +0000)]
MFC r312935:

Remove duplicate bhnd SUBDIR entry

PR: 216413

7 years agoMFC r310124 (by andrew):
gonzo [Sat, 4 Feb 2017 01:24:21 +0000 (01:24 +0000)]
MFC r310124 (by andrew):

Add -fPIC to the ubldr build. Without this the self relocation code will
try to use an absolute address in a switch statement, jumping to an invalid
memory location.

Sponsored by: ABT Systems Ltd

PR: 216504

7 years agoMFC 312904: Don't drop a reference to the TOE PCB in undo_offload_socket().
jhb [Fri, 3 Feb 2017 23:48:56 +0000 (23:48 +0000)]
MFC 312904: Don't drop a reference to the TOE PCB in undo_offload_socket().

undo_offload_socket() is only called by t4_connect() during a connection
setup failure, but t4_connect() still owns the TOE PCB and frees ita
after undo_offload_socket() returns.  Release a reference in
undo_offload_socket() resulted in a double-free which panicked when
t4_connect() performed the second free.  The reference release was
added to undo_offload_socket() incorrectly in r299210.

Sponsored by: Chelsio Communications

7 years agoMFC 312906:
jhb [Fri, 3 Feb 2017 23:33:06 +0000 (23:33 +0000)]
MFC 312906:
Unregister CPL handlers for TOE-related messages when unloading TOM.

Sponsored by: Chelsio Communications

7 years agoMFC 313020: Fix a couple of issues with t4iov probe and attach.
jhb [Fri, 3 Feb 2017 21:37:27 +0000 (21:37 +0000)]
MFC 313020: Fix a couple of issues with t4iov probe and attach.

- Check for Chelsio vendor ID in probe routines.
- Fail attach instead of faulting if pci_find_dbsf() doesn't find a
  device.

PR: 216539
Sponsored by: Chelsio Communications

7 years agoMFC r312993:
dim [Fri, 3 Feb 2017 19:15:53 +0000 (19:15 +0000)]
MFC r312993:

Pull in r279454 from upstream llvm trunk (by James Molloy):

  [SROA] Remove incorrect assertion

  Confirmed with aprantl, this assertion is incorrect - code can get
  here (for example 80-bit FP types) and if it does it's benign. This
  is exposed by a completely unrelated patch of mine, so stop the
  compiler falling over.

  Original differential: http://reviews.llvm.org/D16187
  aprantl's advice to remove assertion:
  http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160815/382129.html

This should fix assertions when building the math/opensolaris-libm port.

Reported by: marino

7 years agoMFC r312832:
dim [Fri, 3 Feb 2017 19:12:54 +0000 (19:12 +0000)]
MFC r312832:

Pull in r278160 from upstream llvm trunk (by Wei Mi):

  Recommit "Use ValueOffsetPair to enhance value reuse during SCEV
  expansion".

  The fix for PR28705 will be committed consecutively.

  In D12090, the ExprValueMap was added to reuse existing value during
  SCEV expansion. However, const folding and sext/zext distribution can
  make the reuse still difficult.

  A simplified case is: suppose we know S1 expands to V1 in
  ExprValueMap, and
    S1 = S2 + C_a
    S3 = S2 + C_b
  where C_a and C_b are different SCEVConstants. Then we'd like to
  expand S3 as V1 - C_a + C_b instead of expanding S2 literally. It is
  helpful when S2 is a complex SCEV expr and S2 has no entry in
  ExprValueMap, which is usually caused by the fact that S3 is
  generated from S1 after const folding.

  In order to do that, we represent ExprValueMap as a mapping from SCEV
  to ValueOffsetPair. We will save both S1->{V1, 0} and S2->{V1, C_a}
  into the ExprValueMap when we create SCEV for V1. When S3 is
  expanded, it will first expand S2 to V1 - C_a because of S2->{V1,
  C_a} in the map, then expand S3 to V1 - C_a + C_b.

  Differential Revision: https://reviews.llvm.org/D21313

Pull in r278161 from upstream llvm trunk (by Wei Mi):

  Fix the runtime error caused by "Use ValueOffsetPair to enhance value
  reuse during SCEV expansion".

  The patch is to fix the bug in PR28705. It was caused by setting
  wrong return value for SCEVExpander::findExistingExpansion. The
  return values of findExistingExpansion have different meanings when
  the function is used in different ways so it is easy to make mistake.
  The fix creates two new interfaces to replace
  SCEVExpander::findExistingExpansion, and specifies where each
  interface is expected to be used.

  Differential Revision: https://reviews.llvm.org/D22942

Pull in r281439 from upstream llvm trunk (by Wei Mi):

  Create a getelementptr instead of sub expr for ValueOffsetPair if the
  value is a pointer.

  This patch is to fix PR30213. When expanding an expr based on
  ValueOffsetPair, if the value is of pointer type, we can only create
  a getelementptr instead of sub expr.

  Differential Revision: https://reviews.llvm.org/D24088

This should fix assertion failures when building OpenCV >= 3.1, and also
allow building lang/spidermonkey24 without any further assertions.

PR: 215649

7 years agoAdd history section for dd(1)
sevan [Fri, 3 Feb 2017 16:57:14 +0000 (16:57 +0000)]
Add history section for dd(1)
First version of UNIX to include dd found using TUHS
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s1/dd.c

PR: 211777
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8104

7 years agoMFC r312001:
pfg [Fri, 3 Feb 2017 16:35:10 +0000 (16:35 +0000)]
MFC r312001:
Remove __nonnull() attributes from x86 machine check architecture.

In this case the attributes serve little purpose as they just don't
enforce run time checks, If anything the attributes would cause NULL pointer
checks to be ignored but there are no such checks so the only effect is
cosmetic.

Reviewed by: jhb, avg

7 years agoRevert previous merge as it contained incorrect commit message.
sevan [Fri, 3 Feb 2017 12:47:24 +0000 (12:47 +0000)]
Revert previous merge as it contained incorrect commit message.

7 years agoMFC r312555:
kib [Fri, 3 Feb 2017 12:03:10 +0000 (12:03 +0000)]
MFC r312555:
Use SFENCE for ordering CLFLUSHOPT.