]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoRevert r317432 and add a new entry for r316527.
Bryan Drewery [Wed, 26 Apr 2017 16:50:54 +0000 (16:50 +0000)]
Revert r317432 and add a new entry for r316527.

Requested by: imp

7 years agoCheck if the device is marked as dma-coherent in the FDT, and if so, let
Olivier Houchard [Wed, 26 Apr 2017 16:13:22 +0000 (16:13 +0000)]
Check if the device is marked as dma-coherent in the FDT, and if so, let
busdma know, so that on architectures where dma isn't always coherent, we
know we don't have to write-back/invalidates cachelines on DMA operations.

Reviewed by: andrew, mav

7 years agogetpagesize(3) cannot fail.
Konstantin Belousov [Wed, 26 Apr 2017 14:28:27 +0000 (14:28 +0000)]
getpagesize(3) cannot fail.

Sponsored by: The FreeBSD Foundation

7 years agogetpagesize(3) cannot fail.
Konstantin Belousov [Wed, 26 Apr 2017 14:25:01 +0000 (14:25 +0000)]
getpagesize(3) cannot fail.

The sysctl(HW_PAGESIZE) call cannot fail on FreeBSD kernels at least.
And even if it failed for some improbable reason, PAGE_SIZE is a safe
value to return.

Discussed with: jilles
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoWhen a SYN-ACK is received in SYN-SENT state, RFC 793 requires the
Michael Tuexen [Wed, 26 Apr 2017 06:20:58 +0000 (06:20 +0000)]
When a SYN-ACK is received in SYN-SENT state, RFC 793 requires the
validation of SEG.ACK as the first step. If the ACK is not acceptable,
a RST segment should be sent and the segment should be dropped.
Up to now, the segment was partially processed.
This patch moves the check for the SEG.ACK validation up to the front
as required.
Reviewed by: hiren, gnn
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D10424

7 years ago[net80211] [wlanwds] allow logging to stderr as well as syslog.
Adrian Chadd [Wed, 26 Apr 2017 01:08:25 +0000 (01:08 +0000)]
[net80211] [wlanwds] allow logging to stderr as well as syslog.

By default this logs to syslog only, not stderr.  It makes it difficult
to debug exactly what's going on.  So allow '-e' to log to stderr so I
have a chance of actually debugging wlanwds /dynamic WDS (DWDS) issues.

7 years agoRemove entry for r304436 removed in r316527.
Bryan Drewery [Wed, 26 Apr 2017 00:41:18 +0000 (00:41 +0000)]
Remove entry for r304436 removed in r316527.

Sponsored by: Dell EMC Isilon

7 years agoFix SP refcount leak.
Andrey V. Elsukov [Wed, 26 Apr 2017 00:34:05 +0000 (00:34 +0000)]
Fix SP refcount leak.

PCB SP cache acquires extra reference, when SP is stored in the cache.
Release this reference when PCB is destroyed in ipsec_delete_pcbpolicy().
In ipsec_copy_pcbpolicy() release reference to SP in case if sp_in or
sp_out are not NULL.

Reported by: Slawa Olhovchenkov <slw at zxy spb ru>
MFC after: 1 week

7 years ago[net80211] document having to enable privacy on the dynamic plumbed VAPs.
Adrian Chadd [Wed, 26 Apr 2017 00:07:51 +0000 (00:07 +0000)]
[net80211] document having to enable privacy on the dynamic plumbed VAPs.

7 years agoIn arm_gicv2m_alloc_msi(), if we found a suitable irq range, leave the loop
Olivier Houchard [Tue, 25 Apr 2017 23:46:53 +0000 (23:46 +0000)]
In arm_gicv2m_alloc_msi(), if we found a suitable irq range, leave the loop
before we increase irq again, or we'd end up choosing an irq, and then
really using the next one, even if it's not available.
Also in the inner loop, correct the end check so that we check every irq,
even the last one.
This makes the msk(4) adapter able to use MSI on Softiron Overdrive 1000.

7 years agoRemove the source to digi(4).
John Baldwin [Tue, 25 Apr 2017 23:29:41 +0000 (23:29 +0000)]
Remove the source to digi(4).

This was forgotten when the driver was removed in r305235.

7 years agoRemove the LSOL26CALLS_SEL constant.
John Baldwin [Tue, 25 Apr 2017 23:19:27 +0000 (23:19 +0000)]
Remove the LSOL26CALLS_SEL constant.

It is no longer used after SVR4/i386 ABI support was removed.

Reported by: kib

7 years agoRemove NATM configuration bits and assorted NATM and ATM remnants.
Brooks Davis [Tue, 25 Apr 2017 21:59:34 +0000 (21:59 +0000)]
Remove NATM configuration bits and assorted NATM and ATM remnants.

Reported by: ak
Reviewed by: ngie (first version)
Differential Revision: https://reviews.freebsd.org/D10497

7 years agoRemove unnecessary check for NULL mbuf in soreceive_generic().
Patrick Kelsey [Tue, 25 Apr 2017 19:54:34 +0000 (19:54 +0000)]
Remove unnecessary check for NULL mbuf in soreceive_generic().

This check has been redundant since it was introduced in r162554.

Reviewed by: emaste, glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D10322

