]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFV r304159: 7277 zdb should be able to print zfs_dbgmsg's
Alexander Motin [Sat, 3 Sep 2016 10:07:46 +0000 (10:07 +0000)]
MFV r304159: 7277 zdb should be able to print zfs_dbgmsg's

illumos/illumos-gate@29bdd2f916366ece37c4748bca6b3d61f57a223b
https://github.com/illumos/illumos-gate/commit/29bdd2f916366ece37c4748bca6b3d61f
57a223b

https://www.illumos.org/issues/7277
  ztest always prints the debug messages (zfs_dbgmsg()) by calling
  zfs_dbgmsg_print(). We should add a flag to zdb to make it do this as well
  before exiting.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

7 years agoMFV r304155: 7090 zfs should improve allocation order and throttle allocations
Alexander Motin [Sat, 3 Sep 2016 10:04:37 +0000 (10:04 +0000)]
MFV r304155: 7090 zfs should improve allocation order and throttle allocations

illumos/illumos-gate@0f7643c7376dd69a08acbfc9d1d7d548b10c846a
https://github.com/illumos/illumos-gate/commit/0f7643c7376dd69a08acbfc9d1d7d548b
10c846a

https://www.illumos.org/issues/7090
  When write I/Os are issued, they are issued in block order but the ZIO pipelin
e
  will drive them asynchronously through the allocation stage which can result i
n
  blocks being allocated out-of-order. It would be nice to preserve as much of
  the logical order as possible.
  In addition, the allocations are equally scattered across all top-level VDEVs
  but not all top-level VDEVs are created equally. The pipeline should be able t
o
  detect devices that are more capable of handling allocations and should
  allocate more blocks to those devices. This allows for dynamic allocation
  distribution when devices are imbalanced as fuller devices will tend to be
  slower than empty devices.
  The change includes a new pool-wide allocation queue which would throttle and
  order allocations in the ZIO pipeline. The queue would be ordered by issued
  time and offset and would provide an initial amount of allocation of work to
  each top-level vdev. The allocation logic utilizes a reservation system to
  reserve allocations that will be performed by the allocator. Once an allocatio
n
  is successfully completed it's scheduled on a given top-level vdev. Each top-
  level vdev maintains a maximum number of allocations that it can handle
  (mg_alloc_queue_depth). The pool-wide reserved allocations (top-levels *
  mg_alloc_queue_depth) are distributed across the top-level vdevs metaslab
  groups and round robin across all eligible metaslab groups to distribute the
  work. As top-levels complete their work, they receive additional work from the
  pool-wide allocation queue until the allocation queue is emptied.

Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: George Wilson <george.wilson@delphix.com>

7 years agoMFV r303081: 7163 ztest failures due to excess error injection
Alexander Motin [Sat, 3 Sep 2016 08:48:51 +0000 (08:48 +0000)]
MFV r303081: 7163 ztest failures due to excess error injection

illumos/illumos-gate@f34284d835bc555f987c1310df46c034c3101155
https://github.com/illumos/illumos-gate/commit/f34284d835bc555f987c1310df46c034c
3101155

https://www.illumos.org/issues/7163
  Running zloop from zfs-precommit hit this assertion:
       *panicstr/s
  0xfffffd7fd7419370: assertion failed for thread 0xfffffd7fe29ed240,
  thread-id 577: parent != NULL, file ../../../uts/common/fs/zfs/dbuf.c, line
  1827
       $c
  libc.so.1`_lwp_kill+0xa()
  libc.so.1`_assfail+0x182(fffffd7ffb1c29fafffffd7ffb1cc028, 723)
  libc.so.1`assfail+0x19(fffffd7ffb1c29fafffffd7ffb1cc028, 723)
  libzpool.so.1`dbuf_dirty+0xc69(10e3bc103601700)
  libzpool.so.1`dbuf_dirty+0x61e(10c736403601700)
  libzpool.so.1`dbuf_dirty+0x61e(10e282803601700)
  libzpool.so.1`dmu_buf_will_fill+0x64(10e282803601700)
  libzpool.so.1`dmu_write+0x1b6(2c7e640, d, 400000002e000000, 200, 3717b40,
  3601700)
  ztest_replay_write+0x568(4950d0, 3717a80, 0)
  ztest_write+0x125(4950d0, d, 400000002e000000, 200, 413f000)
  ztest_io+0x1bb(4950d0, d, 400000002e000000)
  ztest_dmu_write_parallel+0xaa(4950d0, 6)
  ztest_execute+0x83(1, 420c98, 6)
  ztest_thread+0xf4(6)
  libc.so.1`_thrp_setup+0x8a(fffffd7fe29ed240)
  libc.so.1`_lwp_start()
  This is another manifestation of ECKSUM in ztest:
  The lowest level ancestor that’s in memory is the L8 (topmost). The L7
  ancestor is blkid 0x10:
       ::dbufs -O 0x2c7e640 -o d -l 7 |::dbuf
  addr object lvl blkid holds os
  600be50 d 7 4 1 ztest/ds_6
  719d880 d 7 0 4 ztest/ds_6

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMFV r303080: 6451 ztest fails due to checksum errors
Alexander Motin [Sat, 3 Sep 2016 08:47:46 +0000 (08:47 +0000)]
MFV r303080: 6451 ztest fails due to checksum errors

illumos/illumos-gate@f9eb9fdf196b6ed476e4ffc69cecd8b0da3cb7e7
https://github.com/illumos/illumos-gate/commit/f9eb9fdf196b6ed476e4ffc69cecd8b0d
a3cb7e7

https://www.illumos.org/issues/6451
  Sometimes ztest fails because zdb detects checksum errors. e.g.:
  Traversing all blocks to verify checksums and verify nothing leaked ...
  zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 8000160> DVA0=<0:1cc2000:
  180000> [L0 other uint64[]] sha256 uncompressed LE contiguou
  s unique single size=100000L/100000P birth=271L/271P fill=1
  cksum=c5a3e27d1ed0f894:843bca3a5473c4bf:f76a19b6830a2e4:91292591613a12bf --
  skipping
  zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 800000180> DVA0=<0:ce16800:
  180000> [L0 other uint64[]] sha256 uncompressed LE contigu
  ous unique single size=100000L/100000P birth=840L/840P fill=1
  cksum=5d018f3d061e17f3:6d1584784587bf63:2805a74a0ce37369:ba68a214806c7e75
  -- skipping
  zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 1000000360> DVA0=<0:10d37400:
  180000> [L0 other uint64[]] sha256 uncompressed LE conti
  guous unique single size=100000L/100000P birth=904L/904P fill=1
  cksum=fa1e11d4138bd14b:86c9488c444473e3:f31e43c72e72e46b:e3446472d1174d
  ba -- skipping
  zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 400000002c0> DVA0=<0:127ef400:
  180000> [L0 other uint64[]] sha256 uncompressed LE cont
  iguous dedup single size=100000L/100000P birth=549L/549P fill=1
  cksum=30e14955ebf13522:66dc2ff8067e6810:4607e750abb9d3b3:6582b8af909fcb
  58 -- skipping
  zdb_blkptr_cb: Got error 50 reading <657, 5, 0, 1c0> DVA0=<0:1a180400:180000>
  [L0 other uint64[]] fletcher4 uncompressed LE contiguou
  s unique single size=100000L/100000P birth=1091L/1091P fill=1 cksum=a6cf1e50:
  29b3bd01c57e5:36779b914035db9a:db61cdcf6bec56f0 -- skippin
  g
  The problem is that ztest_fault_inject() can inject multiple faults into the
  same block. It is designed such that it can inject errors on all leafs of a
  RAID-Z or mirror, but for a given range of offsets, it will only inject errors

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Jorgen Lundman <lundman@lundman.net>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMFV r303079:
Alexander Motin [Sat, 3 Sep 2016 08:46:53 +0000 (08:46 +0000)]
MFV r303079:
7147 ztest: ztest_ddt_repair fails with ztest_pattern_match assertion

