]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMFC r325157,325158:
eugen [Mon, 6 Nov 2017 13:56:03 +0000 (13:56 +0000)]
MFC r325157,325158:

  Fix ppp(8) to add RTF_HOST flag to created host route.

Reported by: Mike Tancsa <mike@sentex.net>
Approved by: mav (mentor)

6 years agoMFC r324212:
eugen [Mon, 6 Nov 2017 12:44:26 +0000 (12:44 +0000)]
MFC r324212:

  rsh: introduce new option -N disabling shutdown of socket sending path.

PR: 205144
Approved by: mav (mentor)

6 years agoMFC r324364: ftpd(8): fix user context handling
eugen [Mon, 6 Nov 2017 11:10:43 +0000 (11:10 +0000)]
MFC r324364: ftpd(8): fix user context handling

Apply authenticated user context after update of wtmp(5) at start of session,
so that ftpd process is not killed by kernel with SIGXFSZ when user has
"filesize" limit lower than size of system wtmp file. Same applies
to session finalization: revert to super-user context before update of wtmp.

If ftpd hits limit while writing a file at user request,
do not get killed with SIGXFSZ instantly but apparently ignore the signal,
process error and report it to the user, and continue with the session.

PR: 143570
Approved by: mav (mentor)

6 years agoMFC r324928,r324929:
ngie [Sun, 5 Nov 2017 22:36:02 +0000 (22:36 +0000)]
MFC r324928,r324929:

r324928:

Remove dead stores

The return value of various snprintf calls was stored in `len` and not used
in many functions.

r324929:

Clean up trailing whitespace

6 years agoMFC r324862:
ngie [Sun, 5 Nov 2017 22:33:41 +0000 (22:33 +0000)]
MFC r324862:

Clean up trailing whitespace in kdb_thr_ctx(..)

6 years agoMFC r318432:
bdrewery [Sat, 4 Nov 2017 22:23:41 +0000 (22:23 +0000)]
MFC r318432:

  Fix some nroff syntax in rtld.1.

PR: 223420

6 years agoMFC r325051:
markj [Sat, 4 Nov 2017 16:03:48 +0000 (16:03 +0000)]
MFC r325051:
Remove a stale and incorrect comment.

6 years agoMFC r325050:
markj [Sat, 4 Nov 2017 16:03:06 +0000 (16:03 +0000)]
MFC r325050:
Remove workqueue items after updating the workqueue tail pointer.

6 years agoMFC r325067:
pfg [Sat, 4 Nov 2017 14:49:22 +0000 (14:49 +0000)]
MFC r325067:
bsnmpd: Only refresh devtree if devd event is a new or removed device.

It makes sense to refresh the tree only when a device is inserted or
removed, otherwise bsnmpd needlessly wastes lots of CPU.

PR: 209368

6 years agoMFC r325066:
pfg [Sat, 4 Nov 2017 14:44:07 +0000 (14:44 +0000)]
MFC r325066:
Fix out-of-bounds read in libc/regex.

The bug is an out-of-bounds read detected with address sanitizer that
happens when 'sp' in p_b_coll_elems() includes NUL byte[s], e.g. if it's
equal to "GS\x00". In that case len will be equal to 4, and the
strncmp(cp->name, sp, len) call will succeed when cp->name is "GS" but the
cp->name[len] == '\0' comparison will cause the read to go out-of-bounds.

Checking the length using strlen() instead eliminates the issue.

The bug was found in LLVM with oss-fuzz:
https://reviews.llvm.org/D39380

Obtained from: Vlad Tsyrklevich through posting on openbsd-tech

6 years agoMFC r323547, r323598:
pfg [Sat, 4 Nov 2017 14:35:01 +0000 (14:35 +0000)]
MFC r323547, r323598:
libedit: add missing bracket.

We never hit this because we always build with widechar support.
Raise the warning level to 3.

6 years agoMFC r324824:
kib [Sat, 4 Nov 2017 10:10:34 +0000 (10:10 +0000)]
MFC r324824:
Check that the page which is freed as zeroed, indeed has all-zero content.

6 years agoMFC r325030:
cy [Sat, 4 Nov 2017 05:17:03 +0000 (05:17 +0000)]
MFC r325030:

Remove redundant sys/cdefs.h include.

6 years agoMFC r325017: libnv: Fix strict-aliasing violation with cookie
jilles [Fri, 3 Nov 2017 22:41:31 +0000 (22:41 +0000)]
MFC r325017: libnv: Fix strict-aliasing violation with cookie

