]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoRemove unneeded locales and alias man directories
Baptiste Daroussin [Tue, 26 Sep 2017 05:43:55 +0000 (05:43 +0000)]
Remove unneeded locales and alias man directories

In base, locales (and encoding) specific directories are not used
by any tool. Just remove them.

While here also remove the cat page directory for openssl

6 years agoDo not print error when running make delete-old on system
Baptiste Daroussin [Tue, 26 Sep 2017 05:33:15 +0000 (05:33 +0000)]
Do not print error when running make delete-old on system
without catpages directories

6 years agocrypto(9): Use a more specific error code when a capable driver is not found
Conrad Meyer [Tue, 26 Sep 2017 01:31:49 +0000 (01:31 +0000)]
crypto(9): Use a more specific error code when a capable driver is not found

When crypto_newsession() is given a request for an unsupported capability,
raise a more specific error than EINVAL.

This allows cryptotest.py to skip some HMAC tests that a driver does not
support.

Reviewed by: jhb, rlibby
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12451

6 years agoFix the return value from _Unwind_Backtrace() on arm.
Ian Lepore [Mon, 25 Sep 2017 23:50:10 +0000 (23:50 +0000)]
Fix the return value from _Unwind_Backtrace() on arm.

If unwinding stops due to hitting the end of the call chain, the return
value is supposed to be _URC_END_OF_STACK; other values indicate internal
errors.  The return value from get_eit_entry() is now returned without
translating it to _URC_FAILURE, so that callers can see _URC_END_OF_STACK
when it happens.

6 years agoFix handling of uncaught exceptions in a std::terminate() handler on arm.
Ian Lepore [Mon, 25 Sep 2017 23:24:41 +0000 (23:24 +0000)]
Fix handling of uncaught exceptions in a std::terminate() handler on arm.

When raising an exception, the unwinder searches for a catch handler and if
none is found it should invoke std::terminate() with the uncaught exception
as the "current" exception.  Before this change, the terminate handler was
invoked with no exception as current (abi::__cxa_current_exception_type()
returned NULL), because the return value from the unwinder indicated an
internal failure in unwinding.  It turns out that was because all errors
from get_eit_entry() were translated to _URC_FAILURE.  Now the error is
returned untranslated, which allows _URC_END_OF_STACK to percolate upwards
to throw_exception() in libcxxrt.  When it sees that return status it
properly calls std::terminate() with the uncaught exception installed
as the current exception, allowing custom terminate handlers to work
with it.

6 years agoRemove the cat pages directory now that catman(1) is gone
Baptiste Daroussin [Mon, 25 Sep 2017 21:23:49 +0000 (21:23 +0000)]
Remove the cat pages directory now that catman(1) is gone

6 years agoClose a memory leak when using zpool_read_all_labels
Alan Somers [Mon, 25 Sep 2017 20:44:40 +0000 (20:44 +0000)]
Close a memory leak when using zpool_read_all_labels

MFC after: 3 weeks
X-MFC-With: 322854
Sponsored by: Spectra Logic Corp

6 years agoLog signal number passed to PT_STEP requests in KTR_PTRACE traces.
John Baldwin [Mon, 25 Sep 2017 20:38:55 +0000 (20:38 +0000)]
Log signal number passed to PT_STEP requests in KTR_PTRACE traces.

MFC after: 1 week

6 years agoUse tmpfs_print for tmpfs FIFOs.
John Baldwin [Mon, 25 Sep 2017 20:26:16 +0000 (20:26 +0000)]
Use tmpfs_print for tmpfs FIFOs.

Reviewed by: kib (part of a larger patch)

6 years agolibefi: efipart_floppy() will should not pass acpi pointer if the HID test fails
Toomas Soome [Mon, 25 Sep 2017 19:49:56 +0000 (19:49 +0000)]
libefi: efipart_floppy() will should not pass acpi pointer if the HID test fails

The current efipart_floppy() implementation is leaking the acpi pointer.

6 years agocapsicum_helpers: Add SEEK to default stdio rights set
Conrad Meyer [Mon, 25 Sep 2017 19:33:32 +0000 (19:33 +0000)]
capsicum_helpers: Add SEEK to default stdio rights set

PR: 219173
Sponsored by: Dell EMC Isilon

6 years agoUse nstosbt() instead of multiplying by SBT_1NS to avoid roundoff errors.
Ian Lepore [Mon, 25 Sep 2017 15:03:27 +0000 (15:03 +0000)]
Use nstosbt() instead of multiplying by SBT_1NS to avoid roundoff errors.

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

6 years agoFix gcc compilation issues in the mvneta driver
Marcin Wojtas [Mon, 25 Sep 2017 02:06:51 +0000 (02:06 +0000)]
Fix gcc compilation issues in the mvneta driver

Compiling mvneta driver with gcc unveiled two issues, that
required fixing.

Reported by: andrew
Obtained from: Semihalf

6 years agoChange vm_page_try_to_free() to require a managed page. Essentially,
Alan Cox [Sun, 24 Sep 2017 23:35:01 +0000 (23:35 +0000)]
Change vm_page_try_to_free() to require a managed page.  Essentially,
vm_page_try_to_free() is testing conditions, like clean versus dirty,
that only vary in managed pages.

Suggested by: kib
Reviewed by: markj
X-MFC after: never

6 years agoModernize the use of vm_page_unwire(). Since r288122, vm_page_unwire()
Alan Cox [Sun, 24 Sep 2017 22:29:11 +0000 (22:29 +0000)]
Modernize the use of vm_page_unwire().  Since r288122, vm_page_unwire()
has returned TRUE when the wire count transitions to zero, eliminating
the need for callers to inspect the page's wire count.

MFC after: 1 week

6 years agoSmall style(9) issue: spaces vs TAB.
Pedro F. Giffuni [Sun, 24 Sep 2017 20:57:03 +0000 (20:57 +0000)]
Small style(9) issue: spaces vs TAB.