7 years agoAdd a new GDB_LIBEXEC option to install gdb and kgdb to /usr/libexec.
John Baldwin [Tue, 25 Apr 2017 18:08:56 +0000 (18:08 +0000)]
Add a new GDB_LIBEXEC option to install gdb and kgdb to /usr/libexec.

When this option is enabled, only gdb and kgdb are installed to
/usr/libexec for use by crashinfo(8). Other bits of GDB such as
gdbserver and gdbtui are not installed. For this option to be
effective, GDB must be enabled.

Rework r317094 to re-enable GDB on all platforms but enable
GDB_LIBEXEC on platforms for which the GDB in ports is a superset of
functionality.

Reviewed by: emaste, kib
Suggested by: kib
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D10449

7 years agoRemove an incorrect MLINK for tree(3) introduced in r310728.
Glen Barber [Tue, 25 Apr 2017 18:07:48 +0000 (18:07 +0000)]
Remove an incorrect MLINK for tree(3) introduced in r310728.

Reported by: many
PR: 216476
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoMFV 316894
Josh Paetzel [Tue, 25 Apr 2017 17:57:43 +0000 (17:57 +0000)]
MFV 316894

7252 7628 compressed zfs send / receive

illumos/illumos-gate@5602294fda888d923d57a78bafdaf48ae6223dea
https://github.com/illumos/illumos-gate/commit/5602294fda888d923d57a78bafdaf48ae6223dea

https://www.illumos.org/issues/7252
  This feature includes code to allow a system with compressed ARC enabled to
  send data in its compressed form straight out of the ARC, and receive data in
  its compressed form directly into the ARC.

https://www.illumos.org/issues/7628
  We should have longer, more readable versions of the ZFS send / recv options.

7628 create long versions of ZFS send / receive options

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: David Quigley <dpquigl@davequigley.com>
Reviewed by: Thomas Caputi <tcaputi@datto.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Dan Kimmel <dan.kimmel@delphix.com>

7 years agoRemove info files from optional old files.
John Baldwin [Tue, 25 Apr 2017 17:46:44 +0000 (17:46 +0000)]
Remove info files from optional old files.

Info files are now all removed unconditionally after the removal of
texinfo.

MFC after: 1 week

7 years agoAdd info files for GCC 4.2 to the list of info files to remove.
John Baldwin [Tue, 25 Apr 2017 17:45:26 +0000 (17:45 +0000)]
Add info files for GCC 4.2 to the list of info files to remove.

This would only affect upgrades from older versions of non-clang
platforms.

MFC after: 1 week

7 years agoRemove directories made empty by NATM, EISA, and IEEE488 removals.
Brooks Davis [Tue, 25 Apr 2017 17:00:08 +0000 (17:00 +0000)]
Remove directories made empty by NATM, EISA, and IEEE488 removals.

Reported by: ak

7 years agocxgbe/iw_cxgbe: Pull in some updates to c4iw_wait_for_reply from the
Navdeep Parhar [Tue, 25 Apr 2017 16:54:27 +0000 (16:54 +0000)]
cxgbe/iw_cxgbe: Pull in some updates to c4iw_wait_for_reply from the
iw_cxgb4 Linux driver.

Obtained from: Chelsio Communications
MFC after: 3 days
Sponsored by: Chelsio Communications

7 years agoCherry-pick 5d3c5151c2b885aab36627bafb8539238da27b2d, it fixes use after free
Gleb Smirnoff [Tue, 25 Apr 2017 15:56:46 +0000 (15:56 +0000)]
Cherry-pick 5d3c5151c2b885aab36627bafb8539238da27b2d, it fixes use after free
if tcpdump(1) is run on non-existent interface.

Suggested by: zeising

7 years agoFix a potential problem where we might try to shift by more than 31 bits
Doug Rabson [Tue, 25 Apr 2017 10:29:08 +0000 (10:29 +0000)]
Fix a potential problem where we might try to shift by more than 31 bits

CID:    1198859

7 years agoFix VNET leakages in PF by V_irtualizing pfr_ktables and friends.
Marko Zec [Tue, 25 Apr 2017 08:34:39 +0000 (08:34 +0000)]
Fix VNET leakages in PF by V_irtualizing pfr_ktables and friends.
Apparently this resolves a PF-triggered panic when destroying VNET jails.

Submitted by: Peter Blok <peter.blok@bsd4all.org>
Reviewed by: kp

7 years agoSince curvnet is already properly set on entry to event handlers,
Marko Zec [Tue, 25 Apr 2017 08:30:28 +0000 (08:30 +0000)]
Since curvnet is already properly set on entry to event handlers,
there's no need to override it, particularly not unconditionally with
vnet0.

Submitted by: Peter Blok <peter.blok@bsd4all.org>
Reviewed by: kp

7 years agoNote r317395 as merged.
Xin LI [Tue, 25 Apr 2017 03:29:35 +0000 (03:29 +0000)]
Note r317395 as merged.

7 years agoApply r316339 to vendor area.
Xin LI [Tue, 25 Apr 2017 03:28:38 +0000 (03:28 +0000)]
Apply r316339 to vendor area.

7 years agoFlush the LRO ctrl as soon as lro_mbufs fills up. There is no need to
Navdeep Parhar [Mon, 24 Apr 2017 22:35:00 +0000 (22:35 +0000)]
Flush the LRO ctrl as soon as lro_mbufs fills up.  There is no need to
wait for the next enqueue from the driver.