illumos/illumos-gate@aab80726335c76a7cae32c7300890248d73a51e3
https://github.com/illumos/illumos-gate/commit/aab80726335c76a7cae32c7300890248d
73a51e3

https://www.illumos.org/issues/7147
  Here's the dbuf we're currently reading:
       966f200::dbuf
  addr object lvl blkid holds os
  966f200 4 0 0 1 ztest/ds_3
       966f200::print dmu_buf_t db_data
  db_data = 0x9ae0400
       0x9ae0400/10J
  0x9ae0400: c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d
  c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d
  c1c7ced932020d c1c7ced932020d
  The pattern we're expecting is actually this: a34ae10b5f2db2. If we attempt to
  read the block on disk we find that it has matches what ztest_ddt_repair()
  would have written:
       ~c1c7ced932020d=J
  ff3e383126cdfdf2
       966f200::print dmu_buf_impl_t db_blkptr | ::blkptr
  DVA0=<0:71d3c00:800>
  [L0 UINT64_OTHER] SHA256 OFF LE contiguous dedup single
  size=400L/400P birth=55L/55P fill=1
  cksum=18486450d3ce8c6d:75a72f4bbf117b0f:2d3a226314eb5650:2eb0fd68648b1af0
     1. zdb -U /rpool/tmp/zpool.cache -R ztest 0:71d3c00:800 | head
        Found vdev type: mirror
  0:71d3c00:800
  0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
  000000: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000010: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000020: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000030: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000040: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
  000050: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: George Wilson <george.wilson@delphix.com>

7 years agoMFV r303078:
Alexander Motin [Sat, 3 Sep 2016 08:43:43 +0000 (08:43 +0000)]
MFV r303078:
7086 ztest attempts dva_get_dsize_sync on an embedded blockpointer

illumos/illumos-gate@926549256b71acd595f69b236779ff6b78fa08ef
https://github.com/illumos/illumos-gate/commit/926549256b71acd595f69b236779ff6b7
8fa08ef