In r323851 (MFC'ed to stable/11 as r324831), some casts were adjusted in
calls to nvlist_next() and nvlist_get_pararr() in order to make scan-build
happy. I think these changes just confused scan-build into not reporting
the strict-aliasing violation.

For example, nvlist_xdescriptors() is causing nvlist_next() to write to its
local variable nvp of type nvpair_t * using the lvalue *cookiep of type
void *, which is not allowed. Given the APIs of nvlist_next(),
nvlist_get_parent() and nvlist_get_pararr(), one possible fix is to create a
local void *cookie in nvlist_xdescriptors() and other places, and to convert
the value to nvpair_t * when necessary. This patch implements that fix.

6 years agoMFC: r324774
wulf [Thu, 2 Nov 2017 21:19:17 +0000 (21:19 +0000)]
MFC: r324774
psm(4): Add sanity checks to Synaptics touchpad driver resolution parser.

This fixes "Kernel has only x or y resolution, not both" libinput error.

Reported by: Ivan <bsd@abinet.ru>
Tested by: Ivan <bsd@abinet.ru>
Approved by: gonzo (mentor)

6 years agoMFC: r324770
wulf [Thu, 2 Nov 2017 21:17:05 +0000 (21:17 +0000)]
MFC: r324770
bthidd: Fix leds on multireport keyboards broken after r297217

Reviewed by: emax, gonzo
Approved by: gonzo (mentor)
Differential Revision: https://reviews.freebsd.org/D12214

6 years agoMFC: r324772
wulf [Thu, 2 Nov 2017 21:13:24 +0000 (21:13 +0000)]
MFC: r324772
ums(4): Unreverse evdev Tilt-axis reporting to match Linux.

sysmouse tilt to button mapping remained unchanged.

Reviewed by: hselasky
Approved by: gonzo (mentor)
Differential Revision: https://reviews.freebsd.org/D12671

6 years agoMFC: r324639
rmacklem [Thu, 2 Nov 2017 20:28:53 +0000 (20:28 +0000)]
MFC: r324639
Fix the client IP address reported by nfsdumpstate for 64bit arch and NFSv4.1.

The client IP address was not being reported for some NFSv4 mounts by
nfsdumpstate. Upon investigation, two problems were found for mounts
using IPv4. One was that the code (originally written and tested on i386)
assumed that a "u_long" was a "uint32_t" and would exactly store an
IPv4 host address. Not correct for 64bit arches.
Also, for NFSv4.1 mounts, the field was not being filled in. This was
basically correct, because NFSv4.1 does not use a callback address.
However, it meant that nfsdumpstate could not report the client IP addr.
This patch should fix both of these issues.
For IPv6, the address will still not be reported. The original NFSv4 RFC
only specified IPv4 callback addresses. I think this has changed and, if so,
a future commit to fix reporting of IPv6 addresses will be needed.

6 years agoMFC: r325328
jkim [Thu, 2 Nov 2017 18:30:41 +0000 (18:30 +0000)]
MFC: r325328

Merge OpenSSL 1.0.2m.

6 years agoMFC: r307977
jkim [Thu, 2 Nov 2017 18:27:32 +0000 (18:27 +0000)]
MFC: r307977

Prefer ACFLAGS over CFLAGS for compiling aarch64 assembly files.

6 years agoMFC: r318899
jkim [Thu, 2 Nov 2017 18:22:53 +0000 (18:22 +0000)]
MFC: r318899

Merge OpenSSL 1.0.2l.

6 years agoMFC: r316607 (andrew)
jkim [Thu, 2 Nov 2017 18:20:05 +0000 (18:20 +0000)]
MFC: r316607 (andrew)

Fix linking with lld by marking OPENSSL_armcap_P as hidden.

Linking with lld fails as it contains a relative address, however the data
this address is for may be relocated from the shared object to the main
executable.

Fix this by adding the hidden attribute. This stops moving this value to
the main executable. It seems this is implicit upstream as it uses a
version script.

6 years agoMFC: r307976
jkim [Thu, 2 Nov 2017 18:16:01 +0000 (18:16 +0000)]
MFC: r307976

Build OpenSSL assembly sources for aarch64.

6 years agoMFC r324752: Relax per-ifnet cif_vrs list double locking in carp(4).
mav [Thu, 2 Nov 2017 10:38:09 +0000 (10:38 +0000)]
MFC r324752: Relax per-ifnet cif_vrs list double locking in carp(4).

In all cases where cif_vrs list is modified, two locks are held: per-ifnet
CIF_LOCK and global carp_sx.  It means to read that list only one of them
is enough to be held, so we can skip CIF_LOCK when we already have carp_sx.

This fixes kernel panic, caused by attempts of copyout() to sleep while
holding non-sleepable CIF_LOCK mutex.

6 years agoMFC r325103:
mmel [Thu, 2 Nov 2017 07:09:38 +0000 (07:09 +0000)]
MFC r325103:

  Fix misleading comment.  Not a functional change.

6 years agoMFC r324660:
mmel [Thu, 2 Nov 2017 07:08:13 +0000 (07:08 +0000)]
MFC r324660:

  Save VFP state in getcontext(3) on ARM.  This is a last followup of r315974,
  which fixes userland part of VFP save/restore problems described in PR
  217611.

6 years agoMFC r324996:
kp [Wed, 1 Nov 2017 13:54:16 +0000 (13:54 +0000)]
MFC r324996:

Evaluate packet size after the firewall had its chance in the ip6 fast path

Defer the packet size check until after the firewall has had a look at it. This
means that the firewall now has the opportunity to (re-)fragment an oversized
packet.
This mirrors what the slow path does.

6 years agoMFC r324992:
markj [Wed, 1 Nov 2017 13:50:35 +0000 (13:50 +0000)]
MFC r324992:
Make drain_output() use bufobj_wwait().

6 years agoMFC r324681, r324738
cy [Wed, 1 Nov 2017 01:03:44 +0000 (01:03 +0000)]
MFC r324681, r324738

Anticongestion refinements for ntpd rc script. This checks if ntp
leapfile needs fetching before entering into the anticongestion sleep.

Unfortunately some ports still use their own sleeps so, this commit
doesn't address the complete problem which is compounded by every
port that uses its own anticongestion mechanism.

Discussed with: asomers, feld

6 years agoMFC r324920:
markj [Tue, 31 Oct 2017 15:06:26 +0000 (15:06 +0000)]
MFC r324920:
Fix the VM_NRESERVLEVEL == 0 build.

6 years agoMFC r324923:
markj [Tue, 31 Oct 2017 15:01:52 +0000 (15:01 +0000)]
MFC r324923:
Remove resource_set_*() declarations from sys/bus.h.

PR: 223189

6 years agoMFC r324947:
ae [Tue, 31 Oct 2017 10:31:47 +0000 (10:31 +0000)]
MFC r324947:
  Add IPv6 support for O_TCPDATALEN opcode.

  PR: 222746

6 years agoMFC r324957: iscsi_shutdown_post: do nothing if panic-ing
avg [Tue, 31 Oct 2017 09:58:19 +0000 (09:58 +0000)]
MFC r324957: iscsi_shutdown_post: do nothing if panic-ing

6 years agoMFC r324694: never retry oustanding requests when terminating iscsi session
avg [Tue, 31 Oct 2017 09:56:37 +0000 (09:56 +0000)]
MFC r324694: never retry oustanding requests when terminating iscsi session

6 years agoMFC r324689: iscsi: do not hold the global lock while tearing down a session
avg [Tue, 31 Oct 2017 09:54:41 +0000 (09:54 +0000)]
MFC r324689: iscsi: do not hold the global lock while tearing down a session

6 years agoMFC r324620:
fsu [Mon, 30 Oct 2017 18:03:33 +0000 (18:03 +0000)]
MFC r324620:
Add extended attributes support to fuse kernel module.

Author:         ken
Reviewed by:    cem, pfg (mentor)
Approved by:    pfg (mentor)

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

6 years agoMFC r325059: import tzdata 2017c
philip [Mon, 30 Oct 2017 15:56:17 +0000 (15:56 +0000)]
MFC r325059: import tzdata 2017c

6 years agoMFC r324425: illumos mutex_init: use SX_NEW instead of bzero
avg [Mon, 30 Oct 2017 10:41:01 +0000 (10:41 +0000)]
MFC r324425: illumos mutex_init: use SX_NEW instead of bzero

6 years agoMFC r324350: zdb.8: replace with the slighly modified upstream version
avg [Mon, 30 Oct 2017 10:39:22 +0000 (10:39 +0000)]
MFC r324350: zdb.8: replace with the slighly modified upstream version

6 years agoMFC r324349: MFV r322235: 8067 zdb should be able to dump literal embedded block...
avg [Mon, 30 Oct 2017 10:37:21 +0000 (10:37 +0000)]
MFC r324349: MFV r322235: 8067 zdb should be able to dump literal embedded block pointer

6 years agoMFC r324348: MFV r316934: 7340 receive manual origin should override automatic origin
avg [Mon, 30 Oct 2017 10:35:03 +0000 (10:35 +0000)]
MFC r324348: MFV r316934: 7340 receive manual origin should override automatic origin

6 years agoMFC r324347: MFV r316933: 5142 libzfs support raidz root pool (loader project)
avg [Mon, 30 Oct 2017 10:32:36 +0000 (10:32 +0000)]
MFC r324347: MFV r316933: 5142 libzfs support raidz root pool (loader project)

FreeBSD note: we have long supported this feature, this commit only
removes a small difference in libzfs.

6 years agoMFC r324346: MFV r316931: 6268 zfs diff confused by moving a file to another directory
avg [Mon, 30 Oct 2017 10:29:26 +0000 (10:29 +0000)]
MFC r324346: MFV r316931: 6268 zfs diff confused by moving a file to another directory

6 years agoMFC r324345: MFV r316877: 7571 non-present readonly numeric ZFS props do not have...
avg [Mon, 30 Oct 2017 09:01:02 +0000 (09:01 +0000)]
MFC r324345: MFV r316877: 7571 non-present readonly numeric ZFS props do not have default value

6 years agoMFC r324344: MFV r316864: 6392 zdb: introduce -V for verbatim import
avg [Mon, 30 Oct 2017 08:58:39 +0000 (08:58 +0000)]
MFC r324344: MFV r316864: 6392 zdb: introduce -V for verbatim import

6 years agoMFC r324343: MFV r316862: 6410 teach zdb to perform object lookups by path
avg [Mon, 30 Oct 2017 08:56:39 +0000 (08:56 +0000)]
MFC r324343: MFV r316862: 6410 teach zdb to perform object lookups by path

6 years agoMFC r324011, r324016: MFV r323535: 8585 improve batching done in zil_commit()
avg [Mon, 30 Oct 2017 08:53:15 +0000 (08:53 +0000)]
MFC r324011, r324016: MFV r323535: 8585 improve batching done in zil_commit()

FreeBSD notes:
- this MFV reverts FreeBSD commit r314549 to make the merge easier
- at present our emulation of cv_timedwait_hires is rather poor,
  so I elected to use cv_timedwait_sbt directly
Please see the differential revision for details.
Unfortunately, I did not get any positive reviews, so there could be
bugs in the FreeBSD-specific piece of the merge.
Hence, the long MFC timeout.

illumos/illumos-gate@1271e4b10dfaaed576c08a812f466f6e81370e5e
https://github.com/illumos/illumos-gate/commit/1271e4b10dfaaed576c08a812f466f6e81370e5e

https://www.illumos.org/issues/8585
  The current implementation of zil_commit() can introduce significant
  latency, beyond what is inherent due to the latency of the underlying
  storage. The additional latency comes from two main problems:
  1. When there's outstanding ZIL blocks being written (i.e. there's
      already a "writer thread" in progress), then any new calls to
      zil_commit() will block waiting for the currently oustanding ZIL
      blocks to complete. The blocks written for each "writer thread" is
      coined a "batch", and there can only ever be a single "batch" being
      written at a time. When a batch is being written, any new ZIL
      transactions will have to wait for the next batch to be written,
      which won't occur until the current batch finishes.
  As a result, the underlying storage may not be used as efficiently
      as possible. While "new" threads enter zil_commit() and are blocked
      waiting for the next batch, it's possible that the underlying
      storage isn't fully utilized by the current batch of ZIL blocks. In
      that case, it'd be better to allow these new threads to generate
      (and issue) a new ZIL block, such that it could be serviced by the
      underlying storage concurrently with the other ZIL blocks that are
      being serviced.
  2. Any call to zil_commit() must wait for all ZIL blocks in its "batch"
      to complete, prior to zil_commit() returning. The size of any given
      batch is proportional to the number of ZIL transaction in the queue
      at the time that the batch starts processing the queue; which
      doesn't occur until the previous batch completes. Thus, if there's a
      lot of transactions in the queue, the batch could be composed of
      many ZIL blocks, and each call to zil_commit() will have to wait for
      all of these writes to complete (even if the thread calling
      zil_commit() only cared about one of the transactions in the batch).

Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>