6 years agoChange a panic to an error return.
Rick Macklem [Sun, 24 Sep 2017 20:05:48 +0000 (20:05 +0000)]
Change a panic to an error return.

There was a panic() in the NFS server's write operation that didn't
need to be a panic() and could just be an error return.
This patch makes that change.
Found by code inspection during development of the pNFS service.

MFC after: 2 weeks

6 years agog_resize_provider_event: Do not invoke orphan method twice
Conrad Meyer [Sun, 24 Sep 2017 19:59:26 +0000 (19:59 +0000)]
g_resize_provider_event: Do not invoke orphan method twice

Like r266444, g_resize_provider_event can attempt to orphan an already
orphaned geom_dev consumer.  This will cause a panic in g_dev_orphan.  Apply
the same fix as was applied to g_orphan_register.

Reviewed by: ae
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12469

6 years agoRemove 0 filling from nfsm_uiombuflist().
Rick Macklem [Sun, 24 Sep 2017 19:43:31 +0000 (19:43 +0000)]
Remove 0 filling from nfsm_uiombuflist().

nfsm_uiombuflist() zero filled the mbuf list to a multiple of 4bytes
as required for XDR. Unfortunately that modified an mbuf list after
it was m_copym()'d and was broken. This patch removes the zero filling code.
Since nfsm_uiombuflist() is not yet used in head/current, this has no
effect on users.
The function will be used by a future commit of code that adds Flex
File Layout support.

6 years agoOptimize vm_page_try_to_free(). Specifically, the call to pmap_remove_all()
Alan Cox [Sun, 24 Sep 2017 16:50:10 +0000 (16:50 +0000)]
Optimize vm_page_try_to_free().  Specifically, the call to pmap_remove_all()
can be avoided when the page's containing object has a reference count of
zero.  (If the object has a reference count of zero, then none of its pages
can possibly be mapped.)

Address nearby style issues in vm_page_try_to_free(), and change its
return type to "bool".

Reviewed by: kib, markj
MFC after: 1 week

6 years agoAdd myself to the calendar.freebsd
Fedor Uporov [Sun, 24 Sep 2017 14:36:01 +0000 (14:36 +0000)]
Add myself to the calendar.freebsd

Reviewed by:    pfg (mentor)
Approved by:    pfg (mentor)

6 years agoFix packages with interactive post install scripts.
Warner Losh [Sun, 24 Sep 2017 14:22:36 +0000 (14:22 +0000)]
Fix packages with interactive post install scripts.

Tell pkg(8) we're running non-interactively so packages that with
interactive post install scripts don't hang.

Submitted by: Guido van Rooij

6 years agoRemove the VIRT kernel config, it's now useable through GENERIC.
Andrew Turner [Sun, 24 Sep 2017 13:28:24 +0000 (13:28 +0000)]
Remove the VIRT kernel config, it's now useable through GENERIC.

Sponsored by: DARPA, AFRL

6 years agoAdd the ability to report and set debug flags as text strings instead of
Scott Long [Sun, 24 Sep 2017 13:14:50 +0000 (13:14 +0000)]
Add the ability to report and set debug flags as text strings instead of
just integer flags.  Report both for convenience.

Submitted by: Eygene Ryabinkin (manpage)
Sponsored by: Netflix

6 years agoAdd i.MX6 and Xilinx to GENERIC.
Andrew Turner [Sun, 24 Sep 2017 09:33:08 +0000 (09:33 +0000)]
Add i.MX6 and Xilinx to GENERIC.

Merge in the missing devices from the IMX6 and ZEDBOARD kernel configs. The
Freescale sdma device has been renamed to fslsdma to mark it as a platform
specific driver.

Reviewed by: ian
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11564

6 years agoRename sdhci_cam_start_slot() into sdhci_start_slot()
Ilya Bakulin [Sun, 24 Sep 2017 09:05:35 +0000 (09:05 +0000)]
Rename sdhci_cam_start_slot() into sdhci_start_slot()

This change allows to just call sdhci_start_slot() in SDHCI drivers
and not to think about which stack handles the operation.

As a side effect, this will also fix MMCCAM with sdhci_acpi driver.

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

6 years agoDon't display empty error context.
Warner Losh [Sun, 24 Sep 2017 05:04:06 +0000 (05:04 +0000)]
Don't display empty error context.

Context extraction didn't handle this case and showed uninitialized memory.

Obtained from: OpenBSD lib.c 1.21
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D12379

6 years agoFix %c for floating values that become 0 when coerced to int.
Warner Losh [Sun, 24 Sep 2017 05:04:02 +0000 (05:04 +0000)]
Fix %c for floating values that become 0 when coerced to int.

Obtained from: OpenBSD run.c 1.36 (From Jeremy Devenport)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D12379

6 years agoFix uninitialized variable
Warner Losh [Sun, 24 Sep 2017 05:03:57 +0000 (05:03 +0000)]
Fix uninitialized variable

echo | awk 'BEGIN {i=$1; print i}' prints a boatload of stack
garbage. NUL terminate the memory returned from malloc to prevent it.

Obtained from: OpenBSD run.c 1.40
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D12379

6 years agoFix typo from r323945.
Cy Schubert [Sun, 24 Sep 2017 03:33:26 +0000 (03:33 +0000)]
Fix typo from r323945.

Reported by: Gary Jennejohn <gljennjohn@gmail.com>
Point hat to: cy (me)

6 years agoSince the page "frame" doesn't belong to a vm object, it can't be paged
Alan Cox [Sun, 24 Sep 2017 02:50:59 +0000 (02:50 +0000)]
Since the page "frame" doesn't belong to a vm object, it can't be paged
out.  Since it can't be paged out, it is never actually enqueued in a
paging queue.  Nonetheless, passing PQ_INACTIVE to vm_page_unwire()
creates the appearance that the page "frame" is being enqueued in the
inactive queue.  As of r288122, we can avoid this false impression by
passing PQ_NONE.