Reviewed by: gnn@, hselasky@, gallatin@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D10432

7 years agoFrames that are not considered for LRO should not be counted in LRO statistics.
Navdeep Parhar [Mon, 24 Apr 2017 22:31:56 +0000 (22:31 +0000)]
Frames that are not considered for LRO should not be counted in LRO statistics.

Reviewed by: gnn@, hselasky@, gallatin@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D10430

7 years agoUse the approved syntax to build no man pages.
Brooks Davis [Mon, 24 Apr 2017 21:55:59 +0000 (21:55 +0000)]
Use the approved syntax to build no man pages.

MFC after: 1 week
Sponsored by: DARPA, AFRL

7 years agoClean up Makefile.
Brooks Davis [Mon, 24 Apr 2017 21:31:27 +0000 (21:31 +0000)]
Clean up Makefile.

Prefer SRCTOP vs .CURDIR relative paths.

Find libnetbsd using LIBADD infrastructure rather than manual hackery.

Reviewed by: ngie, bapt
Obtained from: CheriBSD
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10461

7 years agoDocument the removal of NATM.
Brooks Davis [Mon, 24 Apr 2017 21:27:37 +0000 (21:27 +0000)]
Document the removal of NATM.

Relnotes: yes

7 years agoRemove the NATM framework including the en(4), fatm(4), hatm(4), and
Brooks Davis [Mon, 24 Apr 2017 21:21:49 +0000 (21:21 +0000)]
Remove the NATM framework including the en(4), fatm(4), hatm(4), and
patm(4) devices.

Maintaining an address family and framework has real costs when we make
infrastructure improvements.  In the case of NATM we support no devices
manufactured in the last 20 years and some will not even work in modern
motherboards (some newer devices that patm(4) could be updated to
support apparently exist, but we do not currently have support).

With this change, support remains for some netgraph modules that don't
require NATM support code. It is unclear if all these should remain,
though ng_atmllc certainly stands alone.

Note well: FreeBSD 11 supports NATM and will continue to do so until at
least September 30, 2021.  Improvements to the code in FreeBSD 11 are
certainly welcome.

Reviewed by: philip
Approved by: harti

7 years agoAllow use of a write open stateid for reading in the NFSv4 server.
Rick Macklem [Mon, 24 Apr 2017 20:46:19 +0000 (20:46 +0000)]
Allow use of a write open stateid for reading in the NFSv4 server.

The NFSv4 RFCs give a server the option of allowing the use of an open
stateid for write access to be used for a Read operation.
This patch enables this by default and adds a sysctl to disable it,
for anyone who does not want this capability.
Allowing this is particularily useful for a pNFS Data Server (DS), since
they are not permitted to allow the use of special stateids.
Discovered during recent testing of the pNFS server under development.

MFC after: 2 weeks

7 years agoFix the following warning from gcc 4.2 in usr.bin/diff:
Dimitry Andric [Mon, 24 Apr 2017 20:34:56 +0000 (20:34 +0000)]
Fix the following warning from gcc 4.2 in usr.bin/diff:

usr.bin/diff/diffreg.c: In function 'change':
usr.bin/diff/diffreg.c:1085: warning: 'i' may be used uninitialized in this function

This version of gcc is not smart enough to see that 'i' cannot actually
be used unitialized.  However, the variable is confusingly re-used, so
it is better to give it another name, and clearly initialize it before
attempting to use it.

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

7 years agoAdd support for dumping bcma/siba EROM tables to the console via a new
Landon J. Fuller [Mon, 24 Apr 2017 18:35:25 +0000 (18:35 +0000)]
Add support for dumping bcma/siba EROM tables to the console via a new
BHND_EROM_DUMP() method.

Dump the EROM tables to the coneole on mips/broadcom devices if bootverbose
is enabled; this functionality is primarily useful when debugging SoC EROM
parsing and device matching issues during early boot.

Reviewed by: mizhka
Approved by: adrian (mentor)
Sponsored by: Plausible Labs
Differential Revision: https://reviews.freebsd.org/D10122

7 years agoDrop unused/unnecessary return statement.
Landon J. Fuller [Mon, 24 Apr 2017 18:09:52 +0000 (18:09 +0000)]
Drop unused/unnecessary return statement.

Reported by: Coverity
CID: 1373118
Approved by: adrian (mentor, implicit)

7 years agoFix the last example to really replace all occurrences of the search string
Benedict Reuschling [Mon, 24 Apr 2017 16:52:26 +0000 (16:52 +0000)]
Fix the last example to really replace all occurrences of the search string
in the file by adding the global (g) option at the end.  Without it, only the
first match is replaced, subsequent ones are ignored.  The intention of the
example is to demonstrate something else, but adding the g matches the example
to what the description says.

Discussed with:     brd (on IRC)
MFC after:     1 week

7 years agoAdd sysutils/tmux to the DVD package set
Ed Maste [Mon, 24 Apr 2017 16:37:25 +0000 (16:37 +0000)]
Add sysutils/tmux to the DVD package set

The zsh + tmux combination is commonly wanted.

Approved by: gjb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

7 years agoscandir(3): promote arraysz to size_t to match numitems.
Pedro F. Giffuni [Mon, 24 Apr 2017 14:56:41 +0000 (14:56 +0000)]
scandir(3): promote arraysz to size_t to match numitems.