6 years agoMFC r324926:
kib [Mon, 30 Oct 2017 08:25:24 +0000 (08:25 +0000)]
MFC r324926:
Expand explanation of atomicity.

6 years agoMFC r324868:
markj [Sun, 29 Oct 2017 14:57:58 +0000 (14:57 +0000)]
MFC r324868:
Delete declarations of struct pfs_bitmap, removed in r143841.

6 years agoMFC r324853:
kib [Sun, 29 Oct 2017 09:38:42 +0000 (09:38 +0000)]
MFC r324853:
Remove the support for mknod(S_IFMT), which created dummy vnodes with
VBAD type.

6 years agoSync (make same) the offsetof macro definition in include/ with the
cy [Sun, 29 Oct 2017 04:33:50 +0000 (04:33 +0000)]
Sync (make same) the offsetof macro definition in include/ with the
definition of the same in sys/sys/. The problem was discovered while
working on implementing a new C11 gets_s() for libc. (The new gets_s()
requires rsize_t found in include/stddef.h.) The solution to sync the two
definitions was suggested by ed@ while discussing D12667.

Suggested by: ed

6 years agoMFC 324721: Add references to sysrc(8) to SEE ALSO.
se [Sat, 28 Oct 2017 07:06:30 +0000 (07:06 +0000)]
MFC 324721: Add references to sysrc(8) to SEE ALSO.
MFC 324823: Mention sysrc(8) as scripting interface for config files.

