]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMore ATM and NATM removal
brooks [Thu, 27 Apr 2017 16:05:12 +0000 (16:05 +0000)]
More ATM and NATM removal

Submitted by: ak
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D10511

7 years agoMFV 316895
jpaetzel [Thu, 27 Apr 2017 15:10:45 +0000 (15:10 +0000)]
MFV 316895

7606 dmu_objset_find_dp() takes a long time while importing pool

illumos/illumos-gate@7588687e6ba67c47bf7c9805086dec4a97fcac7b
https://github.com/illumos/illumos-gate/commit/7588687e6ba67c47bf7c9805086dec4a97fcac7b

https://www.illumos.org/issues/7606
  When importing a pool with a large number of filesystems within the same
  parent filesystem, we see that dmu_objset_find_dp() takes a long time.
  It is called from 3 places: spa_check_logs(), spa_ld_claim_log_blocks(),
  and spa_load_verify().
  There are several ways to improve performance here:
  1. We don't really need to do spa_check_logs() or
         spa_ld_claim_log_blocks() if the pool was closed cleanly.
  2. spa_load_verify() uses dmu_objset_find_dp() to check that no
         datasets have too long of names.
  3. dmu_objset_find_dp() is slow because it's doing
         zap_value_search() (which is O(N sibling datasets)) to determine
         the name of each dsl_dir when it's opened. In this case we
         actually know the name when we are opening it, so we can provide
         it and avoid the lookup.
  This change implements fix #3 from the above list; i.e. make
  dmu_objset_find_dp() provide the name of the dataset so that we don't
  have to search for it.

Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prashanth Sreenivasa <prashksp@gmail.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMake cached Bluetooth LE host advertise information visible from userland.
takawata [Thu, 27 Apr 2017 15:03:24 +0000 (15:03 +0000)]
Make cached Bluetooth LE host advertise information visible from userland.

Differential Revision: https://reviews.freebsd.org/D10362

7 years agoDon't free uninitialized sysctl contexts in the mlx4en driver. This
hselasky [Thu, 27 Apr 2017 14:39:52 +0000 (14:39 +0000)]
Don't free uninitialized sysctl contexts in the mlx4en driver. This
can cause NULL pointer panics during failed device attach.

Differential Revision: https://reviews.freebsd.org/D8876
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoPrefer to use real virtual address over direct map address in the
hselasky [Thu, 27 Apr 2017 14:29:21 +0000 (14:29 +0000)]
Prefer to use real virtual address over direct map address in the
linux_page_address() function in the LinuxKPI. This solves an issue
where the return value from linux_page_address() is passed to
kmem_free().

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoWe need CAP_MMAP_RW on memfd, since init_msix_table() may call mmap().
glebius [Thu, 27 Apr 2017 05:48:52 +0000 (05:48 +0000)]
We need CAP_MMAP_RW on memfd, since init_msix_table() may call mmap().

7 years agoFix handling of a NFSv4.1 callback reply from the session cache.
rmacklem [Wed, 26 Apr 2017 21:54:53 +0000 (21:54 +0000)]
Fix handling of a NFSv4.1 callback reply from the session cache.

The nfsv4_seqsession() call returns NFSERR_REPLYFROMCACHE when it has a
reply in the session, due to a requestor retry. The code erroneously
assumed a return of 0 for this case. This patch fixes this and adds
a KASSERT(). This would be an extremely rare occurrence. It was found
during code inspection during the pNFS server development.

MFC after: 2 weeks

7 years agoFix an issue with MTU calculation if an ICMP messaeg is received
tuexen [Wed, 26 Apr 2017 20:21:05 +0000 (20:21 +0000)]
Fix an issue with MTU calculation if an ICMP messaeg is received
for an SCTP/UDP packet.

MFC after: 1 week

7 years agoAdd information about device nodes to man pages for USB serial drivers.
trasz [Wed, 26 Apr 2017 19:51:10 +0000 (19:51 +0000)]
Add information about device nodes to man pages for USB serial drivers.

MFC after: 2 weeks

7 years agoAdd some .Xrs to USB serial driver man pages.
trasz [Wed, 26 Apr 2017 19:41:53 +0000 (19:41 +0000)]
Add some .Xrs to USB serial driver man pages.

MFC after: 2 weeks

7 years agoMake fstyp(8) recognize exFAT even without the -u option.
trasz [Wed, 26 Apr 2017 19:34:41 +0000 (19:34 +0000)]
Make fstyp(8) recognize exFAT even without the -u option.

While it's not directly mountable with mount(8), it's something that's
mountable - differently from GELI or zpools.

MFC after: 2 weeks