https://www.illumos.org/issues/7086
  In dbuf_dirty(), we need to grab the dn_struct_rwlock before looking at the
  db_blkptr, to prevent it from being changed by syncing context.
  Otherwise we may see that ztest got a segfault from this stack:
  libzpool.so.1`dva_get_dsize_sync+0x98(872f000b32b240fed7811b, 0, b4cda20,
0)
  libzpool.so.1`bp_get_dsize+0x60(872f000b32b240, 0, 97cb7809d4c1a8, 0)
  libzpool.so.1`dbuf_dirty+0x9b3(ce0a10097cb780, 9, fecd2530)
  libzpool.so.1`dmu_buf_will_dirty+0xc3(ce0a10097cb780ea293d6c, 1)
  libzpool.so.1`zap_lockdir+0x1a0(8aaa3c0, 1, 0, 97cb780, 1, 1)
  libzpool.so.1`zap_remove_norm+0x30(8aaa3c0, 1, 0, 8728b10, 0, 97cb780)
  libzpool.so.1`zap_remove+0x29(8aaa3c0, 1, 0, 8728b1097cb780, a)
  ztest_replay_remove+0x225(ea2945888728ae8, 0, 38010000, 0, 0)
  ztest_remove+0x9f(ea294588ea293f50, 4, 3)
  ztest_object_init+0x78(ea294588ea293f50, 4e0, 1)
  ztest_dmu_object_alloc_free+0x71(ea294588, 13)
  ztest_dmu_objset_create_destroy+0x224(80cef08, 13, 0, 805d36c9017ad44, 0)
  ztest_execute+0x89(a, 807c720, 13, 0)
  ztest_thread+0xea(13, 0, 0, 0)
  libc.so.1`_thrp_setup+0x88(f0983240)
  libc.so.1`_lwp_start(f0983240, 0, 0, 0, 0, 0)
  Looking into it a bit, we see that this is an embedded blockpointer, so
  BP_GET_NDVAS should have returned 0:
       b32b240::blkptr
  EMBEDDED [L0 ZAP_OTHER] et=0 LZ4 size=200L/4aP birth=80L
  Instead, it looks like another thread is modifying this blockpointer:
       b32b240::ugrep | ::whatis
  f47a0e0c is in [ stack tid=0x19f ]
  ebd6ec40 is in [ stack tid=0x226 ]
  ea293bd0 is in [ stack tid=0x244 ]
  ea293be4 is in [ stack tid=0x244 ]

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMFV r303077:
Alexander Motin [Sat, 3 Sep 2016 08:42:12 +0000 (08:42 +0000)]
MFV r303077:
7072 zfs fails to expand if lun added when os is in shutdown state

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

https://www.illumos.org/issues/7072
  upstream:
  38733 zfs fails to expand if lun added when os is in shutdown state
  DLPX-36910 spares and caches should not display expandable space
  DLPX-39262 vdev_disk_open spam zfs_dbgmsg buffer

Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: George Wilson <george.wilson@delphix.com>

7 years agoMFV r302991: 6950 ARC should cache compressed data
Alexander Motin [Sat, 3 Sep 2016 08:30:51 +0000 (08:30 +0000)]
MFV r302991: 6950 ARC should cache compressed data

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

https://www.illumos.org/issues/6950
  When reading compressed data from disk, the ARC should keep the compressed
  block cached and only decompress it when consumers access the block. The
  uncompressed data should be short-lived allowing the ARC to cache a much larger
  amount of data. The DMU would also maintain a smaller cache of uncompressed
  blocks to minimize the impact of decompressing frequently accessed blocks.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Don Brady <don.brady@intel.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: George Wilson <george.wilson@delphix.com>

7 years agoReturn a NULL pointer (0 vm_offset) on error in map_dcsr().
Justin Hibbits [Sat, 3 Sep 2016 04:21:40 +0000 (04:21 +0000)]
Return a NULL pointer (0 vm_offset) on error in map_dcsr().

mpc85xx_map_dcsr() returns a vm_offset_t, not an error code.  Follow-up to
r304069.

7 years agoUse the right ifdef macro.
Justin Hibbits [Sat, 3 Sep 2016 04:09:03 +0000 (04:09 +0000)]
Use the right ifdef macro.

"E500" is not defined, but "BOOKE_E500" is.  Without this the idle hook cannot
be called.

MFC after: 1 week

7 years agoAs an optimization to the machine-independent layer, change the machine-
Alan Cox [Sat, 3 Sep 2016 03:14:24 +0000 (03:14 +0000)]
As an optimization to the machine-independent layer, change the machine-
dependent pmap_ts_referenced() so that it updates the page's dirty field
if a modified bit is found while counting reference bits.  This
opportunistic update can be performed at low cost and can eliminate the
need for some future calls to pmap_is_modified() by the machine-
independent layer.

MFC after: 3 weeks

7 years agoAdd cpuset support to separate forked processes.
George V. Neville-Neil [Sat, 3 Sep 2016 00:22:42 +0000 (00:22 +0000)]
Add cpuset support to separate forked processes.

Reviewed by: cem
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D7766

7 years agoAdd a runner script for cryptotest.
George V. Neville-Neil [Fri, 2 Sep 2016 21:35:32 +0000 (21:35 +0000)]
Add a runner script for cryptotest.

Althought cryptotest itself has a -z mode to test all algorithms at a variety
of sizes, this script allows us to be more selective.  Threads and buffer sizes
move in powers of two from 1, for threads, and 256 for buffer sizes.

e.g.  cryptorun.sh aes 4 512

Test aes with 1, 2 and 4 processes, and at sizes of 256 and 512 bytes.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agodhclient: add support for interface-mtu (26)
Conrad Meyer [Fri, 2 Sep 2016 21:14:29 +0000 (21:14 +0000)]
dhclient: add support for interface-mtu (26)

Make dhclient set interface MTU if it was provided.

This version implements MTU setting in dhclient itself before it runs
dhclient-script.

PR: 206721
Submitted by: novel@
Reported by: Jarrod Petz <jlpetz at gmail.com>
Reviewed by: cem, allanjude
Differential Revision: https://reviews.freebsd.org/D5675

7 years agosh: Add some tests for non-standard features of the echo builtin.
Jilles Tjoelker [Fri, 2 Sep 2016 21:13:46 +0000 (21:13 +0000)]
sh: Add some tests for non-standard features of the echo builtin.

MFC after: 1 week

7 years agoClean up the usage message and remove dead code.
George V. Neville-Neil [Fri, 2 Sep 2016 21:11:37 +0000 (21:11 +0000)]
Clean up the usage message and remove dead code.

Reviewed by: cem
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D7765

7 years agoDIRDEPS_BUILD: Update dependencies after a 'make bootstrap-tools'.
Bryan Drewery [Fri, 2 Sep 2016 20:41:43 +0000 (20:41 +0000)]
DIRDEPS_BUILD: Update dependencies after a 'make bootstrap-tools'.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agoRenaming libifc to libifconfig in response to feedback on initial commit of
Kristof Provost [Fri, 2 Sep 2016 18:33:08 +0000 (18:33 +0000)]
Renaming libifc to libifconfig in response to feedback on initial commit of
this library. Sticking to 'libifconfig' (and 'ifconfig_' as function prefix)
should reduce chances of namespace collisions, make it more clear what the
library does, and be more in line with existing libraries.

Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D7742
Reviewed by: cem, kp

7 years agoWhen -n is specified, don't make bogus DNS queries. Instead,
Hajimu UMEMOTO [Fri, 2 Sep 2016 18:28:14 +0000 (18:28 +0000)]
When -n is specified, don't make bogus DNS queries.  Instead,
when -n is specified more than once, hostnames stored in utmp
are attempted to resolve to display them as network addresses.

PR: 212272

7 years agoMerge from CheriBSD:
Brooks Davis [Fri, 2 Sep 2016 18:22:56 +0000 (18:22 +0000)]
Merge from CheriBSD:

Rename sigprop-table constants to SIGPROP_ from SA_ to reduce the
impression of a namespace collision.

Submitted by: rwatson
Reviewed by: jhb, kib (slightly different versions)
Obtained from: CheriBSD (814ec5771cb1cb53deba317c561de62a91ae7684)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D7616

7 years agoAdd a pc_clock pcpu field and use it to implement cpu_est_clockrate. This
Andrew Turner [Fri, 2 Sep 2016 10:13:51 +0000 (10:13 +0000)]
Add a pc_clock pcpu field and use it to implement cpu_est_clockrate. This
will allow drivers that manage the clock frequency to communicate this with
the reset of the kernel.

Reported by: jmcneill
MFC after: 1 week
Sponsored by: ABT Systems Ltd

7 years agoFix array size issue when using the pre-scaling feature for
Hans Petter Selasky [Fri, 2 Sep 2016 08:44:14 +0000 (08:44 +0000)]
Fix array size issue when using the pre-scaling feature for
ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers
are allocated when setting up the libusb transfer structure to support
the maximum number of frames the kernel can handle.

MFC after: 1 week

7 years agoSkip :test_large on i386
Enji Cooper [Fri, 2 Sep 2016 08:17:43 +0000 (08:17 +0000)]
Skip :test_large on i386

More assertions are failing on ^/head now.

PR: 205446
Sponsored by: EMC / Isilon Storage Division

7 years agohyperv/ic: Cleanup timesync channel callback.
Sepherosa Ziehau [Fri, 2 Sep 2016 06:23:28 +0000 (06:23 +0000)]
hyperv/ic: Cleanup timesync channel callback.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7745

7 years agohyperv/ic: Cleanup shutdown channel callback.
Sepherosa Ziehau [Fri, 2 Sep 2016 06:15:30 +0000 (06:15 +0000)]
hyperv/ic: Cleanup shutdown channel callback.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7744

7 years agohyperv/ic: Minor style fix.
Sepherosa Ziehau [Fri, 2 Sep 2016 06:08:08 +0000 (06:08 +0000)]
hyperv/ic: Minor style fix.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7743

7 years agonet/rndis: Define common message header for RNDIS messages.
Sepherosa Ziehau [Fri, 2 Sep 2016 05:57:13 +0000 (05:57 +0000)]
net/rndis: Define common message header for RNDIS messages.

And avoid RNDIS_HEADER_OFFSET hardcoding.

Reviewed by: hps
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7739

7 years agonet/rndis: Add comment for rndis_comp_hdr
Sepherosa Ziehau [Fri, 2 Sep 2016 05:49:38 +0000 (05:49 +0000)]
net/rndis: Add comment for rndis_comp_hdr

Reviewed by: hps
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7738

7 years agohyperv/hn: Use the per-packet-info types defined by net/rndis.h
Sepherosa Ziehau [Fri, 2 Sep 2016 05:30:38 +0000 (05:30 +0000)]
hyperv/hn: Use the per-packet-info types defined by net/rndis.h

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7737

7 years agohyperv/hn: Simplify RX hash related bits.
Sepherosa Ziehau [Fri, 2 Sep 2016 03:19:55 +0000 (03:19 +0000)]
hyperv/hn: Simplify RX hash related bits.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7736

7 years agocron: use existing maximum username constant MAXLOGNAME
Ed Maste [Fri, 2 Sep 2016 03:15:54 +0000 (03:15 +0000)]
cron: use existing maximum username constant MAXLOGNAME

Previously cron had its own maximum username length limit, which was
smaller than the system's MAXLOGNAME. This could lead to crontab -u
updating the wrong user's crontab (if the name was truncated, and
matched another user).

PR: 212305
Reported by: Andrii Kuzik
Reviewed by: allanjude, jilles
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7747

7 years agohyperv/hn: Rework RXCSUM related bits
Sepherosa Ziehau [Fri, 2 Sep 2016 03:10:30 +0000 (03:10 +0000)]
hyperv/hn: Rework RXCSUM related bits

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7735

7 years agoRevert r304192 to fix short month names and replace %b with %_m in date_fmt
Kevin Lo [Fri, 2 Sep 2016 00:43:03 +0000 (00:43 +0000)]
Revert r304192 to fix short month names and replace %b with %_m in date_fmt
for Chinese locales.

As mentioned in the commit message of r289041, nl_langinfo(ABMON_*) only
returned numbers when using a Chinese locale, this causes problems in
applications that put the short month name and the day of the month together.

Spotted by: Ting-Wei Lan <lantw44 gmail com>

7 years agoReplace %m with %_m in date_fmt for Chinese locales.
Kevin Lo [Fri, 2 Sep 2016 00:27:27 +0000 (00:27 +0000)]
Replace %m with %_m in date_fmt for Chinese locales.
This is a fix for the problem mentioned in the PR.

PR: 199441

7 years agocxgbe/cxgbei: Provide a knob to set the DDP threshold for iSCSI
Navdeep Parhar [Fri, 2 Sep 2016 00:21:24 +0000 (00:21 +0000)]
cxgbe/cxgbei: Provide a knob to set the DDP threshold for iSCSI
transfers.

The Initiator and Target both perform zero copy receive for transfers
greater than or equal to this threshold.

Sponsored by: Chelsio Communications

7 years agoInitialize lists of signals using C99 designators
Brooks Davis [Fri, 2 Sep 2016 00:16:19 +0000 (00:16 +0000)]
Initialize lists of signals using C99 designators

Reviewed by: jilles
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D7601

7 years agocxgbe/cxgbei: Count various events related to iSCSI operation and make
Navdeep Parhar [Thu, 1 Sep 2016 23:58:36 +0000 (23:58 +0000)]
cxgbe/cxgbei: Count various events related to iSCSI operation and make
these counters available in the sysctl MIB.

Sponsored by: Chelsio Communications

7 years agoioat(4): Despam relatively common hardware reset messages
Conrad Meyer [Thu, 1 Sep 2016 23:56:02 +0000 (23:56 +0000)]
ioat(4): Despam relatively common hardware reset messages

Reported by: ngie@

7 years agoDIRDEPS_BUILD: Build crunchide for the host.
Bryan Drewery [Thu, 1 Sep 2016 23:52:25 +0000 (23:52 +0000)]
DIRDEPS_BUILD: Build crunchide for the host.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

7 years agoDIRDEPS_BUILD: Include crunched object meta files for gendirdeps.
Bryan Drewery [Thu, 1 Sep 2016 23:52:20 +0000 (23:52 +0000)]
DIRDEPS_BUILD: Include crunched object meta files for gendirdeps.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

7 years agoBump __FreeBSD_version for crunchgen META_MODE fix in r305254.
Bryan Drewery [Thu, 1 Sep 2016 23:22:31 +0000 (23:22 +0000)]
Bump __FreeBSD_version for crunchgen META_MODE fix in r305254.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

7 years agoDIRDEPS_BUILD: Fix 'make bootstrap-tools' not using the proper tblgen binaries.
Bryan Drewery [Thu, 1 Sep 2016 23:21:12 +0000 (23:21 +0000)]
DIRDEPS_BUILD: Fix 'make bootstrap-tools' not using the proper tblgen binaries.

This was an incomplete item from r291561.  The host {clang,llvm}-tblgen
binaries were used, rather than the ones built into the host stagedir by
normal Makefile.depend dependencies on tblgen.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agoMETA_MODE/DIRDEPS_BUILD: Fix various issues with crunch builds.
Bryan Drewery [Thu, 1 Sep 2016 23:21:08 +0000 (23:21 +0000)]
META_MODE/DIRDEPS_BUILD: Fix various issues with crunch builds.

- DIRDEPS_BUILD: Fix crunchgen builds losing their library dependencies
  on a nop-rebuild.
- META_MODE: Fix not rebuilding various crunch.mk targets if their .meta
  files warrant a rebuild.  They were lacking .meta files previously.
  This adds .NOMETA to the crunch objects being used since they are
  already built.  Bmake was forcing a rebuild on them since their
  .meta files were not in the expected place; there is no reason to
  rebuild them.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

7 years agoMETA_MODE: Don't expect .meta files for side-effect generated files.
Bryan Drewery [Thu, 1 Sep 2016 23:20:54 +0000 (23:20 +0000)]
META_MODE: Don't expect .meta files for side-effect generated files.

This is similar to r301285.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agocxgbe/cxgbei: Minor changes in the iSCSI CPL handlers.
Navdeep Parhar [Thu, 1 Sep 2016 22:40:55 +0000 (22:40 +0000)]
cxgbe/cxgbei: Minor changes in the iSCSI CPL handlers.

- Use m_copydata instead of bcopy.
- Add new assertions.
- Log some more information.

Sponsored by: Chelsio Communications

7 years agoRemove warning about pci_addr_t being different sizes.
John Baldwin [Thu, 1 Sep 2016 21:30:12 +0000 (21:30 +0000)]
Remove warning about pci_addr_t being different sizes.

pci_addr_t has always been 64-bits since r163805.

MFC after: 1 week

7 years agoAdd support for changing A23 PLL1 frequency.
Jared McNeill [Thu, 1 Sep 2016 21:20:07 +0000 (21:20 +0000)]
Add support for changing A23 PLL1 frequency.

7 years agoAdd support for setting DCDC2 voltage.
Jared McNeill [Thu, 1 Sep 2016 21:19:11 +0000 (21:19 +0000)]
Add support for setting DCDC2 voltage.

7 years agoRemove the digi(4) manpage and digi from the release notes.
John Baldwin [Thu, 1 Sep 2016 21:16:29 +0000 (21:16 +0000)]
Remove the digi(4) manpage and digi from the release notes.

7 years agoDIRDEPS_BUILD: Add missing crunchgen host tool.
Bryan Drewery [Thu, 1 Sep 2016 21:15:37 +0000 (21:15 +0000)]
DIRDEPS_BUILD: Add missing crunchgen host tool.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agofgetwc(3) may set both __SEOF and __SERR at once (in case of incomplete
Andrey A. Chernov [Thu, 1 Sep 2016 20:45:04 +0000 (20:45 +0000)]
fgetwc(3) may set both __SEOF and __SERR at once (in case of incomplete
sequence near EOF), so we can't just check for
(wc == WEOF && !__sfeof(fp)) and must relay on __sferror(fp) with
__SERR clearing/restoring.

MFC after:      7 days

7 years agocxgbe/cxgbei: Retire all DDP related code from cxgbei and switch to
Navdeep Parhar [Thu, 1 Sep 2016 20:43:01 +0000 (20:43 +0000)]
cxgbe/cxgbei: Retire all DDP related code from cxgbei and switch to
routines available in t4_tom to manage the iSCSI DDP page pod region.

This adds the ability to use multiple DDP page sizes to the iSCSI
driver, among other improvements.

Sponsored by: Chelsio Communications

7 years agoRemove the digi(4) drivers.
John Baldwin [Thu, 1 Sep 2016 19:51:35 +0000 (19:51 +0000)]
Remove the digi(4) drivers.

These drivers were never updated for the new TTY changes and have
been disconnected from the build since 8.0.

Ok'd by: imp, peterj

7 years agoThe log message for the previous commit didn't mention the most the
Bruce Evans [Thu, 1 Sep 2016 19:18:26 +0000 (19:18 +0000)]
The log message for the previous commit didn't mention the most the
important detail that sc_cngetc() now opens and closes the keyboard
on every call again.  This was moved from sc_cngetc() to scn_cngrab/
ungrab() in r228644, but the change wasn't quite complete.  After
fixes for nesting in kbdd_poll() in ukbd and kbdmux, these opens
and closes should have no significant effect if done while grabbed.
They fix unusual cases when cngetc() is called while not grabbed.

This commit is the main fix for screen locking in sc_cnputc():
detect deadlock or likely-deadlock and handle it by buffering the
output atomically and printing it later if the deadlock condition
clears (and sc_cnputc() is called).

The most common deadlock is when the screen lock is held by ourself.
Then it would be safe to acquire the lock recursively if the console
driver is calling printf() in a safe context, but we don't know when
that is.  It is not safe to ignore the lock even in kdb or panic mode.
But ignore it in panic mode.  The only other known case of deadlock
is when another thread holds the lock but is running on a stopped CPU.
Detect that case approximately by using trylock and retrying for 1000
usec.  On a 4 GHz CPU, 100 usec is almost long enough -- screen switches
take slightly longer than that.  Not retrying at all is good enough
except for stress tests, and planned future versions will extend the
timeout so that the stress tests work better.

To see the behaviour when deadlock is detected, single step through
sctty_outwakeup() (or sc_puts() to start with deadlock).  Another
(serial) console is needed to the buffered-only output, but the
keyboard works in this context to continue or step out of the
deadlocked region.  The buffer is not large enough to hold all the
output for this.

7 years agoMFV r304158:
Alexander Motin [Thu, 1 Sep 2016 18:37:11 +0000 (18:37 +0000)]
MFV r304158:
7136 ESC_VDEV_REMOVE_AUX ought to always include vdev information

7115 6922 generates ESC_ZFS_VDEV_REMOVE_AUX a bit too often

illumos/illumos-gate@b72b6bb10ad55121a1b352c6f68ebdc8e20c9086
https://github.com/illumos/illumos-gate/commit/b72b6bb10ad55121a1b352c6f68ebdc8e
20c9086

https://www.illumos.org/issues/7136
  6922 added ESC_ZFS_VDEV_REMOVE_AUX and ESC_ZFS_VDEV_REMOVE_DEV sysevents
  whenever an aux device gets removed from a pool. However, those sysevents will
  be created without the vdev_guid and vdev_path fields. It would be better to
  always populate those fields.

https://www.illumos.org/issues/7115
  The addition of spa_event_notify in vdev removal code (see #6922) causes event
s
  to be generated even if the spare failed to be removed with EBUSY.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Alan Somers <asomers@gmail.com>

7 years agoMFV r302993: 7104 increase indirect block size
Alexander Motin [Thu, 1 Sep 2016 18:33:39 +0000 (18:33 +0000)]
MFV r302993: 7104 increase indirect block size

illumos/illumos-gate@4b5c8e93cab28d3c65ba9d407fd8f46e3be1db1c
https://github.com/illumos/illumos-gate/commit/4b5c8e93cab28d3c65ba9d407fd8f46e3
be1db1c

https://www.illumos.org/issues/7104
  The current default indirect block size is 16KB. We can improve
  performance by increasing it to 128KB. This is especially helpful for
  any workload that needs to read most of the metadata, e.g.
  scrub/resilver, file deletion, filesystem deletion, and zfs send.
  We also need to fix a few space estimation errors to make the tests
  pass.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMFV r302992: 7071 lzc_snapshot does not fill in errlist on ENOENT
Alexander Motin [Thu, 1 Sep 2016 18:25:49 +0000 (18:25 +0000)]
MFV r302992: 7071 lzc_snapshot does not fill in errlist on ENOENT

illumos/illumos-gate@25f7d993adbfb3452ac4625b3791670746d35ae3
https://github.com/illumos/illumos-gate/commit/25f7d993adbfb3452ac4625b379167074
6d35ae3

https://www.illumos.org/issues/7071
  upstream
  DLPX-40482 lzc_snapshot does not fill in errlist on ENOENT

Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoIf error happens, don't overwrite original errno comes from __mbrtowc()
Andrey A. Chernov [Thu, 1 Sep 2016 18:12:53 +0000 (18:12 +0000)]
If error happens, don't overwrite original errno comes from __mbrtowc()
and __srefill().

MFC after:      3 days

7 years agoPull in r277331 from upstream llvm trunk (by Diana Picus):
Dimitry Andric [Thu, 1 Sep 2016 18:11:44 +0000 (18:11 +0000)]
Pull in r277331 from upstream llvm trunk (by Diana Picus):

  [AArch64] Return the correct size for TLSDESC_CALLSEQ

  The branch relaxation pass is computing the wrong offsets because it assumes
  TLSDESC_CALLSEQ eats up 4 bytes, when in fact it is lowered to an instruction
  sequence taking up 16 bytes. This can become a problem in huge files with lots
  of TLS accesses, as it may slowly move branch targets out of the range computed
  by the branch relaxation pass.

  Fixes PR24234 https://llvm.org/bugs/show_bug.cgi?id=24234

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

This fixes "error in backend: fixup value out of range" when compiling
the misc/talkfilters port for AArch64.

Reported by: sbruno
PR: 201762
MFC after: 3 days

7 years agoFAST_DEPEND/META_MODE: Fix several issues with SRCS containing '/'.
Bryan Drewery [Thu, 1 Sep 2016 17:36:52 +0000 (17:36 +0000)]
FAST_DEPEND/META_MODE: Fix several issues with SRCS containing '/'.

- For FAST_DEPEND, properly apply the -M flags when compiling by
  enduring that the condition also has the s,/,_,g filter applied to it
  first.
- For FAST_DEPEND, properly read from the filtered filename.
- For META_MODE, it needs to read from a full-pathed and s,/,_,g replaced
  filename based on bmake's meta_name() function which names the .meta
  file for SRCS with '/' in them.

This support has not been extended to the kernel build yet but may be in the
future.

MFC after: 2 weeks
Reported by: dim
Sponsored by: EMC / Isilon Storage Division

7 years agoOpenBSD 6.0 added.
Maxim Konovalov [Thu, 1 Sep 2016 17:05:54 +0000 (17:05 +0000)]
OpenBSD 6.0 added.

7 years agoAs an optimization to the machine-independent layer, change the machine-
Alan Cox [Thu, 1 Sep 2016 15:57:44 +0000 (15:57 +0000)]
As an optimization to the machine-independent layer, change the machine-
dependent pmap_ts_referenced() so that it updates the page's dirty field
if a modified bit is found while counting reference bits.  This
opportunistic update can be performed at low cost and can eliminate the
need for some future calls to pmap_is_modified() by the machine-
independent layer.

Reviewed by: kib, markj
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7722

7 years ago- Invert calloc(3) argument order.
Marcelo Araujo [Thu, 1 Sep 2016 15:23:33 +0000 (15:23 +0000)]
- Invert calloc(3) argument order.

MFC after: 4 weeks

7 years agoMFV r302662: 6447 handful of nvpair cleanups
Alexander Motin [Thu, 1 Sep 2016 15:17:39 +0000 (15:17 +0000)]
MFV r302662: 6447 handful of nvpair cleanups

illumos/illumos-gate@759e89be359f2af635e4122d147df56bce948773
https://github.com/illumos/illumos-gate/commit/759e89be359f2af635e4122d147df56bc
e948773

https://www.illumos.org/issues/6447
  I got a patch from someone who uses nvpair code outside of illumos. It fixes a
  couple of gcc warnings/bugs for him.
     1. silence uninitialized use warnings
     2. add parentheses around assignment used as truth value
     3. fix printf format specifier (ll is for integers only)
     4. strstr, strspn, strcspn, and strcmp are declared in string.h, not
        strings.h.
     5. avoid scanning integer into boolean variable

Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Steve Dougherty <sdougherty@barracuda.com>

7 years agoMFV r302661: 7082 bptree_iterate() passes wrong args to zfs_dbgmsg()
Alexander Motin [Thu, 1 Sep 2016 15:10:40 +0000 (15:10 +0000)]
MFV r302661: 7082 bptree_iterate() passes wrong args to zfs_dbgmsg()

illumos/illumos-gate@10e67aa0db0823d5464aafdd681f3c966155c68e
https://github.com/illumos/illumos-gate/commit/10e67aa0db0823d5464aafdd681f3c966
155c68e

https://www.illumos.org/issues/7082
  upstream
  DLPX-40542 bptree_iterate() passes wrong args to zfs_dbgmsg()

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMFV r302660: 6314 buffer overflow in dsl_dataset_name
Alexander Motin [Thu, 1 Sep 2016 15:08:27 +0000 (15:08 +0000)]
MFV r302660: 6314 buffer overflow in dsl_dataset_name

illumos/illumos-gate@9adfa60d484ce2435f5af77cc99dcd4e692b6660
https://github.com/illumos/illumos-gate/commit/9adfa60d484ce2435f5af77cc99dcd4e6
92b6660

https://www.illumos.org/issues/6314
  Callers of dsl_dataset_name pass a buffer of size ZFS_MAXNAMELEN, but
  dsl_dataset_name copies the datasets' name PLUS the snapshot name to it,
  resulting in a max of 2 * ZFS_MAXNAMELEN + '@'.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoo Separate rtc and timecmp registers: they are different across
Ruslan Bukin [Thu, 1 Sep 2016 14:58:11 +0000 (14:58 +0000)]
o Separate rtc and timecmp registers: they are different across
  RISC-V cpu implementations.
o Update RocketChip device tree source (DTS).

We now support latest verison of RocketChip synthesized on
Xilinx FPGA (Zedboard).

RocketChip is an implementation of RISC-V processor written on
Chisel hardware construction language.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoMFV r302659: 6931 lib/libzfs: cleanup gcc warnings
Alexander Motin [Thu, 1 Sep 2016 14:57:06 +0000 (14:57 +0000)]
MFV r302659: 6931 lib/libzfs: cleanup gcc warnings

illumos/illumos-gate@88f61dee20b358671b1b643e9d1dbf220a1d69be
https://github.com/illumos/illumos-gate/commit/88f61dee20b358671b1b643e9d1dbf220a1d69be

https://www.illumos.org/issues/6931
  need cleanup:
  CERRWARN += -_gcc=-Wno-switch
  CERRWARN += -_gcc=-Wno-parentheses
  CERRWARN += -_gcc=-Wno-unused-function

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Igor Kozhukhov <ikozhukhov@gmail.com>

7 years agoMFV r302658: 6872 zfs libraries should not allow uninitialized variables
Alexander Motin [Thu, 1 Sep 2016 14:53:56 +0000 (14:53 +0000)]
MFV r302658: 6872 zfs libraries should not allow uninitialized variables

illumos/illumos-gate@f83b46baf98d276f5f84fa84c8b461f412ac1f5e
https://github.com/illumos/illumos-gate/commit/f83b46baf98d276f5f84fa84c8b461f41
2ac1f5e

https://www.illumos.org/issues/6872
  We compile the zfs libraries with -Wno-uninitialized. We should remove
  this. Change makefiles, fix new warnings, fix pbchk errors.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>

7 years agoMFV r302657: 4521 zfstest is trying to execute evil "zfs unmount -a"
Alexander Motin [Thu, 1 Sep 2016 14:52:05 +0000 (14:52 +0000)]
MFV r302657: 4521 zfstest is trying to execute evil "zfs unmount -a"

illumos/illumos-gate@8808ac5dae118369991f158b6ab736cb2691ecde
https://github.com/illumos/illumos-gate/commit/8808ac5dae118369991f158b6ab736cb2
691ecde

https://www.illumos.org/issues/4521
  zfstest is trying to execute evil "zfs unmount -a", which fails (fortunately,
  as it would otherwise leave me with my ~ missing):
  03:44:11.86 cannot unmount '/export/home/yuri': Device busy cannot unmount '/
  export/home': Device busy
  03:44:11.86 ERROR: /usr/sbin/zfs unmount -a exited 1
  This affects, at least, zfs_mount_009_neg and zfs_mount_all_001_pos, both
  failing on that step. The pool containing the /export/home hierarchy is
  included in KEEP variable, but it doesn't seem to affect anything here.

Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Dan McDonald <danmcd@omniti.com>
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>

7 years agoMFV r302655: 6873 zfs_destroy_snaps_nvl leaks errlist
Alexander Motin [Thu, 1 Sep 2016 14:47:43 +0000 (14:47 +0000)]
MFV r302655: 6873 zfs_destroy_snaps_nvl leaks errlist

illumos/illumos-gate@4cde22c29999ffb907ca39d2ebd512812f7e5168
https://github.com/illumos/illumos-gate/commit/4cde22c29999ffb907ca39d2ebd512812
f7e5168

https://www.illumos.org/issues/6873
  lzc_destroy_snaps() returns an nvlist in errlist.
  zfs_destroy_snaps_nvl() should nvlist_free() it before returning.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Chris Williamson <chris.williamson@delphix.com>

7 years agoMFV r302654:
Alexander Motin [Thu, 1 Sep 2016 14:46:33 +0000 (14:46 +0000)]
MFV r302654:
6879 incorrect endianness swap for drr_spill.drr_length in libzfs_sendrecv.c

illumos/illumos-gate@20fea7a47472aceb64d3ed48cc2a3ea268bc4795
https://github.com/illumos/illumos-gate/commit/20fea7a47472aceb64d3ed48cc2a3ea26
8bc4795

https://www.illumos.org/issues/6879
  In libzfs_sendrecv, there's a typo:
  case DRR_SPILL:
              if (byteswap) {
                  drr->drr_u.drr_write.drr_length =
                      BSWAP_64(drr->drr_u.drr_spill.drr_length);
              }
  Instead of drr_write.drr_length, we should be assigning the result of the
  byteswap to drr_spill.drr_length.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Dan Kimmel <dan.kimmel@delphix.com>

7 years agoMFV r302653: 6111 zfs send should ignore datasets created after the ending snapshot
Alexander Motin [Thu, 1 Sep 2016 14:45:11 +0000 (14:45 +0000)]
MFV r302653: 6111 zfs send should ignore datasets created after the ending snapshot

illumos/illumos-gate@4a20c933b148de8a1c1d3538391c64284e636653
https://github.com/illumos/illumos-gate/commit/4a20c933b148de8a1c1d3538391c64284
e636653

https://www.illumos.org/issues/6111
  If you create a zfs child folder, zfs send returns an error when a recursive
  incremental send is done between two snapshots made prior to the folder
  creation.
  The problem can be reproduced with the following steps.
  root@zfs:/# zfs create pool/test
  root@zfs:/# zfs snapshot pool/test@snap1
  root@zfs:/# zfs snapshot pool/test@snap2
  root@zfs:/# zfs create pool/test/child
  root@zfs:/# zfs send -R -I pool/test@snap1 pool/test@snap2 > /dev/null
  WARNING: could not send pool/test/child@snap2: does not exist
  WARNING: could not send pool/test/child@snap2: does not exist
  root@zfs:/# echo $?
  1
  root@zfs:/# zfs snapshot -r pool/test@snap3
  root@zfs:/# zfs send -R -I pool/test@snap1 pool/test@snap3 > /dev/null
  root@zfs:/# echo $?
  0
  root@zfs:/# zfs send -R -I pool/test@snap2 pool/test@snap3 > /dev/null
  root@zfs:/# echo $?
  0
  Since pool/test/child was created after snap2, zfs send should not expect snap2
  to be in pool/test/child when doing a recursive send. It should examine the
  compare the creation time of the snapshot and each child folder to decide if
  the folder will be sent. The next incremental send between snap2 and snap3
  would properly create the child folder and snap3 which first appears in the
  child folder.
  The problem is identical if '-i' is used instead of '-I'.

Reviewed by: Alex Aizman alex.aizman@nexenta.com
Reviewed by: Alek Pinchuk alek.pinchuk@nexenta.com
Reviewed by: Roman Strashkin roman.strashkin@nexenta.com
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Alex Deiter <alex.deiter@nexenta.com>

7 years agoMFV r302651: 7054 dmu_tx_hold_t should use refcount_t to track space
Alexander Motin [Thu, 1 Sep 2016 14:38:25 +0000 (14:38 +0000)]
MFV r302651: 7054 dmu_tx_hold_t should use refcount_t to track space

illumos/illumos-gate@0c779ad424a92a84d1e07d47cab7f8009189202b
https://github.com/illumos/illumos-gate/commit/0c779ad424a92a84d1e07d47cab7f8009
189202b

https://www.illumos.org/issues/7054
  upstream:
  ee0003de7d3e598499be7ac3fe6b61efcc47cb7f
  DLPX-40399 dmu_tx_hold_t should use refcount_t to track space

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMFV r302648: 7019 zfsdev_ioctl skips secpolicy when FKIOCTL is set
Alexander Motin [Thu, 1 Sep 2016 14:24:54 +0000 (14:24 +0000)]
MFV r302648: 7019 zfsdev_ioctl skips secpolicy when FKIOCTL is set

Note that the bulk of the upstream change is not applicable to FreeBSD
and the affected files are not even in the vendor area.

illumos/illumos-gate@45b1747515a17db45e8971501ee84a26bdff37b2
https://github.com/illumos/illumos-gate/commit/45b1747515a17db45e8971501ee84a26bdff37b2

https://www.illumos.org/issues/7019
  Currently zfsdev_ioctl, when confronted by a request with the FKIOCTL flag set,
  skips all processing of secpolicy functions. This means that ZFS is not doing
  any kind of verification of the credentials or access rights of the caller and
  assuming that (as it is an in-kernel client) all such checks have already been
  done.
  This turns out to be quite a dangerous assumption, especially with respect to
  sdev. In general I don't think it's particularly reasonable to offload this
  enforcement of access rights onto other kernel subsystems when ZFS has some
  particular local semantics in this area (delegated datasets etc) and does not
  provide any kind of API to allow other subsystems to avoid code duplication
  when doing it. ZFS should apply its normal access policy to requests from
  within the kernel, and callers should take care to give it the correct
  credentials and call it from the correct context in order to get the results
  they need.
  You can observe the currently unfortunate consequences of this bug in any non-
  global zone that has access to /dev/zvol or any subset of it via sdev profiles.
  In particular, a zone used to contain a KVM or similar which has a single zvol
  passed through to it using a <device match= block in its zone XML.
  Even though sdev makes something of an attempt to control for whether the
  caller should have access to nodes in /dev/zvol, it doesn't do this correctly,
  or really at all in the lookup call path. So, if we have a zone that's been
  given access to any part of /dev/zvol, it can simply look up the full path to
  any other zvol on the entire system, and the node will appear and be able to be
  used.

Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Alex Wilson <alex.wilson@joyent.com>

7 years agoMFV r302647: 6922 Emit ESC_ZFS_VDEV_REMOVE_AUX after removing an aux device
Alexander Motin [Thu, 1 Sep 2016 14:17:30 +0000 (14:17 +0000)]
MFV r302647: 6922 Emit ESC_ZFS_VDEV_REMOVE_AUX after removing an aux device

illumos/illumos-gate@63364b0ee2604783e7a55f8425888867768eafa4
https://github.com/illumos/illumos-gate/commit/63364b0ee2604783e7a55f84258888677
68eafa4

https://www.illumos.org/issues/6922
  ZFS does not do a config_sync after removing an aux (spare, log, or cache)
  device. AFAICT this isn't being done because it is slow and was deemed
  unnecessary. However, it should be such a rare operation that speed doesn't
  matter, and not doing it results in two problems:
  1) It is theoretically possible to remove an aux device from one pool and
  attach it to another, then lose power. When power is restored, both pools woul
d
  think that they own the aux device.
  2) Removal of the aux device doesn't send any useful sysevents to userland.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Alan Somers <asomers@gmail.com>

7 years agoMFV r302646:
Alexander Motin [Thu, 1 Sep 2016 14:06:30 +0000 (14:06 +0000)]
MFV r302646:
6980 6902 causes zfs send to break due to 32-bit/64-bit struct mismatch

illumos/illumos-gate@ea4a67f462de0a39a9adea8197bcdef849de5371
https://github.com/illumos/illumos-gate/commit/ea4a67f462de0a39a9adea8197bcdef84
9de5371

https://www.illumos.org/issues/6980
  doing zfs send -i snap1 snap2 >testfile results in
  internal error: Invalid argument
  Abort (core dumped)

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years ago[BHND/PMU] Correct shift of bits in BHND_PMU_SET_BITS macro
Michael Zhilin [Thu, 1 Sep 2016 13:38:46 +0000 (13:38 +0000)]
[BHND/PMU] Correct shift of bits in BHND_PMU_SET_BITS macro

The purpose of BHND_PMU_{GET,SET}_BITS macro is to transform values from/into
register format. SET macro shifts value to left and applies filter mask.
GET macro applies filter mask and then shifts value to right.

Reviewed by:    landonf, adrian (mentor)
Approved by:    adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7721

7 years agoMFV r302643:
Alexander Motin [Thu, 1 Sep 2016 13:29:53 +0000 (13:29 +0000)]
MFV r302643:
6902 speed up listing of snapshots if requesting name only and sorting by name

This was our change from the beginning, so just reduce the upstream diff.

7 years agoMFV r302642:
Alexander Motin [Thu, 1 Sep 2016 13:14:31 +0000 (13:14 +0000)]
MFV r302642:
6876 Stack corruption after importing a pool with a too-long name

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

https://www.illumos.org/issues/6876
  Calling dsl_dataset_name on a dataset with a 256 byte buffer is asking for
  trouble. We should check every dataset on import, using a 1024 byte buffer and
  checking each time to see if the dataset's new name is longer than 256 bytes.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Paul Dagnelie <pcd@delphix.com>

7 years agoMFV r302642:
Alexander Motin [Thu, 1 Sep 2016 13:04:36 +0000 (13:04 +0000)]
MFV r302642:
6876 Stack corruption after importing a pool with a too-long name

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

https://www.illumos.org/issues/6876
  Calling dsl_dataset_name on a dataset with a 256 byte buffer is asking for
  trouble. We should check every dataset on import, using a 1024 byte buffer and
  checking each time to see if the dataset's new name is longer than 256 bytes.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Paul Dagnelie <pcd@delphix.com>

7 years agoFix arm64 superpages bugs in pmap_enter:
Andrew Turner [Thu, 1 Sep 2016 10:26:06 +0000 (10:26 +0000)]
Fix arm64 superpages bugs in pmap_enter:
 * Pass the correct virtual address when demoting a superpage
 * Use the correct l3 table after demoting a superpage
 * Remove an invalid KASSERT hit demoting then promoting a superpage [1]

With this it is believed that  superpages on arm64 is stable.

Reported by: [1] cognet
Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agonet/rndis: Define types for RNDIS pktinfo rm_type field.
Sepherosa Ziehau [Thu, 1 Sep 2016 07:17:06 +0000 (07:17 +0000)]
net/rndis: Define types for RNDIS pktinfo rm_type field.

They are defined by NDIS spec, so the NDIS prefix.

Reviewed by: hps
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7717

7 years agohyperv/hn: Fix VLAN tag construction.
Sepherosa Ziehau [Thu, 1 Sep 2016 07:04:47 +0000 (07:04 +0000)]
hyperv/hn: Fix VLAN tag construction.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7716

7 years agobd_int13probe() should check extended info if sector info is bad
Toomas Soome [Thu, 1 Sep 2016 06:35:13 +0000 (06:35 +0000)]
bd_int13probe() should check extended info if sector info is bad

In some Dell systems and usb stick combinations, it is found that
int13 AH=08 is reporting back bad sector information, preventing the
boot.

This update is allowing bd_int13probe() to use extended info call to
build disk properties.

It also can happen the total sectors count from extended info may be
wrong, in such case, the CHS data is used to calculate total sectors.

Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D7718

7 years agonet/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
Sepherosa Ziehau [Thu, 1 Sep 2016 06:32:35 +0000 (06:32 +0000)]
net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.

Reviewed by: araujo, hps
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7710

7 years agohyperv/hn: Stringent per-packet-info verification.
Sepherosa Ziehau [Thu, 1 Sep 2016 06:05:08 +0000 (06:05 +0000)]
hyperv/hn: Stringent per-packet-info verification.

While I'm here, minor style changes.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7709

7 years agonet/rndis: Define per-packet-info for RNDIS packet message
Sepherosa Ziehau [Thu, 1 Sep 2016 05:40:13 +0000 (05:40 +0000)]
net/rndis: Define per-packet-info for RNDIS packet message

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7708

7 years agohyperv/hn: Remove unused function
Sepherosa Ziehau [Thu, 1 Sep 2016 05:29:58 +0000 (05:29 +0000)]
hyperv/hn: Remove unused function

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7706

7 years agonet/rndis: Add comment for rndis_set_parameter
Sepherosa Ziehau [Thu, 1 Sep 2016 05:15:04 +0000 (05:15 +0000)]
net/rndis: Add comment for rndis_set_parameter

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7705

7 years agoallow kern.proc.nfds sysctl in capability mode
Ed Maste [Thu, 1 Sep 2016 02:51:50 +0000 (02:51 +0000)]
allow kern.proc.nfds sysctl in capability mode

Reviewed by: allanjude
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7733

7 years agoDon't bake all of CC/CPP/CXX into CFLAGS
Enji Cooper [Thu, 1 Sep 2016 02:42:11 +0000 (02:42 +0000)]
Don't bake all of CC/CPP/CXX into CFLAGS

Capture executable names for CC, CPP, CXX (assumed to be the
first non-CCACHE_BIN word).

This change strips out all of the cross-compiler arguments, (-target,
-B, etc), added to ${CC}, etc via ${CROSSENV} in Makefile.inc1, so it
doesn't infect the build and subsequently the test.

Add comments noting why this logic is being added, and why the logic in
r305041 was necessary/what it was trying to achieve.

This is required after recent changes made to the toolchain to always
specify --sysroot, -target, -B, etc with clang in buildworld (presumably
r304681).

Reviewed by: rodrigc (earlier version)
Reported by: Jenkins (FreeBSD_HEAD job from 559+)
MFC after: 12 days
X-MFC with: r304681, r305041
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7732

7 years ago_taskqueue_start_threads() now fails if it doesn't actually start any threads.
Patrick Kelsey [Thu, 1 Sep 2016 02:05:46 +0000 (02:05 +0000)]
_taskqueue_start_threads() now fails if it doesn't actually start any threads.

Reviewed by: jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7701

7 years agoFix linker warnings (errors on gcc) that resulted from r304510.
Eric Joyner [Thu, 1 Sep 2016 01:08:18 +0000 (01:08 +0000)]
Fix linker warnings (errors on gcc) that resulted from r304510.

The variables that are extern in the netmap header file should be
defined in ixl_txrx.c (the file that is included in both ixl(4)/ixlv(4),
not in the main driver source files.

Reported by: ed@, dim@, ngie@

7 years agocxgbe/t4_tom: Two new routines to allocate and write page pods for a
Navdeep Parhar [Thu, 1 Sep 2016 00:51:59 +0000 (00:51 +0000)]
cxgbe/t4_tom: Two new routines to allocate and write page pods for a
buffer in the kernel's address space.

7 years agocxgbe/t4_tom: Add general purpose routines to deal with page pod regions
Navdeep Parhar [Wed, 31 Aug 2016 23:23:46 +0000 (23:23 +0000)]
cxgbe/t4_tom: Add general purpose routines to deal with page pod regions
and allocations within them.  Switch to these routines to manage the TOE
DDP region.

Sponsored by: Chelsio Communications

7 years agoRename unp_dispose_so() to unp_dispose().
Mark Johnston [Wed, 31 Aug 2016 21:48:22 +0000 (21:48 +0000)]
Rename unp_dispose_so() to unp_dispose().

It implements the dom_dispose method for local socket domain, so its name
should match the method name.

7 years agoSet UEFI boot loader PE/COFF timestamps to known value for reproducible builds
Ed Maste [Wed, 31 Aug 2016 21:35:38 +0000 (21:35 +0000)]
Set UEFI boot loader PE/COFF timestamps to known value for reproducible builds

Reviewed by: rpokala
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7633

7 years agousers: don't build when we don't have a C++ toolchain
Ed Maste [Wed, 31 Aug 2016 21:12:50 +0000 (21:12 +0000)]
users: don't build when we don't have a C++ toolchain

(On RISC-V MK_CXX is in BROKEN_OPTIONS, so users remains skipped there.)

Reviewed by: bdrewery
Differential Revision: https://reviews.freebsd.org/D7725

7 years agoreadelf: silence GCC 4.2.1 uninitialized variable warning
Ed Maste [Wed, 31 Aug 2016 21:04:58 +0000 (21:04 +0000)]
readelf: silence GCC 4.2.1 uninitialized variable warning

Sponsored by: The FreeBSD Foundation