6 years agoMFC r316304 (by tychon):
kib [Fri, 27 Oct 2017 15:33:26 +0000 (15:33 +0000)]
MFC r316304 (by tychon):
Reorder includes to placate MIPS build.

Reported and tested by: David Wolfskill

6 years agoMFC r324804:
markj [Fri, 27 Oct 2017 14:24:35 +0000 (14:24 +0000)]
MFC r324804:
Avoid the nbp lookup in the final loop iteration in flushbuflist().

6 years agoMFC r324809:
markj [Fri, 27 Oct 2017 14:22:56 +0000 (14:22 +0000)]
MFC r324809:
Free the right address range if kmem_back() fails in memguard_alloc().

6 years agoMFC r324793:
kib [Fri, 27 Oct 2017 08:53:09 +0000 (08:53 +0000)]
MFC r324793:
In vm_page_free_phys_pglist(), do not take vm_page_queue_free_mtx if
there is nothing to do.

6 years agoMFC r320481:
bdrewery [Fri, 27 Oct 2017 04:38:42 +0000 (04:38 +0000)]
MFC r320481:

  Store a 32-bit PT_LWPINFO struct for 32-bit process core dumps.

6 years agoMFC r314914:
ian [Thu, 26 Oct 2017 22:19:28 +0000 (22:19 +0000)]
MFC r314914:

Release all previously allocated resources.

6 years agoMFC r323692,r323710,r323714,r324628,r324629,r324635,r324636,r324637
tijl [Thu, 26 Oct 2017 17:45:01 +0000 (17:45 +0000)]
MFC r323692,r323710,r323714,r324628,r324629,r324635,r324636,r324637

Merge Linux emulation changes to support newer Linux libdrm.

6 years agoMFC r324281:
asomers [Wed, 25 Oct 2017 22:25:32 +0000 (22:25 +0000)]
MFC r324281:

Display rotation rate and TRIM/UNMAP support in diskinfo(8)

Bump __FreeBSD_version due to the expansion of struct diocgattr_arg.

Reviewed by: mav, allanjude, imp
Relnotes: yes
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12578

6 years agoMFC: r324506
rmacklem [Wed, 25 Oct 2017 19:27:12 +0000 (19:27 +0000)]
MFC: r324506
Fix forced dismount when a pNFS mount is hung on a DS.

When a "pnfs" NFSv4.1 mount is hung because of an unresponsive DS,
a forced dismount wouldn't work, because the RPC socket for the DS
was not being closed. This patch fixes this.
This will only affect "pnfs" mounts where the pNFS server's DS
is unresponsive (crashed or network partitioned or...).
Found during testing of the pNFS server.

6 years agoMFC r324223:
asomers [Wed, 25 Oct 2017 15:18:09 +0000 (15:18 +0000)]
MFC r324223:

MFV r319743:   8108 zdb -l fails to read labels 2 and 3

illumos/illumos-gate@22c8b9583d07895c16549075a53668d7bc988cf3
https://github.com/illumos/illumos-gate/commit/22c8b9583d07895c16549075a53668d7bc988cf3

https://www.illumos.org/issues/8108

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

6 years agoMFC r324222:
asomers [Wed, 25 Oct 2017 15:15:09 +0000 (15:15 +0000)]
MFC r324222:

MFV r316863: 3871 fix issues introduced by 3604

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

https://www.illumos.org/issues/3871
  GCC 4.5.3 on Gentoo Linux did not like a few of the changes made in the issue
  3604 patch. It printed an error and a couple of warnings:
  ../../cmd/zdb/zdb.c: In function 'dump_bpobj':
  ../../cmd/zdb/zdb.c:1257:3: error: 'for' loop initial declarations are only
  allowed in C99 mode
  ../../cmd/zdb/zdb.c:1257:3: note: use option -std=c99 or -std=gnu99 to compile
  your code
  ../../cmd/zdb/zdb.c: In function 'dump_deadlist':
  ../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format
  ../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Richard Yao <ryao@gentoo.org>

6 years agoMFC r324221:
asomers [Wed, 25 Oct 2017 15:11:08 +0000 (15:11 +0000)]
MFC r324221:

MFV r316861: 6866 zdb -l should return non-zero if it fails to find any label