MFC after: 1 week

6 years agoConvert some idioms over to py3k-compatible idioms
Enji Cooper [Sun, 24 Sep 2017 00:14:48 +0000 (00:14 +0000)]
Convert some idioms over to py3k-compatible idioms

- Import print_function from __future__ and use print(..) instead of `print ..`.
- Use repr instead of backticks when the object needs to be dumped, unless
  print(..) can do it lazily. Use str instead of backticks as appropriate
  for simplification reasons.

This doesn't fully convert these modules over py3k. It just gets over some of
the trivial compatibility hurdles.

6 years agoAdd myself as src committer.
Fedor Uporov [Sat, 23 Sep 2017 19:49:12 +0000 (19:49 +0000)]
Add myself as src committer.

Approved by:    pfg (mentor)

6 years agoddb(4): Add 'show badstacks' command to show witness badstacks
Conrad Meyer [Sat, 23 Sep 2017 17:48:49 +0000 (17:48 +0000)]
ddb(4): Add 'show badstacks' command to show witness badstacks

Add a DDB command that mirrors sysctl debug.witness.badstacks.

Reapply r323935 after fixing trivial deficiency.  I forgot to compile with
WITNESS enabled.  Thanks emaste@ for fixing the build while I was asleep.

Reported by: rstone
Reviewed by: rstone (previous version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12468

6 years agobnxt: Choose better HW LRO defaults for performance
Stephen Hurd [Sat, 23 Sep 2017 16:59:37 +0000 (16:59 +0000)]
bnxt: Choose better HW LRO defaults for performance

1) Choose correct Firmware options for HW LRO for best performance
2) Delete TBD and other comments which are not required.
3) Added sysctl interface to enable / disable / modify different factors
   of HW LRO.
4) Disabled HW LRO by default to avoid issues with packet forwarding

This allows much better control over the LRO configuration via sysctls, and
uses much better defaults.  Hardware LRO can now be enabled/disabled
independantly from the software LRO, and the tuning parameters are exposed.

manpage updates coming soon.

Submitted by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Reviewed by: shurd, sbruno
Approved by: sbruno (mentor)
Sponsored by: Broadcom Limited
Differential Revision: https://reviews.freebsd.org/D12223

6 years agoHave ifmp_ring_enqueue() abdicate instead of switch to a consumer
Stephen Hurd [Sat, 23 Sep 2017 16:46:30 +0000 (16:46 +0000)]
Have ifmp_ring_enqueue() abdicate instead of switch to a consumer

Move TX out of the enqueue() path. As a result, we need
to have ifmp_ring_check_drainage() pick up from the abdicate state.

We also need to either enqueue the TX task, or check drainage
after calling ifmp_ring_enqueue() to ensure it's sent.

This change results in a 30% small packet forwarding improvement.

Reviewed by: olivier, sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12439

6 years agoAfter the r317886 support for TFTP and NFS can be enable simultaneously.
Mariusz Zaborski [Sat, 23 Sep 2017 12:44:42 +0000 (12:44 +0000)]
After the r317886 support for TFTP and NFS can be enable simultaneously.

The cleanup of this distinction was done in the r318988, but this Makefile
was omitted.

Submitted by: kczekirda@

6 years agoRevert r323935 as it broke the build
Ed Maste [Sat, 23 Sep 2017 12:35:46 +0000 (12:35 +0000)]
Revert r323935 as it broke the build

subr_witness.c:2577:4: error: use of undeclared identifier 'req'
                        req->oldidx = 0;
                        ^

6 years agoGarbage collect usued fields
Scott Long [Sat, 23 Sep 2017 08:26:42 +0000 (08:26 +0000)]
Garbage collect usued fields

Sponsored by: Netflix

6 years agoCorrect two misspellings. Also align */.
Cy Schubert [Sat, 23 Sep 2017 06:00:17 +0000 (06:00 +0000)]
Correct two misspellings. Also align */.

6 years agoMake struct grouptask gt_name member a char array
Stephen Hurd [Sat, 23 Sep 2017 01:39:16 +0000 (01:39 +0000)]
Make struct grouptask gt_name member a char array

Previously, it was just a pointer which was copied, but
some callers pass in a stack variable which will go out of scope.
Add GROUPTASK_NAMELEN macro (32) and snprintf() the name into it,
using "grouptask" if name is NULL. We can now safely include
gtask->gt_name in console messages.

Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12449

6 years agoMake the rx budget a tunable
Stephen Hurd [Sat, 23 Sep 2017 01:37:01 +0000 (01:37 +0000)]
Make the rx budget a tunable

This allows tuning the rx budget for special load profiles
as well as more easily testing to determine sane defaults.

Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12445

6 years agoChain mbufs before passing to if_input()
Stephen Hurd [Sat, 23 Sep 2017 01:35:14 +0000 (01:35 +0000)]
Chain mbufs before passing to if_input()

Build a list of mbufs to pass to if_input() after LRO. Results in
12% small packet forwarding rate improvement.

Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12444

6 years agoSome small packet performance improvements
Stephen Hurd [Sat, 23 Sep 2017 01:33:20 +0000 (01:33 +0000)]
Some small packet performance improvements

If the packet is smaller than MTU, disable the TSO flags.
Move TCP header parsing inside the IS_TSO?() test.
Add a new IFLIB_NEED_ZERO_CSUM flag to indicate the checksums need to be zeroed before TX.

Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12442

6 years agoddb(4): Add 'show badstacks' command to show witness badstacks
Conrad Meyer [Fri, 22 Sep 2017 20:01:12 +0000 (20:01 +0000)]
ddb(4): Add 'show badstacks' command to show witness badstacks