The internal array size goes through a loop and is compared with numitems
which at its limits makes can be unreachably higher than arraysz.
Prevent an hypothetical overflow by matching the types.

MFC after: 1 week

7 years agoelfcopy: allow empty symbol list files
Ed Maste [Mon, 24 Apr 2017 14:51:53 +0000 (14:51 +0000)]
elfcopy: allow empty symbol list files

Reported by: bz
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10441

7 years agoChange ctl_free_lun() locking.
Alexander Motin [Mon, 24 Apr 2017 12:52:42 +0000 (12:52 +0000)]
Change ctl_free_lun() locking.

This fixes potential callout_drain() sleep under non-sleepable lock.

PR: 218167
MFC after: 2 weeks

7 years agoSlightly compact the code.
Alexander Motin [Mon, 24 Apr 2017 12:44:04 +0000 (12:44 +0000)]
Slightly compact the code.

MFC after: 2 weeks

7 years agoCall the PSCI reset from cpu_reset on arm64. When rebooting from DDB the
Andrew Turner [Mon, 24 Apr 2017 11:06:10 +0000 (11:06 +0000)]
Call the PSCI reset from cpu_reset on arm64. When rebooting from DDB the
kernel calls this directly so the event handler is not called, meaning
the computer fails to reboot.

Tested by: cognet
MFC after: 1 week
Sponsored by: DARPA, AFRL

7 years agoSwitch isp_reset to scratchpad not requiring ISP_MBOXDMASETUP.
Alexander Motin [Mon, 24 Apr 2017 10:16:12 +0000 (10:16 +0000)]
Switch isp_reset to scratchpad not requiring ISP_MBOXDMASETUP.

MFC after: 1 week

7 years agoUse proper alignment constant for uma_zcreate().
Alexander Motin [Mon, 24 Apr 2017 08:44:51 +0000 (08:44 +0000)]
Use proper alignment constant for uma_zcreate().

Previous code panicked on KASSERT with INVARIANTS enabled.

MFC after: 2 weeks

7 years agohyperv/hn: Use channel0, i.e. TX ring0, for TCP SYN/SYN|ACK.
Sepherosa Ziehau [Mon, 24 Apr 2017 07:52:27 +0000 (07:52 +0000)]
hyperv/hn: Use channel0, i.e. TX ring0, for TCP SYN/SYN|ACK.

Hyper-V hot channel effect:
Operation latency on hot channel is only _half_ of the operation
latency on cold channels.

This commit takes the advantage of the above Hyper-V host channel
effect, and can reduce more than 75% latency and more than 50%
latency stdev, i.e. lower and more stable/predictable latency,
for various types of web server workloads.

MFC after: 3 days
Sponsored by: Microsoft

7 years agoFix the default uid/gid values in nfsuserd.c
Rick Macklem [Sun, 23 Apr 2017 23:09:02 +0000 (23:09 +0000)]
Fix the default uid/gid values in nfsuserd.c

This patch sets the default uid/gid values for "nobody" and "nogroup"
to the values in the password and group databases. Normally nfsuserd(8)
will override these with whatever is in the password/group databases,
so these values are only used when the databases entries aren't available.
It would be nice to use the definitions in sys/conf.h, but those are
in the _KERNEL section of the file.

Reported by: tez@pkgsrc.org
Submitted by: tez@pkgsrc.org
MFC after: 2 weeks

7 years agomsun: Remove trailing space in Sunsoft copyright statement.
Pedro F. Giffuni [Sun, 23 Apr 2017 22:31:12 +0000 (22:31 +0000)]
msun: Remove trailing space in Sunsoft copyright statement.

Submittedby: kargl

7 years agoMake it possible to terminate "show lockedbufs" by pressing "q".
Edward Tomasz Napierala [Sun, 23 Apr 2017 22:20:25 +0000 (22:20 +0000)]
Make it possible to terminate "show lockedbufs" by pressing "q".

MFC after: 2 weeks

7 years agosh: Add tests for NUL byte in command substitution output.
Jilles Tjoelker [Sun, 23 Apr 2017 21:58:17 +0000 (21:58 +0000)]
sh: Add tests for NUL byte in command substitution output.

7 years agoregex: unsign and constify some variables.
Pedro F. Giffuni [Sun, 23 Apr 2017 21:51:29 +0000 (21:51 +0000)]
regex: unsign and constify some variables.

Taking some hints from the regex variant in nvi(1) and higher-level
compiler warnings, update some types in our regex(3) implementation.

Joint work with: Kyle Evans
MFC after: 2 weeks

7 years agoMake the NFSv4 client to use a write open for reading if allowed by the server.
Rick Macklem [Sun, 23 Apr 2017 21:51:28 +0000 (21:51 +0000)]
Make the NFSv4 client to use a write open for reading if allowed by the server.

An NFSv4 server has the option of allowing a Read to be done using a Write
Open. If this is not allowed, the server will return NFSERR_OPENMODE.
This patch attempts the read with a write open and then disables this
if the server replies NFSERR_OPENMODE.
This change will avoid some uses of the special stateids. This will be
useful for pNFS/DS Reads, since they cannot use special stateids.
It will also be useful for any NFSv4 server that does not support reading
via the special stateids. It has been tested against both types of NFSv4 server.

MFC after: 2 weeks