illumos/illumos-gate@64723e361134b2a2c45341334174f9d34002f8d0
https://github.com/illumos/illumos-gate/commit/64723e361134b2a2c45341334174f9d34002f8d0

https://www.illumos.org/issues/6866
  Need this for #6865.
  To be generally more scripting-friendly, overload this issue with adding '-q'
  option which should skip printing any label information.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

6 years agoMFC r324220:
asomers [Wed, 25 Oct 2017 14:45:56 +0000 (14:45 +0000)]
MFC r324220:

MFV r316858 7280 Allow changing global libzpool variables in zdb

7280 Allow changing global libzpool variables in zdb and ztest through command line

illumos/illumos-gate@0e60744c982adecd0a1f146f5637475d07ab1069
https://github.com/illumos/illumos-gate/commit/0e60744c982adecd0a1f146f5637475d07ab1069

https://www.illumos.org/issues/7280
  zdb is very handy for diagnosing problems with a pool in a safe and
  quick way. When a pool is in a bad shape, we often want to disable some
  fail-safes, or adjust some tunables in order to open them. In the
  kernel, this is done by changing public variables in mdb. The goal of
  this feature is to add the same capability to zdb and ztest, so that
  they can change libzpool tuneables from the command line.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

6 years agoMFC r324704:
markj [Wed, 25 Oct 2017 01:07:45 +0000 (01:07 +0000)]
MFC r324704:
Fix a racy VI_DOOMED check in MNT_VNODE_FOREACH_ALL().

6 years agoMFC r324257-r324258
manu [Tue, 24 Oct 2017 14:33:38 +0000 (14:33 +0000)]
MFC r324257-r324258

r324257:
mountd: Convert exportlist to SLIST

Use SLIST from sys/queue.h instead of homebrew linked list for the exportlist.

Reviewed by: bapt, rmacklem
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D12502

r324258:
mountd: Convert mountlist to SLIST

Use SLIST from sys/queue.h instead of homebrew linked list for mountlist.

Reviewed by: bapt, rmacklem
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D12504

6 years agoMFC r324179, r324193:
jch [Tue, 24 Oct 2017 08:56:11 +0000 (08:56 +0000)]
MFC r324179, r324193:

r324179:

Fix an infinite loop in tcp_tw_2msl_scan() when an INP_TIMEWAIT inp has
been destroyed before its tcptw with INVARIANTS undefined.

This is a symmetric change of r307551:

A INP_TIMEWAIT inp should not be destroyed before its tcptw, and INVARIANTS
will catch this case.  If INVARIANTS is undefined it will emit a log(LOG_ERR)
and avoid a hard to debug infinite loop in tcp_tw_2msl_scan().

Reported by:            Ben Rubson, hselasky
Submitted by:           hselasky
Tested by:              Ben Rubson, jch
Sponsored by:           Verisign, inc
Differential Revision:  https://reviews.freebsd.org/D12267

r324193:

Forgotten bits in r324179:  Include sys/syslog.h if INVARIANTS is not defined

6 years agoMFC r324826:
dim [Tue, 24 Oct 2017 06:49:06 +0000 (06:49 +0000)]
MFC r324826:

Pull in r316035 from upstream llvm trunk (by Tim Northover):

  AArch64: account for possible frame index operand in compares.

  If the address of a local is used in a comparison, AArch64 can fold
  the address-calculation into the comparison via "adds".
  Unfortunately, a couple of places (both hit in this one test) are not
  ready to deal with that yet and just assume the first source operand
  is a register.

This should fix an assertion failure while building the test suite of
www/firefox for AArch64.

PR: 223048

6 years agoMFC r318246,r324566,r324668,r324701:
bdrewery [Tue, 24 Oct 2017 00:51:11 +0000 (00:51 +0000)]
MFC r318246,r324566,r324668,r324701:

  r318246:
    Add a regression test for r318191.
  r324566:
    Fix shadowed variable hidden by WARNS changing to 3 in r313006.
  r324668:
    This child is expected to exit on SIGTRAP, don't leave a core behind.
  r324701:
    Add a test for r324671 along with some other masked tests.

6 years agoMFC r324683: write.2: correct maximum nbytes size for EINVAL error
emaste [Tue, 24 Oct 2017 00:32:20 +0000 (00:32 +0000)]
MFC r324683: write.2: correct maximum nbytes size for EINVAL error

In FreeBSD 11 and later debug.iosize_max_clamp defaults to 0, and the
maximum nbytes count for write(2) is SSIZE_MAX. Update the man page to
document this, and mention the sysctl that can be set to obtain the
previous behaviour.

PR: 196666
Sponsored by: The FreeBSD Foundation