Add a DDB command that mirrors sysctl debug.witness.badstacks.

Reported by: rstone
Reviewed by: rstone
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12468

6 years agoDetect NEON and set HWCAP_NEON if present.
John Baldwin [Fri, 22 Sep 2017 17:58:57 +0000 (17:58 +0000)]
Detect NEON and set HWCAP_NEON if present.

Reviewed by: andrew, ian
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12389

6 years agoCorrect HWCAP_VFP3* values to match Linux.
John Baldwin [Fri, 22 Sep 2017 17:57:38 +0000 (17:57 +0000)]
Correct HWCAP_VFP3* values to match Linux.

Reviewed by: andrew, ian
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12388

6 years agoFix 32bit build.
Konstantin Belousov [Fri, 22 Sep 2017 16:42:41 +0000 (16:42 +0000)]
Fix 32bit build.

Reported by: emaste
Sponsored by: The FreeBSD Foundation

6 years agoRevert r323812 from release/tools/arm.subr, which has broken the
Glen Barber [Fri, 22 Sep 2017 14:34:27 +0000 (14:34 +0000)]
Revert r323812 from release/tools/arm.subr, which has broken the
build on arm/armv6 images.

Pointyhat: gjb (myself)
MFC after: immediate
MFC note: releng/10.4 has broken because of this
Sponsored by: The FreeBSD Foundation

6 years agoContinuing efforts to provide hardening of FFS, this change adds a
Kirk McKusick [Fri, 22 Sep 2017 12:45:15 +0000 (12:45 +0000)]
Continuing efforts to provide hardening of FFS, this change adds a
check hash to cylinder groups. If a check hash fails when a cylinder
group is read, no further allocations are attempted in that cylinder
group until it has been fixed by fsck. This avoids a class of
filesystem panics related to corrupted cylinder group maps. The
hash is done using crc32c.

Check hases are added only to UFS2 and not to UFS1 as UFS1 is primarily
used in embedded systems with small memories and low-powered processors
which need as light-weight a filesystem as possible.

Specifics of the changes:

sys/sys/buf.h:
    Add BX_FSPRIV to reserve a set of eight b_xflags that may be used
    by individual filesystems for their own purpose. Their specific
    definitions are found in the header files for each filesystem
    that uses them. Also add fields to struct buf as noted below.

sys/kern/vfs_bio.c:
    It is only necessary to compute a check hash for a cylinder
    group when it is actually read from disk. When calling bread,
    you do not know whether the buffer was found in the cache or
    read. So a new flag (GB_CKHASH) and a pointer to a function to
    perform the hash has been added to breadn_flags to say that the
    function should be called to calculate a hash if the data has
    been read. The check hash is placed in b_ckhash and the B_CKHASH
    flag is set to indicate that a read was done and a check hash
    calculated. Though a rather elaborate mechanism, it should
    also work for check hashing other metadata in the future. A
    kernel internal API change was to change breada into a static
    fucntion and add flags and a function pointer to a check-hash
    function.

sys/ufs/ffs/fs.h:
    Add flags for types of check hashes; stored in a new word in the
    superblock. Define corresponding BX_ flags for the different types
    of check hashes. Add a check hash word in the cylinder group.

sys/ufs/ffs/ffs_alloc.c:
    In ffs_getcg do the dance with breadn_flags to get a check hash and
    if one is provided, check it.

sys/ufs/ffs/ffs_vfsops.c:
    Copy across the BX_FFSTYPES flags in background writes.
    Update the check hash when writing out buffers that need them.

sys/ufs/ffs/ffs_snapshot.c:
    Recompute check hash when updating snapshot cylinder groups.

sys/libkern/crc32.c:
lib/libufs/Makefile:
lib/libufs/libufs.h:
lib/libufs/cgroup.c:
    Include libkern/crc32.c in libufs and use it to compute check
    hashes when updating cylinder groups.

Four utilities are affected:

sbin/newfs/mkfs.c:
    Add the check hashes when building the cylinder groups.

sbin/fsck_ffs/fsck.h:
sbin/fsck_ffs/fsutil.c:
    Verify and update check hashes when checking and writing cylinder groups.

sbin/fsck_ffs/pass5.c:
    Offer to add check hashes to existing filesystems.
    Precompute check hashes when rebuilding cylinder group
    (although this will be done when it is written in fsutil.c
    it is necessary to do it early before comparing with the old
    cylinder group)

sbin/dumpfs/dumpfs.c
    Print out the new check hash flag(s)

sbin/fsdb/Makefile:
    Needs to add libufs now used by pass5.c imported from fsck_ffs.

Reviewed by: kib
Tested by: Peter Holm (pho)

6 years agoClean up error messages related to device discovery
Scott Long [Fri, 22 Sep 2017 12:07:03 +0000 (12:07 +0000)]
Clean up error messages related to device discovery

Sponsored by: Netflix

6 years agoMFV r323917: 8648 Fix range locking in ZIL commit codepath
Andriy Gapon [Fri, 22 Sep 2017 08:27:27 +0000 (08:27 +0000)]
MFV r323917: 8648 Fix range locking in ZIL commit codepath

illumos/illumos-gate@42b14111721da2ebd5159e7b45012a3eb0e3384c
https://github.com/illumos/illumos-gate/commit/42b14111721da2ebd5159e7b45012a3eb0e3384c