7 years agoDon't set the connection-back-channel flag for DS sessions.
Rick Macklem [Sun, 23 Apr 2017 21:36:32 +0000 (21:36 +0000)]
Don't set the connection-back-channel flag for DS sessions.

The NFSv4.1/pNFS client does not use/need a backchannel for the Data Server (DS)
sessions, so the flag should only be set for MetaData Server (MDS) sessions.
This patch should have been a part of r317275.

MFC after: 2 weeks

7 years agoIn fill_ip6(), the value of the pointer av changes before it is
Marius Strobl [Sun, 23 Apr 2017 21:17:59 +0000 (21:17 +0000)]
In fill_ip6(), the value of the pointer av changes before it is
free(3)ed. Thus, introduce a new variable to track the original
value.

Submitted by: Tom Rix
Differential Revision: https://reviews.freebsd.org/D9962

7 years agoImprove BUF_TRACKING by not displaying NULL entries.
Edward Tomasz Napierala [Sun, 23 Apr 2017 17:39:31 +0000 (17:39 +0000)]
Improve BUF_TRACKING by not displaying NULL entries.

Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10443

7 years agoReport NTB link speed to console and interface.
Alexander Motin [Sun, 23 Apr 2017 14:25:51 +0000 (14:25 +0000)]
Report NTB link speed to console and interface.

MFC after: 2 weeks

7 years agoChange the drawing method for the mouse cursor in planar mode to support
Bruce Evans [Sun, 23 Apr 2017 08:59:35 +0000 (08:59 +0000)]
Change the drawing method for the mouse cursor in planar mode to support
colors.

Colors are still hard-coded as 15 (normally lightwhite) for the interior
and 0 (normally black) for the border, but these are now values used in
2 expressions instead of built in to the algorithm.  The algorithm used
a fancy and/or method, but this gives no control over the colors except
and'ing all color planes off gives black and or'ing all color planes on
gives lightwhite.  Just draw the border and interior in separate colors
using the same method as for characters, including its complications to
optimize for VGA adaptors.  Optimization is not really needed here, but
for the VGA case it avoids being slower than the and/or method.  The
optimization is worth about 30%.

7 years agoMap Linux CLOCK_BOOTTIME to native CLOCK_UPTIME.
Dmitry Chagin [Sun, 23 Apr 2017 07:57:30 +0000 (07:57 +0000)]
Map Linux CLOCK_BOOTTIME to native CLOCK_UPTIME.

MFC after: 1 week

7 years agoAdd Evdev ioctl handler to the Linuxulator.
Dmitry Chagin [Sun, 23 Apr 2017 07:43:50 +0000 (07:43 +0000)]
Add Evdev ioctl handler to the Linuxulator.

PR: 218627
Submitted by: Jan Kokemüller
Reported by: Jan Kokemüller
MFC after: 1 week

7 years agoMinor style(9) fixups
Enji Cooper [Sun, 23 Apr 2017 03:36:03 +0000 (03:36 +0000)]
Minor style(9) fixups

Delete trailing whitespace and sort headers.

Leave libgeom.h's placement alone, per reasoning in r317289.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agoNote that getpagesize(3) can return -1 on failure
Enji Cooper [Sun, 23 Apr 2017 03:17:32 +0000 (03:17 +0000)]
Note that getpagesize(3) can return -1 on failure

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agogctl_test.t: catch errors with the mdcfg directive
Enji Cooper [Sun, 23 Apr 2017 02:30:06 +0000 (02:30 +0000)]
gctl_test.t: catch errors with the mdcfg directive

While here, add a note about certain testcases relying on `count=1024` in
the "create" portion.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agoFix type for `pagesize` to match the return type for getpagesize(3)
Enji Cooper [Sun, 23 Apr 2017 01:50:47 +0000 (01:50 +0000)]
Fix type for `pagesize` to match the return type for getpagesize(3)
to fix the build

MFC after: 5 weeks
X-MFC with: r317311
Pointyhat to: ngie
Sponsored by: Dell EMC Isilon

7 years agoCheck for failures from getpagesize(3)
Enji Cooper [Sun, 23 Apr 2017 01:47:51 +0000 (01:47 +0000)]
Check for failures from getpagesize(3)

Return errno on failure, similar to the open(2) call above it.

MFC after: 5 weeks
Reported by: Coverity
CID: 1193753
Sponsored by: Dell EMC Isilon

7 years agoMinor style(9) fixups
Enji Cooper [Sun, 23 Apr 2017 01:17:59 +0000 (01:17 +0000)]
Minor style(9) fixups

Delete trailing whitespace and sort headers.

Leave libgeom.h's placement alone, per reasoning in r317289.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agogctl_test.t: improve error reporting with mdcfg and mount directives
Enji Cooper [Sat, 22 Apr 2017 23:30:02 +0000 (23:30 +0000)]
gctl_test.t: improve error reporting with mdcfg and mount directives

If the commands had failed previously, it would press on and result in a
series of cascading failures. Fail early and continue on to the next case
instead of executing additional commands after a previously failed series
of steps.

MFC after:      5 weeks
Sponsored by:   Dell EMC Isilon

7 years agogctl_test.t: more tweaks to try and update the code and get it functional (again?)
Enji Cooper [Sat, 22 Apr 2017 23:27:40 +0000 (23:27 +0000)]
gctl_test.t: more tweaks to try and update the code and get it functional (again?)