6 years agoMFC r324241:
asomers [Mon, 23 Oct 2017 22:50:37 +0000 (22:50 +0000)]
MFC r324241:

Fix copy/paste error in diskinfo.8 from r320555

Sponsored by: Spectra Logic Corp

6 years agoMFC r324671:
kib [Mon, 23 Oct 2017 19:15:51 +0000 (19:15 +0000)]
MFC r324671:
Re-evaluate thread' signal mask after ptracestop().

6 years agoFix struct thread padding field names.
bdrewery [Mon, 23 Oct 2017 19:03:36 +0000 (19:03 +0000)]
Fix struct thread padding field names.

Direct commit to stable/11.

6 years agostruct ksiginfo has MD size, so use it as the padding type to avoid the wrong size.
bdrewery [Mon, 23 Oct 2017 19:00:17 +0000 (19:00 +0000)]
struct ksiginfo has MD size, so use it as the padding type to avoid the wrong size.

This is a direct commit to stable/11 to fix r324932.

Spotted by: kib

6 years agoMFC r316286:
bdrewery [Mon, 23 Oct 2017 18:25:21 +0000 (18:25 +0000)]
MFC r316286:

  Add support for capturing 'struct ptrace_lwpinfo' for signals resulting in a
  process dumping core in the corefile.

  Direct stable changed: Padding added to struct thread and td_si added to end
  with explicit bzeroing when forking/initializing a thread to preserve KBI.

6 years agoMFC r324670:
kib [Mon, 23 Oct 2017 08:14:41 +0000 (08:14 +0000)]
MFC r324670:
Improve assertion that an ignored or blocked signal is not delivered.

6 years agoMFC r324669:
kib [Mon, 23 Oct 2017 08:13:23 +0000 (08:13 +0000)]
MFC r324669:
Style.

6 years agoMFC r324665:
kib [Mon, 23 Oct 2017 08:09:19 +0000 (08:09 +0000)]
MFC r324665:
Fix the pv_chunks pc_lru tailq handling in reclaim_pv_chunk().

6 years agoMFC r324661: Add Creative vendor ID.
mav [Mon, 23 Oct 2017 07:41:44 +0000 (07:41 +0000)]
MFC r324661: Add Creative vendor ID.

6 years agoMFC r324659: Update details of interface capabilities changed by bridge(4).
mav [Mon, 23 Oct 2017 07:39:04 +0000 (07:39 +0000)]
MFC r324659: Update details of interface capabilities changed by bridge(4).

PR: 221122

6 years agoMFC r323772, r324302-r324308, r324310, r324313, r324315, r324326, r324330,
kib [Sun, 22 Oct 2017 08:47:13 +0000 (08:47 +0000)]
MFC r323772, r324302-r324308, r324310, r324313, r324315, r324326, r324330,
    r324334, r324354-r324355, r324366, r324432-r324433, r324437-r324439:
Fixes and improvements for x86 LDT handling.

6 years agoMFC r323860:
oshogbo [Sat, 21 Oct 2017 19:38:36 +0000 (19:38 +0000)]
MFC r323860:
Plug memory leak in case when nvlist allocation succeeds, but nvpair
allocation fails.

Submitted by: pjd@
Sponsored by: Wheel Systems

6 years agoMFC r323858:
oshogbo [Sat, 21 Oct 2017 19:37:25 +0000 (19:37 +0000)]
MFC r323858:
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@
Sponsored by: Wheel Systems

6 years agoMFC r323856:
oshogbo [Sat, 21 Oct 2017 19:36:22 +0000 (19:36 +0000)]
MFC r323856:
Free 'value' only once we are done freeing all individual

Submitted by: pjd@
Found by: scan-build
Sponsored by: Wheel Systems

6 years agoMFC r323851:
oshogbo [Sat, 21 Oct 2017 19:34:54 +0000 (19:34 +0000)]
MFC r323851:
Remove redundant initialization. Don't use variable - just return the value.
Make scan-build happy by casting to 'void *' instead of 'void **'.

Submitted by: pjd@
Found by:     scan-build and cppcheck
Sponsored by: Wheel Systems

6 years agoMFC r323854:
oshogbo [Sat, 21 Oct 2017 19:33:31 +0000 (19:33 +0000)]
MFC r323854:
Because nvp wasn't initialized on every loop iteration once we jumped
to 'fail' on error it was treated as success, because nvp!=NULL. Fix this
by not handling success under 'fail' label and by using separate variable
for parent nvpair.

If we succeeded to allocate nvlist, but failed to allocated nvpair we
would leak nvls[ii] on return. Destroy it when we cannot allocate nvpair,
before we goto fail.