https://www.illumos.org/issues/8648
  I'm opening this bug to track integration of the following ZFS on Linux
  commit into illumos:

  commit f763c3d1df569a8d6b60bcb5e95cf07aa7a189e6
  Author: LOLi <loli10K@users.noreply.github.com>
  Date:   Mon Aug 21 17:59:48 2017 +0200

      Fix range locking in ZIL commit codepath

      Since OpenZFS 7578 (1b7c1e5) if we have a ZVOL with logbias=throughput
      we will force WR_INDIRECT itxs in zvol_log_write() setting itx->itx_lr
      offset and length to the offset and length of the BIO from
      zvol_write()->zvol_log_write(): these offset and length are later used
      to take a range lock in zillog->zl_get_data function: zvol_get_data().

      Now suppose we have a ZVOL with blocksize=8K and push 4K writes to
      offset 0: we will only be range-locking 0-4096. This means the
      ASSERTion we make in dbuf_unoverride() is no longer valid because now
      dmu_sync() is called from zilog's get_data functions holding a partial
      lock on the dbuf.

      Fix this by taking a range lock on the whole block in zvol_get_data().

Reviewed-by: Chunwei Chen <tuxoko@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Alexander Motin <mav@FreeBSD.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: LOLi <loli10K@users.noreply.github.com>

MFC after: 10 days

6 years ago8648 Fix range locking in ZIL commit codepath
Andriy Gapon [Fri, 22 Sep 2017 08:23:24 +0000 (08:23 +0000)]
8648 Fix range locking in ZIL commit codepath

illumos/illumos-gate@42b14111721da2ebd5159e7b45012a3eb0e3384c
https://github.com/illumos/illumos-gate/commit/42b14111721da2ebd5159e7b45012a3eb0e3384c

https://www.illumos.org/issues/8648
  I'm opening this bug to track integration of the following ZFS on Linux
  commit into illumos:

  commit f763c3d1df569a8d6b60bcb5e95cf07aa7a189e6
  Author: LOLi <loli10K@users.noreply.github.com>
  Date:   Mon Aug 21 17:59:48 2017 +0200

      Fix range locking in ZIL commit codepath

      Since OpenZFS 7578 (1b7c1e5) if we have a ZVOL with logbias=throughput
      we will force WR_INDIRECT itxs in zvol_log_write() setting itx->itx_lr
      offset and length to the offset and length of the BIO from
      zvol_write()->zvol_log_write(): these offset and length are later used
      to take a range lock in zillog->zl_get_data function: zvol_get_data().

      Now suppose we have a ZVOL with blocksize=8K and push 4K writes to
      offset 0: we will only be range-locking 0-4096. This means the
      ASSERTion we make in dbuf_unoverride() is no longer valid because now
      dmu_sync() is called from zilog's get_data functions holding a partial
      lock on the dbuf.

      Fix this by taking a range lock on the whole block in zvol_get_data().

Reviewed-by: Chunwei Chen <tuxoko@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Alexander Motin <mav@FreeBSD.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: LOLi <loli10K@users.noreply.github.com>

6 years agoExtend sysctl description for hw.usb.disable_enumeration .
Hans Petter Selasky [Fri, 22 Sep 2017 08:21:35 +0000 (08:21 +0000)]
Extend sysctl description for hw.usb.disable_enumeration .

PR: 222505
Submitted by: Julian H. Stacey <jhs@berklix.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoMFV r323914: 8661 remove "zil-cw2" dtrace probe
Andriy Gapon [Fri, 22 Sep 2017 08:21:14 +0000 (08:21 +0000)]
MFV r323914: 8661 remove "zil-cw2" dtrace probe

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

https://www.illumos.org/issues/8661
  The "zil-cw1" dtrace probe was previously removed in 8558, and the "zil-cw2"
  probe should have been removed in that patch as well. Unfortunately, the "zil-
  cw2" was not removed in 8558, so this bug is to track it's removal.

Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>

MFC after: 1 week

6 years ago8661 remove "zil-cw2" dtrace probe
Andriy Gapon [Fri, 22 Sep 2017 08:18:49 +0000 (08:18 +0000)]
8661 remove "zil-cw2" dtrace probe

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

https://www.illumos.org/issues/8661
  The "zil-cw1" dtrace probe was previously removed in 8558, and the "zil-cw2"
  probe should have been removed in that patch as well. Unfortunately, the "zil-
  cw2" was not removed in 8558, so this bug is to track it's removal.

Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>

6 years ago8600 ZFS channel programs - snapshot
Andriy Gapon [Fri, 22 Sep 2017 08:18:05 +0000 (08:18 +0000)]
8600 ZFS channel programs - snapshot

illumos/illumos-gate@2840dce1a029098fb784afd951d5f98089f850d8
https://github.com/illumos/illumos-gate/commit/2840dce1a029098fb784afd951d5f98089f850d8

https://www.illumos.org/issues/8600
  ZFS channel programs should be able to create snapshots.
  In addition to the base snapshot functionality, this will likely entail adding
  extra logic to handle edge cases which were formerly not possible, such as
  creating then destroying a snapshot in the same transaction sync.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Chris Williamson <chris.williamson@delphix.com>

6 years ago8592 ZFS channel programs - rollback
Andriy Gapon [Fri, 22 Sep 2017 08:15:35 +0000 (08:15 +0000)]
8592 ZFS channel programs - rollback

illumos/illumos-gate@000cce6b6fad4a8b0eecef6e1251f6aca1719c55
https://github.com/illumos/illumos-gate/commit/000cce6b6fad4a8b0eecef6e1251f6aca1719c55

https://www.illumos.org/issues/8592
  ZFS channel programs should be able to perform a rollback. This logic will
  probably look pretty similar to zfs.sync.destroy().

Reviewed by: Chris Williamson <chris.williamson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Brad Lewis <brad.lewis@delphix.com>

6 years ago8502 illumos#7955 broke delegated datasets when libshare is not present
Andriy Gapon [Fri, 22 Sep 2017 08:13:09 +0000 (08:13 +0000)]
8502 illumos#7955 broke delegated datasets when libshare is not present

illumos/illumos-gate@1c18e8fbd8db41a9fb39bd3ef7a18ee71ece20da
https://github.com/illumos/illumos-gate/commit/1c18e8fbd8db41a9fb39bd3ef7a18ee71ece20da