- Make the logfile for $out be built off the basename for $cmd, instead of $cmd.
  (r317292 broke this assumption).
- Rename $mntpt to $mntpt_prefix for clarity, as this variable is a prefix for
  mountpoints.
- Reindent the umount directive block while here to match the rest of the code.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agoUse verb=delete not verb=remove
Enji Cooper [Sat, 22 Apr 2017 23:06:53 +0000 (23:06 +0000)]
Use verb=delete not verb=remove

The `remove` verb hasn't been present in geom_part*(4) for well
over a decade, if ever. I couldn't find any references to it in
^/stable/5 at least, which is around the timeframe that this test
was written.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agogctl_test.t: minor tweaks
Enji Cooper [Sat, 22 Apr 2017 22:40:39 +0000 (22:40 +0000)]
gctl_test.t: minor tweaks

- Declare $count with the `my` scope operator to permit `use strict`.
- Add `use strict`.
- Use `use warnings` instead of using `-w` in the shebang.
- Don't unlink $cmd when done (prevents unnecessary rebuilding).
- Improve the error message when running with insufficient permissions, e.g.,
  non-root.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agoFix the NFSv4.1/pNFS client return layout on close.
Rick Macklem [Sat, 22 Apr 2017 22:37:44 +0000 (22:37 +0000)]
Fix the NFSv4.1/pNFS client return layout on close.

The "return layout on close" case in the pNFS client was badly broken.
Fortunately, extant pNFS servers that I have tested against do not
do this. This patch fixes it. It also changes the way the layout stateid.seqid
is set for LayoutReturn. I think this change is correct w.r.t. the RFC,
but I am not 100% sure.
This was found during recent testing of the pNFS server under development.

MFC after: 2 weeks

7 years agogctl_test_helper: add diagnostic output for parse_retval(..)
Enji Cooper [Sat, 22 Apr 2017 22:34:45 +0000 (22:34 +0000)]
gctl_test_helper: add diagnostic output for parse_retval(..)

This will help end-users better diagnose issues with the function.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agoOnly expect :grep_r_implied to pass with bsdgrep(1)
Enji Cooper [Sat, 22 Apr 2017 21:40:31 +0000 (21:40 +0000)]
Only expect :grep_r_implied to pass with bsdgrep(1)

The test fails with gnu grep from base and ports.

Sponsored by: Dell EMC Isilon

7 years agoAdd more sanity tests for grep, egrep, and fgrep
Enji Cooper [Sat, 22 Apr 2017 21:40:10 +0000 (21:40 +0000)]
Add more sanity tests for grep, egrep, and fgrep

The test suite currently lacks basic sanity checks to ensure that egrep,
fgrep, and grep are actually matching the right expression types, i.e. passing
the right flags to regcomp(3). Amend the test suite to make sure that not only
are the individual versions doing the right thing, but also that we don't have some
kind of frankenregex situation happening where egrep is accepting a BRE or
grep an ERE.

I've chosen to not expand the 'basic' test but to add the 'grep_sanity' checks
to their own test case since this is testing for more than just 'grep matches things',
but actual expression types.

Differential Revision: D10444
Reviewed by: emaste, ngie
Submitted by: Kyle Evans <kevans91@ksu.edu>
Tested with: bsdgrep, gnu grep (base, ports)
Sponsored by: Dell EMC Isilon

7 years agosh: Simplify setinteractive().
Jilles Tjoelker [Sat, 22 Apr 2017 21:31:37 +0000 (21:31 +0000)]
sh: Simplify setinteractive().

setsignal() does nothing if the signal disposition is already set correctly.

7 years agoRemove the expected failures for :context and :context2 with bsdgrep(1)
Enji Cooper [Sat, 22 Apr 2017 21:26:15 +0000 (21:26 +0000)]
Remove the expected failures for :context and :context2 with bsdgrep(1)

They're no longer needed after recent fixes made to bsdgrep(1).

Submitted by: Kyle Evans <kevans91@ksu.edu> (via a previous diff in D10433)
Sponsored by: Dell EMC Isilon

7 years agoFix some krpc leaks for the NFSv4.1/pNFS client.
Rick Macklem [Sat, 22 Apr 2017 20:55:39 +0000 (20:55 +0000)]
Fix some krpc leaks for the NFSv4.1/pNFS client.

The NFSv4.1/pNFS client wasn't doing a newnfs_disconnect() call for the
connection to the Data Server (DS) under some circumstances. The main
effect of this was a leak of malloc'd structures in the krpc. This patch
adds the newnfs_disconnect() calls to fix this.
Detected during recent testing against the pNFS server under development.

MFC after: 2 weeks

7 years agoThe GPT class no longer exists; use the PART class instead
Enji Cooper [Sat, 22 Apr 2017 20:51:54 +0000 (20:51 +0000)]
The GPT class no longer exists; use the PART class instead

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agoBump WARNS to 6 per previous commits which fixed warnings
Enji Cooper [Sat, 22 Apr 2017 20:29:56 +0000 (20:29 +0000)]
Bump WARNS to 6 per previous commits which fixed warnings

MFC after: 5 weeks
Tested with: clang (4.0), gcc (4.2.1, 6.3.0)
Sponsored by: Dell EMC Isilon