7 years agoPull in r294458 from upstream llvm trunk (by Sanne Wouda):
dim [Wed, 26 Apr 2017 19:33:56 +0000 (19:33 +0000)]
Pull in r294458 from upstream llvm trunk (by Sanne Wouda):

  [Assembler] Enable nicer diagnostics for inline assembly.

  Fixed test.

  Summary:
  Enables source location in diagnostic messages from the backend.
  This is after parsing, during finalization.  This requires the
  SourceMgr, the inline assembly string buffer, and DiagInfo to still
  be alive after EmitInlineAsm returns.

  This patch creates a single SourceMgr for inline assembly inside the
  AsmPrinter.  MCContext gets a pointer to this SourceMgr.  Using one
  SourceMgr per call to EmitInlineAsm would make it difficult for
  MCContext to figure out in which SourceMgr the SMLoc is located,
  while a single SourceMgr can figure it out if it has multiple
  buffers.

  The Str argument to EmitInlineAsm is copied into a buffer and owned
  by the inline asm SourceMgr.  This ensures that DiagHandlers won't
  print garbage.  (Clang emits a "note: instantiated into assembly
  here", which refers to this string.)

  The AsmParser gets destroyed before finalization, which means that
  the DiagHandlers the AsmParser installs into the SourceMgr will be
  stale.  Restore the saved DiagHandlers.

  Since now we're using just one SourceMgr for multiple inline asm
  strings, we need to tell the AsmParser which buffer it needs to parse
  currently.  Hand a buffer id -- returned from SourceMgr::
  AddNewSourceBuffer -- to the AsmParser.

  Reviewers: rnk, grosbach, compnerd, rengolin, rovka, anemet

  Reviewed By: rnk

  Subscribers: llvm-commits

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

This improves error reporting for some inline assembly constructs that
clang does not approve of: instead of crashing with a "fatal backend
error", it will now show a normal error message, and point out the
location of the problematic assembly.

Reported by: mmel
MFC after: 1 week

7 years agoUse consistently uint32_t for mtu values.
tuexen [Wed, 26 Apr 2017 19:26:40 +0000 (19:26 +0000)]
Use consistently uint32_t for mtu values.

This does not change functionality, but this cleanup is need for further
improvements of ICMP handling.

MFC after: 1 week

7 years agoRemove the cy(4) driver for Cyclades serial adapters.
jhb [Wed, 26 Apr 2017 18:23:09 +0000 (18:23 +0000)]
Remove the cy(4) driver for Cyclades serial adapters.

This driver has been disconnected from the build since the new tty
layer was introduced in 8.0 and was never updated for new tty.

7 years agoFix build of tools/tools/umastat.
glebius [Wed, 26 Apr 2017 17:58:10 +0000 (17:58 +0000)]
Fix build of tools/tools/umastat.

PR: 218887
Submitted by: Fabian Keil <fk fabiankeil.de>
Obtained from: ElectroBSD

7 years agoUMA_ZONE_REFCNT was removed.
glebius [Wed, 26 Apr 2017 17:55:43 +0000 (17:55 +0000)]
UMA_ZONE_REFCNT was removed.

PR: 209715
Submitted by: Fabian Keil <fk fabiankeil.de>
MFC after: 3 days

7 years agoRevert r317432 and add a new entry for r316527.
bdrewery [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
cognet [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.
kib [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.
kib [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
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 [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.
bdrewery [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.
ae [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 [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
cognet [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).
jhb [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.
jhb [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 [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().
pkelsey [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.
jhb [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.
gjb [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
jpaetzel [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.
jhb [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.
jhb [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 [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
np [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
glebius [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
dfr [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.
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,
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 agoFlush the LRO ctrl as soon as lro_mbufs fills up. There is no need to
np [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.
np [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 [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 [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 [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 [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.
rmacklem [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:
dim [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
landonf [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.
landonf [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
bcr [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
emaste [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.
pfg [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
emaste [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.
mav [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.
mav [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 [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.
mav [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().
mav [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.
sephe [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
rmacklem [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.
pfg [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".
trasz [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 [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.
pfg [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.
rmacklem [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.
rmacklem [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 [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.
trasz [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.
mav [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
bde [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.
dchagin [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.
dchagin [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
ngie [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
ngie [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
ngie [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)
ngie [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)
ngie [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
ngie [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
ngie [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?)
ngie [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
ngie [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
ngie [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.
rmacklem [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(..)
ngie [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)
ngie [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
ngie [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 [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)
ngie [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.
rmacklem [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
ngie [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
ngie [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
ngie [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
ngie [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
ngie [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
ngie [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)
ngie [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
ngie [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).
pfg [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