https://www.illumos.org/issues/8502
  The code in lib/libzfs/common/libzfs_mount.c already basically handles
  the case when libshare is not installed. We just need to not fail in
  zfs_init_libshare_impl.  I tested this in lx and things work as
  expected. I also tested there trying to set sharenfs and sharesmb on
  the delegated dataset. Neither is allowed from within a zone.  The
  spew of msgs from a native zone is not ZFS specific. I see the same
  spew simply running the share command.

Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Yuri Pankov <yuripv@gmx.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Jerry Jelinek <jerry.jelinek@joyent.com>

6 years agoAdd support for 32-bit compatibility IOCTLs in the LinuxKPI.
Hans Petter Selasky [Fri, 22 Sep 2017 08:12:08 +0000 (08:12 +0000)]
Add support for 32-bit compatibility IOCTLs in the LinuxKPI.

Bump the FreeBSD version to force recompilation of external
kernel modules due to structure change.

PR: 222504
Submitted by: Greg V <greg@unrelenting.technology>
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agolibefi: define EISA PNP constants
Toomas Soome [Fri, 22 Sep 2017 07:44:36 +0000 (07:44 +0000)]
libefi: define EISA PNP constants

Define EISA PNP constants and use them, also fix ID for 0x701

6 years agolibefi: efipart_hdinfo_add_filepath should check strtol result
Toomas Soome [Fri, 22 Sep 2017 07:40:05 +0000 (07:40 +0000)]
libefi: efipart_hdinfo_add_filepath should check strtol result

Use errno for error checking.

6 years agolibefi: efipart.c cstyle fix for efipart_print_common()
Toomas Soome [Fri, 22 Sep 2017 07:37:42 +0000 (07:37 +0000)]
libefi: efipart.c cstyle fix for efipart_print_common()

The else statement should have { }

6 years agolibefi: efipart_strategy() should return ENXIO when there is no media
Toomas Soome [Fri, 22 Sep 2017 07:34:08 +0000 (07:34 +0000)]
libefi: efipart_strategy() should return ENXIO when there is no media

We should return ENXIO to indicate the situation with device present,
but no media.

6 years agolibefi: pdinfo_t pd_unit and pd_open should be unsigned
Toomas Soome [Fri, 22 Sep 2017 07:29:26 +0000 (07:29 +0000)]
libefi: pdinfo_t pd_unit and pd_open should be unsigned

The device index, partition index and reference counter are all positive
numbers. However, since our internal partition number may be negative
to indicate GPT table, the compare expression need to take care when comparing
pdinfo_t and partition data.

6 years agoAdd missing locking. Found by Coverity while scanning the usrsctp
Michael Tuexen [Fri, 22 Sep 2017 06:33:01 +0000 (06:33 +0000)]
Add missing locking. Found by Coverity while scanning the usrsctp
library.

MFC after: 1 week

6 years agoAdd missing socket lock.
Michael Tuexen [Fri, 22 Sep 2017 06:07:47 +0000 (06:07 +0000)]
Add missing socket lock.

MFC after: 1 week

6 years agocryptotest.py: Like r323869, skip SHA HMAC tests on non-SHA drivers
Conrad Meyer [Fri, 22 Sep 2017 04:41:48 +0000 (04:41 +0000)]
cryptotest.py: Like r323869, skip SHA HMAC tests on non-SHA drivers

Sponsored by: Dell EMC Isilon

6 years agocryptotest.py: Fix whitespace style errors
Conrad Meyer [Fri, 22 Sep 2017 04:25:44 +0000 (04:25 +0000)]
cryptotest.py: Fix whitespace style errors

I accidentally introduced different whitespace style in r323878.  I'm not
used to using tabs for indentation in Python scripts.

Whitespace only; no functional change.

Sponsored by: Dell EMC Isilon

6 years agoefilib.h: typo in structure member description
Toomas Soome [Fri, 22 Sep 2017 02:58:47 +0000 (02:58 +0000)]
efilib.h: typo in structure member description

The link should be replaced by list.

6 years agor323885 did miss efilib.h update
Toomas Soome [Fri, 22 Sep 2017 02:56:26 +0000 (02:56 +0000)]
r323885 did miss efilib.h update

The efilib.h update was left out from r323885 by mistake.

6 years agolibefi: efi_devpath_match local len should be unsigned
Toomas Soome [Fri, 22 Sep 2017 02:53:01 +0000 (02:53 +0000)]
libefi: efi_devpath_match local len should be unsigned

DevicePathNodeLength() will always return unsigned value.

6 years agocam iosched: Bettar account IOPS for smoother performance
Warner Losh [Fri, 22 Sep 2017 02:36:36 +0000 (02:36 +0000)]
cam iosched: Bettar account IOPS for smoother performance

Prevent cam_iosched_iops_tick() from discarding 'unspent' ios unless
it's a new accounting interval.

Previously ios that weren't used between ticks were lost, as a result
the iops limiter could enforce a limit below the configured maximum.

Obtained from: ElectroBSD
Submitted by: Fabian Keil
PR: 221974

6 years agocam iosched: Enforce iop limits below the quanta value
Warner Losh [Fri, 22 Sep 2017 02:36:32 +0000 (02:36 +0000)]
cam iosched: Enforce iop limits below the quanta value

Previously the iops limiter would always allow at least
quanta ios per second as cam_iosched_iops_tick() never set
ios->l_value1 below 1.

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

6 years agoSupport AEAD requests with non-GCM algorithms.
John Baldwin [Fri, 22 Sep 2017 00:34:46 +0000 (00:34 +0000)]
Support AEAD requests with non-GCM algorithms.

In particular, support chaining an AES cipher with an HMAC for a request
including AAD.  This permits submitting requests from userland to encrypt
objects like IPSec packets using these algorithms.