Submitted by: pjd@ and oshogbo@ (minor changes)
Found by: scan-build
Sponsored by: Wheel Systems

6 years agoMFC r323853:
oshogbo [Sat, 21 Oct 2017 19:31:59 +0000 (19:31 +0000)]
MFC r323853:
Make the code consistent by always using 'fail' label.

Submitted by: pjd@ and oshogbo@
Sponsored by: Wheel Systems

6 years agoMFC r323852:
oshogbo [Sat, 21 Oct 2017 19:30:33 +0000 (19:30 +0000)]
MFC r323852:
The 'while (array != NULL) { }' suggests scan-build that array may be
initially NULL, which is not possible. Change the loop to
'do {} while (array != NULL)' to satisfy scan-build and assert that
array really cannot be NULL just in case.

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

6 years agoMFC r323859:
oshogbo [Sat, 21 Oct 2017 19:26:47 +0000 (19:26 +0000)]
MFC r323859:
Simplify the code by _not_ expecting success under 'fail'.

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

6 years agoMFC r324672:
avos [Sat, 21 Oct 2017 10:21:34 +0000 (10:21 +0000)]
MFC r324672:
ifnet(9): split ifc_alloc_unit() (should simplify code flow)

Allocate smallest unit number from pool via ifc_alloc_unit_next()
and exact unit number (if available) via ifc_alloc_unit_specific().

While here, address possible deadlock (mentioned in PR).

PR: 217401
Differential Revision: https://reviews.freebsd.org/D12551

6 years agoMFC r324445:
hselasky [Fri, 20 Oct 2017 10:04:43 +0000 (10:04 +0000)]
MFC r324445:
When showing the sleepqueues from the in-kernel debugger,
properly dump all the sleepqueues and not just the first one

History:
It appears that in the commit which introduced the code,
r165272, the array indexes of "sq_blocked[0]" and "td_name[i]"
were interchanged. In r180927 "td_name[i]" was corrected to
"td_name[0]", but "sq_blocked[0]" was left unchanged.

PR: 222624
Discussed with: kmacy @
Sponsored by: Mellanox Technologies

6 years agoMFC r323916:
hselasky [Fri, 20 Oct 2017 09:59:39 +0000 (09:59 +0000)]
MFC r323916:
Extend sysctl description for hw.usb.disable_enumeration .

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

6 years agoMFC r324600, r324716:
kib [Fri, 20 Oct 2017 09:21:37 +0000 (09:21 +0000)]
MFC r324600, r324716:
Evaluate the real size of the sblk_zone.

6 years agoMFC r324592:
ae [Fri, 20 Oct 2017 07:42:00 +0000 (07:42 +0000)]
MFC r324592:
  Return 'errno' value from the table_do_modify_record(), it is expected
  by table_modify_record().

  This makes quiet operations with tables really quiet.

  PR: 222953

6 years agoMFC r324593:
ae [Fri, 20 Oct 2017 07:40:11 +0000 (07:40 +0000)]
MFC r324593:
  Fix regression in handling O_FORWARD_IP opcode after r279948.

  To properly handle 'fwd tablearg,port' opcode, copy sin_port value from
  sockaddr_in structure stored in the opcode into corresponding hopstore
  field.

  PR: 222953

6 years agoMFC r324595: ANSIfy vm_kern.c
emaste [Fri, 20 Oct 2017 00:36:25 +0000 (00:36 +0000)]
MFC r324595: ANSIfy vm_kern.c

PR: 222673
Submitted by: ota@j.email.ne.jp

6 years agoMFC r324594: truss: mention 'H' in usage
emaste [Fri, 20 Oct 2017 00:29:39 +0000 (00:29 +0000)]
MFC r324594: truss: mention 'H' in usage

r295930 (MFC of r295930) introduced the 'H' option to display thread
IDs, but did not add the option to usage().

PR: 222837
Submitted by: Oliver Kiddle <okiddle@yahoo.co.uk>

6 years agoMFC r322695:
wulf [Thu, 19 Oct 2017 20:28:04 +0000 (20:28 +0000)]
MFC r322695:

Add support for generic MS Windows 7/8/10-compatible USB HID touchscreens
found in many laptops.

Reviewed by: hps, gonzo, bcr (manpages)
Approved by: gonzo (mentor)
Differential Revision: https://reviews.freebsd.org/D12017

6 years agoMFC r321397-r321399
wulf [Thu, 19 Oct 2017 20:16:40 +0000 (20:16 +0000)]
MFC r321397-r321399

r321397:
evdev: style(9), sort headers alphabetically

r321398:
evdev: Macroize common locking sequences

r321399:
Change my email address to wulf@FreeBSD.org in copyright headers.

Approved by: gonzo (mentor)