7 years agogctl_test_helper: apply polish
Enji Cooper [Sat, 22 Apr 2017 20:27:46 +0000 (20:27 +0000)]
gctl_test_helper: apply polish

- Staticize variables to fix warnings.
- Sprinkle asserts around for calls that can fail
- Apply style(9) for main(..) definition.
- ANSIify usage(..) definition.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agogctl_test.t: use make to compile gctl_test_helper instead of calling cc directly
Enji Cooper [Sat, 22 Apr 2017 20:15:47 +0000 (20:15 +0000)]
gctl_test.t: use make to compile gctl_test_helper instead of calling cc directly

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agoRename gctl.t to gctl_test.t and test.c to gctl_test_helper.c
Enji Cooper [Sat, 22 Apr 2017 20:06:11 +0000 (20:06 +0000)]
Rename gctl.t to gctl_test.t and test.c to gctl_test_helper.c

This is being done to reduce ambiguity and to make the tests more portable
in the future to other locations in the source tree.

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agoFix -Wimplicit-function-declaration compilation warning by moving libgeom.h
Enji Cooper [Sat, 22 Apr 2017 20:00:52 +0000 (20:00 +0000)]
Fix -Wimplicit-function-declaration compilation warning by moving libgeom.h
#include below the stdio.h #include.

gctl_dump(3) needs stdio.h, per reasoning noted in r317289.

MFC after: 5 weeks
PR: 218809
Submitted by: Chang-Hsien Tsai <luke.tw@gmail.com>
Sponsored by: Dell EMC Isilon

7 years agolibgeom(3): note that stdio.h is required when referencing gctl_dump(3)
Enji Cooper [Sat, 22 Apr 2017 19:32:23 +0000 (19:32 +0000)]
libgeom(3): note that stdio.h is required when referencing gctl_dump(3)

gctl_dump(3) is only exposed when stdio.h is #include'd first, per its
addition in r112510. The reasoning noted for the conditional "exposure"
of the function was to "limit #include pollution".

This addresses an issue I found with the documentation when looking at
bug 218809, which in turn addresses a -Wimplicit-function-declaration
compiler warning in `tools/regression/geom_gpt/test.c` (it uses
gctl_dump(3)).

MFC after: 5 weeks
Sponsored by: Dell EMC Isilon

7 years agolibgeom(3): apply minor polish
Enji Cooper [Sat, 22 Apr 2017 19:11:37 +0000 (19:11 +0000)]
libgeom(3): apply minor polish

- Use .Dv when mentioning NULL per mdoc(7).
- Reword `g_device_path`, `g_open_by_ident`, and `g_providername`'s descriptions
  so they're less wordy.
- Fix a typo in `g_device_path` (can not -> cannot).

MFC after: 5 weeks
Tested with: igor, make manlint
Sponsored by: Dell EMC Isilon

7 years agopmcstat(8); unsign some allocation variables and use reallocarray(3).
Pedro F. Giffuni [Sat, 22 Apr 2017 16:02:40 +0000 (16:02 +0000)]
pmcstat(8); unsign some allocation variables and use reallocarray(3).

Use unsigned values in some internal variables that will be used during
allocation. The variables are used in reduced scope and have no chance of
becoming negative.

Provide bounds checking through reallocarray(3).

MFC after: 2 weeks

7 years agofsck_ffs: Unsign some variables and make use of reallocarray(3).
Pedro F. Giffuni [Sat, 22 Apr 2017 14:50:11 +0000 (14:50 +0000)]
fsck_ffs: Unsign some variables and make use of reallocarray(3).

Instead of casting listmax and numdirs to unsigned values just define
them as unsigned and avoid the casts. Use reallocarray(3).

While here, fs_ncg is already unsigned so the cast is unnecessary.

Reviewed by: mckusick
MFC after: 2 weeks

7 years agoRename variable for clarity
Kristof Provost [Sat, 22 Apr 2017 13:04:36 +0000 (13:04 +0000)]
Rename variable for clarity

Rename the mtu variable in ip6_fragment(), because mtu is misleading. The
variable actually holds the fragment length.
No functional change.

Suggested by: ae

7 years agoAdd basic example to the cu(1) man page. Srsly, folks, you don't
Edward Tomasz Napierala [Sat, 22 Apr 2017 09:38:43 +0000 (09:38 +0000)]
Add basic example to the cu(1) man page.  Srsly, folks, you don't
need to install minicom for this...

MFC after: 2 weeks

7 years agoRemove unneeded conditions.
Alexander Motin [Sat, 22 Apr 2017 08:38:49 +0000 (08:38 +0000)]
Remove unneeded conditions.

MFC after: 2 weeks

7 years ago[net80211] add methods to fetch the global and per-VAP WME parameters.
Adrian Chadd [Sat, 22 Apr 2017 02:12:07 +0000 (02:12 +0000)]
[net80211] add methods to fetch the global and per-VAP WME parameters.

For now there isn't any per-VAP WME state.  The eventual aim is to migrate
the driver direct use of WME parameters over to use these methods as
appropriate (global for most devices, per-VAP for firmware NICs that support
it) in preparation for actual per-VAP WME (and other thing) state change
support.

7 years agoFix counter increment in Salsa and ChaCha.
Dag-Erling Smørgrav [Sat, 22 Apr 2017 01:06:23 +0000 (01:06 +0000)]
Fix counter increment in Salsa and ChaCha.