In the non-GCM case, the authentication crypto descriptor covers both the
AAD and the ciphertext.  The GCM case remains unchanged.  This matches
the requests created internally in IPSec.  For the non-GCM case, the
COP_F_CIPHER_FIRST is also supported since the ordering matters.

Note that while this can be used to simulate IPSec requests from userland,
this ioctl cannot currently be used to perform TLS requests using AES-CBC
and MAC-before-encrypt.

Reviewed by: cem
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D11759

6 years agoAdd a new COP_F_CIPHER_FIRST flag for struct crypt_op.
John Baldwin [Fri, 22 Sep 2017 00:21:58 +0000 (00:21 +0000)]
Add a new COP_F_CIPHER_FIRST flag for struct crypt_op.

This requests that the cipher be performed before rather than after
the HMAC when both are specified for a single operation.

Reviewed by: cem
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D11757

6 years agoPlace the AAD before the plaintext/ciphertext for CIOCRYPTAEAD.
John Baldwin [Fri, 22 Sep 2017 00:15:54 +0000 (00:15 +0000)]
Place the AAD before the plaintext/ciphertext for CIOCRYPTAEAD.

Software crypto implementations don't care how the buffer is laid out,
but hardware implementations may assume that the AAD is always before
the plain/cipher text and that the hash/tag is immediately after the end
of the plain/cipher text.

In particular, this arrangement matches the layout of both IPSec packets
and TLS frames.  Linux's crypto framework also assumes this layout for
AEAD requests.

Reviewed by: cem
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D11758

6 years agoFix undeclared identifier error introduced in r323879
Stephen Hurd [Thu, 21 Sep 2017 23:27:35 +0000 (23:27 +0000)]
Fix undeclared identifier error introduced in r323879

It doesn't appear to be safe to use gtask->gt_name.

Reported by: Mark Johnston, Jenkins
Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12448

6 years agolibefi: efipart.c should use calloc()
Toomas Soome [Thu, 21 Sep 2017 23:22:18 +0000 (23:22 +0000)]
libefi: efipart.c should use calloc()

The device specific *_add functions are using malloc() + memset,
should use calloc instead.

6 years agolibefi: efi_devpath_match() should return bool
Toomas Soome [Thu, 21 Sep 2017 23:14:07 +0000 (23:14 +0000)]
libefi: efi_devpath_match() should return bool

The current implementation of efi_devpath_match() is returning values 0 or 1,
so it should be updated to return bool.

6 years agoAlways create usr/local/etc -> /etc/local symlink
Warner Losh [Thu, 21 Sep 2017 23:10:56 +0000 (23:10 +0000)]
Always create usr/local/etc -> /etc/local symlink

/usr/local/etc gets created and populated by packages. However, if no
packages are installed when setup_nanobsd is run, this symlink won't
get created, causing problems if packages are installed later (say on
first boot). Therefore, always create the symlink and etc/local. It
does no harm and may help.

Inspired by crochet issue #183 (consuingly says NanoBSD, means crochet)
Sponsored by: Netflix

6 years agoOnly handle _PC_MAX_CANON, _PC_MAX_INPUT, and _PC_VDISABLE for TTY devices.
John Baldwin [Thu, 21 Sep 2017 23:05:32 +0000 (23:05 +0000)]
Only handle _PC_MAX_CANON, _PC_MAX_INPUT, and _PC_VDISABLE for TTY devices.

Move handling of these three pathconf() variables out of vop_stdpathconf()
and into devfs_pathconf() as TTY devices can only be devfs files.  In
addition, only return settings for these three variables for devfs devices
whose device switch has the D_TTY flag set.

Discussed with: bde, kib
Sponsored by: Chelsio Communications

6 years agoUse UFS_LINK_MAX instead of LINK_MAX.
John Baldwin [Thu, 21 Sep 2017 22:33:59 +0000 (22:33 +0000)]
Use UFS_LINK_MAX instead of LINK_MAX.

Submitted by: bde
Sponsored by: Chelsio Communications

6 years agoSimplify i915_gem_wire_page() and avoid unneeded page-busying.
Mark Johnston [Thu, 21 Sep 2017 22:15:45 +0000 (22:15 +0000)]
Simplify i915_gem_wire_page() and avoid unneeded page-busying.

Reviewed by: alc, kib
MFC after: 1 week

6 years agoImproved logging of gtaskqueue failues
Stephen Hurd [Thu, 21 Sep 2017 21:14:48 +0000 (21:14 +0000)]
Improved logging of gtaskqueue failues

Check the return code of intr_setaffinity() and log any errors
it returns. When a qid is not located, log an error before returning
failure.  Also, use __func__ rather than hardcoding the function name

Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12436

6 years agocryptotest.py: Actually use NIST-KAT HMAC test vectors and test the right hashes
Conrad Meyer [Thu, 21 Sep 2017 21:07:21 +0000 (21:07 +0000)]
cryptotest.py: Actually use NIST-KAT HMAC test vectors and test the right hashes

Previously, this test was entirely a no-op as no vector in the NIST-KAT file
has a precisely 20-byte key.

Additionally, not every vector in the file is SHA1.  The length field
determines the hash under test, and is now decoded correctly.

Finally, due to a limitation I didn't feel like fixing in cryptodev.py, MACs
are truncated to 16 bytes in this test.

With this change and the uncommitted D12437 (to allow key sizes other than
those used in IPSec), the SHA tests in cryptotest.py actually test something
and e.g. at least cryptosoft passes the test.

Sponsored by: Dell EMC Isilon

6 years agoFix M_GTASKQUEUE definition
Stephen Hurd [Thu, 21 Sep 2017 20:34:33 +0000 (20:34 +0000)]
Fix M_GTASKQUEUE definition

Previously had the same short and long description as taskqueues.
This could cause problems with memguard(9) and vmstat -m which use
the short description as a unique identifier.

Reviewed by: sbruno
Approved by: sbruno (mentor)
MFC after: 3 days
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12438

6 years agobnxt: Fix driver when attached to a VF
Stephen Hurd [Thu, 21 Sep 2017 20:27:43 +0000 (20:27 +0000)]
bnxt: Fix driver when attached to a VF

- Use HWRM_FUNC_VF_CFG instead of HWRM_FUNC_CFG on VFs
- Fix NPAR/VF detection
- Clean up flag definitions
- Don't allow WoL on VFs

Although the bnxt driver doesn't support SR-IOV so can create VFs yet,
the PF could be running Linux or ESCi with a VF passed through to a
FreeBSD guest.  This fixes the driver for that use case.

Submitted by: Siva Kallam <siva.kallam@@broadcom.com>
Reviewed by: shurd, sbruno
Approved by: sbruno (mentor)
Sponsored by: Broadcom Limited
Differential Revision: https://reviews.freebsd.org/D12410

6 years agoUnprotected modification of ng_iface(4) private data leads to kernel panic.
Eugene Grosbein [Thu, 21 Sep 2017 20:16:10 +0000 (20:16 +0000)]
Unprotected modification of ng_iface(4) private data leads to kernel panic.
Fix a race with per-node read-mostly lock and refcounting for a hook.

PR: 220076
Tested by: peixoto.cassiano
Approved by: avg (mentor), mav (mentor)
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D12435

6 years agocryptotest.py: Do not run AES-CBC or AES-GCM tests on non-AES crypto(4) drivers
Conrad Meyer [Thu, 21 Sep 2017 18:06:21 +0000 (18:06 +0000)]
cryptotest.py: Do not run AES-CBC or AES-GCM tests on non-AES crypto(4) drivers

For some reason, we only skipped AES-XTS tests if a driver was not in the
aesmodules list.  Skip other AES modes as well to prevent spurious failures
in non-AES drivers.

Sponsored by: Dell EMC Isilon

6 years agoModernize calls to vm_page_unwire(). As of r288122, vm_page_unwire()
Alan Cox [Thu, 21 Sep 2017 15:32:41 +0000 (15:32 +0000)]
Modernize calls to vm_page_unwire().  As of r288122, vm_page_unwire()
accepts PQ_NONE as the specified queue and returns a Boolean indicating
whether the page's wire count transitioned to zero.  Use these features
in dev/drm2.

Reviewed by: kib, markj
MFC after: 1 week

6 years agolibefi: devicename.c cleanups
Toomas Soome [Thu, 21 Sep 2017 15:30:20 +0000 (15:30 +0000)]
libefi: devicename.c cleanups

Remove duplicated free()+return statements, default unit to 0
and improve strtol error processing.

6 years agoWe use a few different ifdef's names to check if we are using Casper or not,
Mariusz Zaborski [Thu, 21 Sep 2017 14:41:41 +0000 (14:41 +0000)]
We use a few different ifdef's names to check if we are using Casper or not,
let's standardize this. Now we are always use WITH_CASPER name.

Discussed with: emaste@
MFC after: 1 month

6 years agoAmmend bin/cat/cat.c so the output is the same aside
Sevan Janiyan [Thu, 21 Sep 2017 14:14:49 +0000 (14:14 +0000)]
Ammend bin/cat/cat.c so the output is the same aside
from blank lines being numbered or unnumbered, depending on whether cat
was invoked with -ne or -be.

At present, when cat is invoked with -be, there is an aditional
difference that the '$' on blank lines is placed on the far left of the
output.

Discussed in bug 210607.

While here, revert the workaround from r304035 which skipped the unit test for
this issue previously.

PR: 210607
Submitted by: myself
Reviewed by: bdrewery
Obtained from: NetBSD
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D12432

6 years agobridge: Set module version
Kristof Provost [Thu, 21 Sep 2017 14:14:01 +0000 (14:14 +0000)]
bridge: Set module version

This ensures that the loader will not load the module if it's also built in to
the kernel.

PR: 220860
Submitted by: Eugene Grosbein <eugen@freebsd.org>
Reported by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>

6 years agoCode cleanup, no functional change.
Michael Tuexen [Thu, 21 Sep 2017 11:56:31 +0000 (11:56 +0000)]
Code cleanup, no functional change.

MFC after: 1 week

6 years agoPlug memory leak in case when nvlist allocation succeeds, but nvpair
Mariusz Zaborski [Thu, 21 Sep 2017 10:28:22 +0000 (10:28 +0000)]
Plug memory leak in case when nvlist allocation succeeds, but nvpair
allocation fails.

Submitted by: pjd@
MFC after: 1 month
Sponsored by: Wheel Systems

6 years agoSimplify the code by _not_ expecting success under 'fail'.
Mariusz Zaborski [Thu, 21 Sep 2017 10:18:02 +0000 (10:18 +0000)]
Simplify the code by _not_ expecting success under 'fail'.

Submitted by: pjd@ and oshogbo@
MFC after: 1 month
Sponsored by: Wheel Systems

6 years agoIMHO it is possible that failure will be treated as success because we don't
Mariusz Zaborski [Thu, 21 Sep 2017 10:16:44 +0000 (10:16 +0000)]
IMHO it is possible that failure will be treated as success because we don't
initialize nvp on every loop iteration and the code under 'fail'(!) label
detects success by checking of nvp != NULL.

Submitted by: pjd@
MFC after: 1 month
Sponsored by:   Wheel Systems

6 years agoFree 'value' only once we are done freeing all individual
Mariusz Zaborski [Thu, 21 Sep 2017 10:14:43 +0000 (10:14 +0000)]
Free 'value' only once we are done freeing all individual

Submitted by:   pjd@
MFC after: 1 month
Found by:       scan-build
Sponsored by:   Wheel Systems