In my eagerness to eliminate a branch which is taken once per 2^38
bytes of keystream, I forgot that the state words are in host order.
Thus, the counter increment code worked fine on little-endian
machines, but not on big-endian ones.  Switch to a simpler (branchful)
solution.

7 years agoDon't set ND_NOMOREDATA for a failed Setattr operation (NFSv4).
Rick Macklem [Fri, 21 Apr 2017 23:01:32 +0000 (23:01 +0000)]
Don't set ND_NOMOREDATA for a failed Setattr operation (NFSv4).

The NFSv4 Setattr operation always has reply data even when it fails,
so don't set the ND_NOMOREDATA for it. This would only affect unusual
cases where Setattr fails and the RPC code wants to parse the rest of
the compound. Detected during recent development related to the pNFS server.

MFC after: 2 weeks

7 years agoDon't create a backchannel for a DS connection.
Rick Macklem [Fri, 21 Apr 2017 22:38:26 +0000 (22:38 +0000)]
Don't create a backchannel for a DS connection.

An NFSv4.1 client connection to a Data Server (DS) should not have a
backchannel. This patch fixes the NFSv4.1/pNFS client to not do a backchannel
for this case.
Found during recent testing with the pNFS server under development.

MFC after: 2 weeks

7 years agoStr_Match: fix closure tests for [^] and add unit-test.
Simon J. Gerraty [Fri, 21 Apr 2017 22:19:13 +0000 (22:19 +0000)]
Str_Match: fix closure tests for [^] and add unit-test.

7 years agofuse: Implement FOPEN_KEEP_CACHE flag
Conrad Meyer [Fri, 21 Apr 2017 22:00:22 +0000 (22:00 +0000)]
fuse: Implement FOPEN_KEEP_CACHE flag

Implement FUSE open flag FOPEN_KEEP_CACHE.  Without this flag, cached file
contents should be invalidated on open.  Apparently, fusefs-encfs relies
upon this behavior.

PR: 218636
Submitted by: Ben RUBSON <ben.rubson at gmail.com>

7 years agoAdd checks for failed operations to the NFSv4 client function nfscl_mtofh().
Rick Macklem [Fri, 21 Apr 2017 21:43:00 +0000 (21:43 +0000)]
Add checks for failed operations to the NFSv4 client function nfscl_mtofh().

The nfscl_mtofh() function didn't check for failed operations and, as such,
would have returned EBADRPC for these cases, due to parsing failure.
This patch adds checks, so that it returns with ND_NOMOREDATA set.
This is needed for future use in the pNFS server and acts as a safety
belt in the meantime.

MFC after: 2 weeks

7 years agoGet rid of bogus statement in the nfsuserd.8 man page.
Rick Macklem [Fri, 21 Apr 2017 20:53:51 +0000 (20:53 +0000)]
Get rid of bogus statement in the nfsuserd.8 man page.

The nfsuserd.8 man page stated that a usertimeout of 0 would disable
the cache timeout. This was simply not true, so this patch deletes
the sentence.

This is a content change.

PR: 217406
MFC after: 2 weeks

7 years agoSet default uid/gid to nobody/nogroup for NFSv4 mapping.
Rick Macklem [Fri, 21 Apr 2017 20:08:10 +0000 (20:08 +0000)]
Set default uid/gid to nobody/nogroup for NFSv4 mapping.

The default uid/gid for NFSv4 are set by the nfsuserd(8) daemon.
However, they were 0 until the nfsuserd(8) was run. Since it is
possible to use NFSv4 without running the nfsuserd(8) daemon, set them
to nobody/nogroup initially.
Without this patch, the values would be set by the nfsuserd(8) daemon
and left changed even if the nfsuserd(8) daemon was killed. The default
values of 0 meant that setting a group to "wheel" would fail even when
done by root.
It also adds a definition of GID_NOGROUP to sys/conf.h.

Discussed on: freebsd-current@
MFC after: 2 weeks

7 years agoMFV 316891
Josh Paetzel [Fri, 21 Apr 2017 19:53:52 +0000 (19:53 +0000)]
MFV 316891

7386 zfs get does not work properly with bookmarks

illumos/illumos-gate@edb901aab9c738b5eb15aa55933e82b0f2f9d9a2
https://github.com/illumos/illumos-gate/commit/edb901aab9c738b5eb15aa55933e82b0f2f9d9a2

https://www.illumos.org/issues/7386
  The zfs get command does not work with the bookmark parameter while it works
  properly with both filesystem and snapshot:
  # zfs get -t all -r creation rpool/test
  NAME               PROPERTY  VALUE                  SOURCE
  rpool/test         creation  Fri Sep 16 15:00 2016  -
  rpool/test@snap    creation  Fri Sep 16 15:00 2016  -
  rpool/test#bkmark  creation  Fri Sep 16 15:00 2016  -
  # zfs get -t all -r creation rpool/test@snap
  NAME             PROPERTY  VALUE                  SOURCE
  rpool/test@snap  creation  Fri Sep 16 15:00 2016  -
  # zfs get -t all -r creation rpool/test#bkmark
  cannot open 'rpool/test#bkmark': invalid dataset name
  #
  The zfs get command should be modified to work properly with bookmarks too.

Reviewed by: Simon Klinkert <simon.klinkert@gmail.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Marcel Telka <marcel@telka.sk>