]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r305326: MFV r303079:
mav [Fri, 14 Oct 2016 07:20:07 +0000 (07:20 +0000)]
MFC r305326: 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 agoMFC r305325: MFV r303078:
mav [Fri, 14 Oct 2016 07:18:27 +0000 (07:18 +0000)]
MFC r305325: 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 agoMFC r305324: MFV r303077:
mav [Fri, 14 Oct 2016 07:16:11 +0000 (07:16 +0000)]
MFC r305324: 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 agoMFC r305323: MFV r302991: 6950 ARC should cache compressed data
mav [Fri, 14 Oct 2016 07:13:43 +0000 (07:13 +0000)]
MFC r305323: 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 agoMFC r306747, r307042: Fix ABI compat shims, broken by adding NVMe support.
mav [Fri, 14 Oct 2016 06:56:06 +0000 (06:56 +0000)]
MFC r306747, r307042: Fix ABI compat shims, broken by adding NVMe support.

7 years agoMFC r306464
hiren [Fri, 14 Oct 2016 01:38:29 +0000 (01:38 +0000)]
MFC r306464

This adds a sysctl which allows you to disable the TCP hostcache. This is handy
during testing of network related changes where cached entries may pollute your
results, or during known congestion events where you don't want to unfairly
penalize hosts.

Prior to r232346 this would have meant you would break any connection with a sub
1500 MTU, as the hostcache was authoritative. All entries as they stand today
should simply be used to pre populate values for efficiency.

7 years agoMFC r306458: Properly preserve ip_tos bits for IPv4 packets
lidl [Thu, 13 Oct 2016 03:10:04 +0000 (03:10 +0000)]
MFC r306458: Properly preserve ip_tos bits for IPv4 packets

Restructure code slightly to save ip_tos bits earlier.  Fix the bug
where the ip_tos field is zeroed out before assigning to the iptos
variable. Restore the ip_tos and ip_ver fields only if they have
been zeroed during the pseudo-header checksum calculation.

7 years agoMFC r306696: Make 502.pfdenied find blacklistd/* filter names dynamically
lidl [Thu, 13 Oct 2016 03:08:32 +0000 (03:08 +0000)]
MFC r306696: Make 502.pfdenied find blacklistd/* filter names dynamically

This change is needed to make the 520.pfdenied script find the new
blacklistd/* anchor points for reporting blocked traffic.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r306695: Make blacklist-helper commands emit a message when successful
lidl [Thu, 13 Oct 2016 03:06:23 +0000 (03:06 +0000)]
MFC r306695: Make blacklist-helper commands emit a message when successful

The blacklistd daemon expects to see a message on stdout, instead
of just relying on the exit value from any invoked programs.

Change the pf filtering to create multiple filters, attached under
a the "blacklist/*" anchor point.  This prevents the filtering for
each port's filtering rule from overwriting the previously installed
filtering rule.  Check for an existing filtering rule for each port,
so the installation of a given filtering rule only happens once.
Reinstalling the same rule resets the counters for the pf rule, and
we don't want that.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r306766:
jtl [Thu, 13 Oct 2016 02:32:41 +0000 (02:32 +0000)]
MFC r306766:
  Remove declaration of un-defined function tcp_seq_subtract().

7 years agoMFC r303818, r303833, r303941, r304478, r304481, r304483, r304484, r304554,
ed [Wed, 12 Oct 2016 12:17:41 +0000 (12:17 +0000)]
MFC r303818, r303833, r303941, r304478, r304481, r304483, r304484, r304554,
    r304555, r304556, r304557, r304558, r304559, r304561, r304563, r304564,
    r304565, r304615, r304742, r304743, r304744, r304745, r304748, r304886,
    r304991, r305928, r305938, r305987, r306185:

  Bring CloudABI support back in sync with HEAD.

  - Add support for running 32-bit executables on amd64, armv6 and i386.

  - As these new architectures require the use of the vDSO, merge back
    vDSO support for 64-bit executables running on amd64 and arm64 as
    well. This has the advantage that support for vDSO-less execution
    can be phased out when 11.0 becomes unsupported, as opposed to 11.x.

  This change has been tested by running the cloudlibc unit tests on all
  supported architectures, which seems to work fine.

7 years agoMFC r306665: zfs: fix a wrong assertion for extended attributes
avg [Wed, 12 Oct 2016 11:48:14 +0000 (11:48 +0000)]
MFC r306665: zfs: fix a wrong assertion for extended attributes

PR: 213112

7 years agoMFC r306670:
mm [Wed, 12 Oct 2016 10:28:22 +0000 (10:28 +0000)]
MFC r306670:
Sync libarchive with vendor including security fixes.

Important vendor bugfixes (relevant to FreeBSD):
#747: Out of bounds read in mtree parser
#761: heap-based buffer overflow in read_Header (7-zip)
#794: Invalid file on bsdtar command line results in internal errors (1)

PR: 213092 (1)

7 years agoMFC r306162:
ed [Wed, 12 Oct 2016 09:17:41 +0000 (09:17 +0000)]
MFC r306162:

  Make it possible to safely use TPIDRURW from userspace.

  On amd64, arm64 and i386, we have the possibility to switch between TLS
  areas in userspace. The nice thing about this is that it makes it easier
  to do light-weight threading, if we ever feel like doing that. On armv6,
  let's go into the same direction by making it possible to safely use the
  TPIDRURW register, which is intended for this purpose.

  Clean up the ARMv6 code to remove md_tp entirely. Simply add a dedicated
  field to the PCB to hold the value of TPIDRURW across context switches,
  like we do for any other register. As userspace currently uses the
  read-only TPIDRURO register, simply ensure that we keep both values in
  sync where possible. The system calls for modifying the read-only
  register will simply write the intended value into both registers, so
  that it lazily ends up in the PCB during the next context switch.

  Approved by:    andrew
  Reviewed by:    imp
  Differential Revision:  https://reviews.freebsd.org/D7951

7 years agoMFC r304740:
ed [Wed, 12 Oct 2016 09:16:16 +0000 (09:16 +0000)]
MFC r304740:

  Add missing header dependency.

  This header depends on sigaltstack32 being declared.

7 years agoMFC 306699: Do not retry on some security sense codes.
mav [Wed, 12 Oct 2016 05:50:13 +0000 (05:50 +0000)]
MFC 306699: Do not retry on some security sense codes.

7 years agoMFC r305224: MFV r304158:
mav [Wed, 12 Oct 2016 05:20:06 +0000 (05:20 +0000)]
MFC r305224: 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 agoMFC r305222: MFV r302993: 7104 increase indirect block size
mav [Wed, 12 Oct 2016 05:19:08 +0000 (05:19 +0000)]
MFC r305222: 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 agoMFC r305221: MFV r302992: 7071 lzc_snapshot does not fill in errlist on ENOENT
mav [Wed, 12 Oct 2016 05:17:17 +0000 (05:17 +0000)]
MFC r305221: 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 agoMFC r305211: MFV r302662: 6447 handful of nvpair cleanups
mav [Wed, 12 Oct 2016 05:16:33 +0000 (05:16 +0000)]
MFC r305211: 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 agoMFC r305210: MFV r302661:
mav [Wed, 12 Oct 2016 05:15:53 +0000 (05:15 +0000)]
MFC r305210: 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 agoMFC r305209: MFV r302660: 6314 buffer overflow in dsl_dataset_name
mav [Wed, 12 Oct 2016 05:15:09 +0000 (05:15 +0000)]
MFC r305209: 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 agoMFC r305206: MFV r302658:
mav [Wed, 12 Oct 2016 05:14:04 +0000 (05:14 +0000)]
MFC r305206: 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 agoMFC r305205: MFV r302657:
mav [Wed, 12 Oct 2016 05:13:12 +0000 (05:13 +0000)]
MFC r305205: 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 agoMFC r305203: MFV r302655: 6873 zfs_destroy_snaps_nvl leaks errlist
mav [Wed, 12 Oct 2016 05:10:48 +0000 (05:10 +0000)]
MFC r305203: 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 agoMFC r305202: MFV r302654:
mav [Wed, 12 Oct 2016 05:10:05 +0000 (05:10 +0000)]
MFC r305202: 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 agoMFC r305201: MFV r302653:
mav [Wed, 12 Oct 2016 05:09:22 +0000 (05:09 +0000)]
MFC r305201: 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 agoMFC r305197: MFV r302646:
mav [Wed, 12 Oct 2016 05:08:09 +0000 (05:08 +0000)]
MFC r305197: 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 agoMFC r305194: MFV r302642:
mav [Wed, 12 Oct 2016 05:04:36 +0000 (05:04 +0000)]
MFC r305194: 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 agoMFC r305628: intro(2),_exit(2): Update for reaper (procctl(PROC_REAP_ACQUIRE)).
jilles [Tue, 11 Oct 2016 21:59:22 +0000 (21:59 +0000)]
MFC r305628: intro(2),_exit(2): Update for reaper (procctl(PROC_REAP_ACQUIRE)).

7 years agoUse the sponsors/vendors entities in the errata docs.
gjb [Tue, 11 Oct 2016 17:47:54 +0000 (17:47 +0000)]
Use the sponsors/vendors entities in the errata docs.

Sponsored by: The FreeBSD Foundation

7 years agoAdd missing ThunderX release notes
emaste [Tue, 11 Oct 2016 17:12:26 +0000 (17:12 +0000)]
Add missing ThunderX release notes

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D8217

7 years agoSwitch stable/11 to -STABLE following the release.
gjb [Tue, 11 Oct 2016 16:38:39 +0000 (16:38 +0000)]
Switch stable/11 to -STABLE following the release.

Reminded by: Piotr Smyrak
Sponsored by: The FreeBSD Foundation

7 years agoMFC r305207: MFV r302659: 6931 lib/libzfs: cleanup gcc warnings
mav [Tue, 11 Oct 2016 16:33:43 +0000 (16:33 +0000)]
MFC r305207: 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 agoMFC r305200: MFV r302651:
mav [Tue, 11 Oct 2016 16:32:49 +0000 (16:32 +0000)]
MFC r305200: 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 agoMFC r305199: MFV r302648: 7019 zfsdev_ioctl skips secpolicy when FKIOCTL is set
mav [Tue, 11 Oct 2016 16:31:55 +0000 (16:31 +0000)]
MFC r305199: 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 agoMFC r305198: MFV r302647:
mav [Tue, 11 Oct 2016 16:30:49 +0000 (16:30 +0000)]
MFC r305198: 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 agoMFC r305195: MFV r302643:
mav [Tue, 11 Oct 2016 16:29:43 +0000 (16:29 +0000)]
MFC r305195: 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 agoMFC r305193: MFV r302642:
mav [Tue, 11 Oct 2016 16:26:58 +0000 (16:26 +0000)]
MFC r305193: 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 agoAdd Cavium sponsor entity
emaste [Tue, 11 Oct 2016 13:22:37 +0000 (13:22 +0000)]
Add Cavium sponsor entity

7 years agoMFC 306480
sephe [Tue, 11 Oct 2016 02:08:09 +0000 (02:08 +0000)]
MFC 306480

    linuxkpi: Fix PCI BAR lazy allocation support.

    FreeBSD supports lazy allocation of PCI BAR, that is, when a device
    driver's attach method is invoked, even if the device's PCI BAR
    address wasn't initialized, the invocation of bus_alloc_resource_any()
    (the call chain: pci_alloc_resource() -> pci_alloc_multi_resource() ->
    pci_reserve_map() -> pci_write_bar()) would allocate a proper address
    for the PCI BAR and write this 'lazy allocated' address into the PCI
    BAR.

    This model works fine for native FreeBSD device drivers, but _not_ for
    device drivers shared with Linux (e.g. dev/mlx5/mlx5_core/mlx5_main.c
    and ofed/drivers/net/mlx4/main.c.  Both of them use
    pci_request_regions(), which doesn't work properly with the PCI BAR
    lazy allocation, because pci_resource_type() -> _pci_get_rle() always
    returns NULL, so pci_request_regions() doesn't have the opportunity to
    invoke bus_alloc_resource_any().  We now use pci_find_bar() in
    pci_resource_type(), which is able to locate all available PCI BARs
    even if some of them will be lazy allocated.

    Submitted by:   Dexuan Cui <decui microsoft com>
    Reviewed by:    hps
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8071

7 years agoCorrect an entry from the release announcement.
gjb [Mon, 10 Oct 2016 23:35:55 +0000 (23:35 +0000)]
Correct an entry from the release announcement.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r305676: wait: Do not copyout uninitialized status/rusage/wrusage.
jilles [Mon, 10 Oct 2016 20:24:32 +0000 (20:24 +0000)]
MFC r305676: wait: Do not copyout uninitialized status/rusage/wrusage.

If wait4() or wait6() return 0 because of WNOHANG, the status, rusage and
wrusage information should not be returned.

PR: 212048
Reported by: Casey Lucas

7 years agoMFC r306611:
sevan [Mon, 10 Oct 2016 16:41:17 +0000 (16:41 +0000)]
MFC r306611:
Amend history to mention predecessor originated from 386BSD[1] & current implementation from NetBSD[2].
Reword history since the utility was renamed once more in FreeBSD 5.0.
Separate out author & historical information regarding character code conversion.
Add AUTHORS section.

[1] https://groups.google.com/forum/#!search/mount_pcfs.c/comp.unix.bsd/9qhH0v1tZm0/inlPnXZj_2sJ
[2] http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/mount_msdos/mount_msdos.c?rev=1.6&content-type=text/x-cvsweb-markup

PR: 212536
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306610:
sevan [Mon, 10 Oct 2016 16:38:52 +0000 (16:38 +0000)]
MFC r306610:
Note mount_fusefs appeared in FreeBSD 10.
Move note regarding implementation to caveats.
Address issued raised by Igor.

PR:             212513
Approved by:    bcr (mentor)
Differential Revision:  https://reviews.freebsd.org/D8105

7 years agoMFC r306607:
sevan [Mon, 10 Oct 2016 16:35:25 +0000 (16:35 +0000)]
MFC r306607:
mksnap_ffs appeared in FreeBSD 5.1.

PR: 212510
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306606:
sevan [Mon, 10 Oct 2016 16:33:44 +0000 (16:33 +0000)]
MFC r306606:
mknod appeared in V4 UNIX
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V4/man/man8/mknod.8

PR:             212509
Approved by:    bcr (mentor)
Differential Revision:  https://reviews.freebsd.org/D8105

7 years agoMFC r306605:
sevan [Mon, 10 Oct 2016 16:29:14 +0000 (16:29 +0000)]
MFC r306605:
init was there in UNIX from V1
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/init.s

PR: 212503
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306604:
sevan [Mon, 10 Oct 2016 16:27:32 +0000 (16:27 +0000)]
MFC r306604:
gbde first appeared in FreeBSD 5.0

PR:             212478
Approved by:    brc (mentor)
Differential Revision:  https://reviews.freebsd.org/D8105

7 years agoMFC r306603:
sevan [Mon, 10 Oct 2016 16:24:05 +0000 (16:24 +0000)]
MFC r306603:
Document which version of BSD first showed up in and add the version info
for NetBSD & FreeBSD.

PR: 212477
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306602:
sevan [Mon, 10 Oct 2016 16:22:34 +0000 (16:22 +0000)]
MFC r306602:
Mention the version of NetBSD the utility originated from.

PR:             212476
Approved by:    bcr (mentor)
Differential Revision:  https://reviews.freebsd.org/D8105

7 years agoMFC r306601:
sevan [Mon, 10 Oct 2016 16:16:26 +0000 (16:16 +0000)]
MFC r306601:
dumpon(8) appears to be present in FreeBSD 2.0.5,
despite initial import of man page listed FreeBSD 2.1.

PR: 212445
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306600:
sevan [Mon, 10 Oct 2016 16:14:49 +0000 (16:14 +0000)]
MFC r306600:
dump(8) first appeared in V4 UNIX
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V4/man/man8

PR:             212444
Approved by:    bcr (mentor)
Obtained from:  TUHS
Differential Revision:  https://reviews.freebsd.org/D8105

7 years agoMFC r306598
sevan [Mon, 10 Oct 2016 16:11:02 +0000 (16:11 +0000)]
MFC r306598
ccdconfig first appeared in NetBSD 1.1
From NetBSD man page, confirmed with repo tags in CVS [1]
(there was also no 1.0a release according to [2])

[1] http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/ccdconfig/ccdconfig.c
[2] http://netbsd.org/releases/formal.html#history

PR: 212437
Approved by: bcr (mentor)
Obtained from: NetBSD
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306582:
sevan [Mon, 10 Oct 2016 16:08:29 +0000 (16:08 +0000)]
MFC r306582:
"POSIX doesn't specify -h." - r1.27 from NetBSD
http://man.openbsd.org/?query=chmod&apropos=0&sec=0&arch=default&manpath=POSIX-2013

PR:             212337
Approved by:    bcr (mentor)
Obtained from:  NetBSD
Differential Revision:  https://reviews.freebsd.org/D8118

7 years agoFix a typo.
gjb [Mon, 10 Oct 2016 16:06:55 +0000 (16:06 +0000)]
Fix a typo.

Spotted by: lidl
Sponsored by: The FreeBSD Foundation

7 years agoMFC r306581:
sevan [Mon, 10 Oct 2016 15:53:56 +0000 (15:53 +0000)]
MFC r306581:
Use .At macro instead of specifying AT&T UNIX literaly.

PR: 212034
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8114

7 years ago- Add known-issue entries for 11.0-RELEASE errata.html.
gjb [Mon, 10 Oct 2016 15:49:49 +0000 (15:49 +0000)]
- Add known-issue entries for 11.0-RELEASE errata.html.
- Bump version numbers in release.ent.
- Bump the copyright year for the errata file.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r306714:
sevan [Mon, 10 Oct 2016 15:47:39 +0000 (15:47 +0000)]
MFC r306714:
Document where chio(1) originated from & which version of FreeBSD first
included it.

PR:           211776
Approved by:  bcr (mentor)
Differential Revision:        https://reviews.freebsd.org/D8104

7 years agoMFC r306584:
sevan [Mon, 10 Oct 2016 15:42:50 +0000 (15:42 +0000)]
MFC r306584:
Move the description of CHANGER variable to ENVIRONMENT section rather than
in the DESCRIPTION section.
From OpenBSD src/bin/chio/chio.1 r1.23

PR:           212158
Approved by:  bjk
Obtained from:        OpenBSD
Differential Revision:        https://reviews.freebsd.org/D8117

7 years agoMFC: r306318
tijl [Mon, 10 Oct 2016 11:51:47 +0000 (11:51 +0000)]
MFC: r306318

Allocate a zeroed LDT.

Failing to do this might result in the LDT appearing to run out of free
descriptors because of random junk in the descriptor's 'sd_type' field.

http://lists.freebsd.org/pipermail/freebsd-amd64/2014-May/016088.html

PR: 212639
Submitted by: wheelcomplex@gmail.com

7 years agoMFC r306478:
hselasky [Mon, 10 Oct 2016 11:46:08 +0000 (11:46 +0000)]
MFC r306478:
Add new USB ID.

While at it remove some whitespaces.

Submitted by: Jose Luis Duran <jlduran@gmail.com>
PR: 213110

7 years agoMFC r306454:
hselasky [Mon, 10 Oct 2016 11:42:25 +0000 (11:42 +0000)]
MFC r306454:
Set hardware stats flag to avoid double counting the number of incoming bytes.

Found by: Ben RUBSON <ben.rubson@gmail.com>
Sponsored by: Mellanox Technologies

7 years agoMFC r306453:
hselasky [Mon, 10 Oct 2016 11:38:55 +0000 (11:38 +0000)]
MFC r306453:
Set hardware stats flag to avoid double counting the number of incoming bytes.

Found by: Ben RUBSON <ben.rubson@gmail.com>

7 years agoMFC r306451:
hselasky [Mon, 10 Oct 2016 11:30:35 +0000 (11:30 +0000)]
MFC r306451:
The IORESOURCE_XXX defines should resemble a bitmask while SYS_RES_XXX
are not bitmasks. Fix return value of pci_resource_flags() to reflect
this change.

Sponsored by: Mellanox Technologies

7 years agoMFC r306441 and r306634:
hselasky [Mon, 10 Oct 2016 11:22:11 +0000 (11:22 +0000)]
MFC r306441 and r306634:
While draining a timeout task prevent the taskqueue_enqueue_timeout()
function from restarting the timer.

Commonly taskqueue_enqueue_timeout() is called from within the task
function itself without any checks for teardown. Then it can happen
the timer stays active after the return of taskqueue_drain_timeout(),
because the timeout and task is drained separately.

This patch factors out the teardown flag into the timeout task itself,
allowing existing code to stay as-is instead of applying a teardown
flag to each and every of the timeout task consumers.

Add assert to taskqueue_drain_timeout() which prevents parallel
execution on the same timeout task.

Update manual page documenting the return value of
taskqueue_enqueue_timeout().

Differential Revision: https://reviews.freebsd.org/D8012
Reviewed by: kib, trasz

7 years agoMFC r306443:
jch [Sun, 9 Oct 2016 21:02:33 +0000 (21:02 +0000)]
MFC r306443:

Fix an issue with accept_filter introduced with r261242:

As a side effect of r261242 when using accept_filter the
first call to soisconnected() is done earlier in tcp_input()
instead of tcp_do_segment() context.  Restore the expected behaviour.

Note:  This call to soisconnected() seems to be extraneous in all
cases (with or without accept_filter).  Will be addressed in a
separate commit.

PR: 212920
Reported by: Alexey
Tested by: Alexey, jch
Sponsored by: Verisign, Inc.

7 years agoMFC r306560, r306561:
pfg [Sun, 9 Oct 2016 20:12:58 +0000 (20:12 +0000)]
MFC r306560, r306561:
patch(1): make some macros look boolean.

Minor cleanup inspired by a new patch(1) variant in schily tools.

For reference:
https://sourceforge.net/p/schillix-on/

7 years agoMFC r305813:
pfg [Sun, 9 Oct 2016 20:07:01 +0000 (20:07 +0000)]
MFC r305813:
localedef(1): make better use of calloc(3) arguments.

The first argument of calloc(3) should be an ordinal type, and the
second a size: split a multiplication to make better use of calloc(3)
and detect overflows.

Do some other re-ordering and style fixes while here.

7 years agoMFC r305812:
pfg [Sun, 9 Oct 2016 19:57:20 +0000 (19:57 +0000)]
MFC r305812:

fifolog(1): invert order of calloc(3) arguments.

The second argument to calloc(3) should be the size, make it so.

While here be a little bit more cautious in fifolog_reader_open()
to protect in the unlikely event of an overflowed allocation.

7 years agoMFC r306658: Clear GT_CTRL_ENABLE to stop the timer.
jmcneill [Sun, 9 Oct 2016 13:59:38 +0000 (13:59 +0000)]
MFC r306658: Clear GT_CTRL_ENABLE to stop the timer.

7 years agoMFC r306588:
kib [Sun, 9 Oct 2016 12:34:56 +0000 (12:34 +0000)]
MFC r306588:
Export the mq_getfd_np() and timer_oshandle_np() symbols from librt.so.

7 years agoMFC r306599:
sevan [Sat, 8 Oct 2016 21:13:55 +0000 (21:13 +0000)]
MFC r306599:
dmesg(8) first appeared in 3BSD.
http://minnie.tuhs.org/cgi-bin/utree.pl?file=3BSD/usr/man/man1/dmesg.1m

PR: 212443
Approved by: bcr (mentor)
Obtained from: TUHS
Differential Revision: https://reviews.freebsd.org/D8105

7 years agoMFC r306498:
avos [Sat, 8 Oct 2016 16:39:21 +0000 (16:39 +0000)]
MFC r306498:

ral (rt2860): eliminate duplicate ieee80211_process_callback() call
(left after r287197)

While here, add missing mergeinfo for r306320 (committed in r306549)

7 years agoMFC r306568, r306569
vangyzen [Sat, 8 Oct 2016 14:07:34 +0000 (14:07 +0000)]
MFC r306568, r306569

Add the __printflike attribute to the declarations of
dprintf(3) and vdprintf(3).

Sponsored by: Dell EMC

7 years agolmc(4): fix the build without the bpf device
vangyzen [Sat, 8 Oct 2016 13:49:40 +0000 (13:49 +0000)]
lmc(4): fix the build without the bpf device

Reported by: Dave Mischler <dave@mischler.com>
Sponsored by: Dell EMC

7 years agoMFC: r306677
allanjude [Sat, 8 Oct 2016 00:01:07 +0000 (00:01 +0000)]
MFC: r306677

GELIBoot may attempt to read past the end of the disk

PR: 213196
Relnotes: yes
Sponsored by: ScaleEngine Inc.

7 years agoMFC r306292: fix vnode lock assertion for extended attributes directory
avg [Fri, 7 Oct 2016 18:56:20 +0000 (18:56 +0000)]
MFC r306292: fix vnode lock assertion for extended attributes directory

7 years agoMFC r306291: the rest of changes intended to be committed in r306290
avg [Fri, 7 Oct 2016 18:53:17 +0000 (18:53 +0000)]
MFC r306291: the rest of changes intended to be committed in r306290

7 years agoMFC r306218,306290: amdsbwd, intpm: unify bits specific to AMD chipsets
avg [Fri, 7 Oct 2016 18:50:50 +0000 (18:50 +0000)]
MFC r306218,306290: amdsbwd, intpm: unify bits specific to AMD chipsets

7 years agoMFC r306674:
kib [Fri, 7 Oct 2016 11:47:18 +0000 (11:47 +0000)]
MFC r306674:
Style.

7 years agoMFC r306541
bapt [Fri, 7 Oct 2016 06:11:15 +0000 (06:11 +0000)]
MFC r306541

Import dma 20160929

7 years agoMFC r306508: Fix blacklistd's state restoral at startup
lidl [Fri, 7 Oct 2016 02:33:45 +0000 (02:33 +0000)]
MFC r306508: Fix blacklistd's state restoral at startup

The blacklistd daemon attempted to restore the filtering rules
before the database of blocked addresses was opened, so no rules
were being reloaded.  Now the rules are properly recreated when the
daemon is started with '-r'.

This bug was fixed locally, and then sent upstream to NetBSD.
This changeset is the import the NetBSD version of the change,
which added debugging output to alert about a null database.

Sponsored by: The FreeBSD Foundation

7 years agoMFC r306507: Update blacklistd.8 with changes from NetBSD
lidl [Fri, 7 Oct 2016 02:32:01 +0000 (02:32 +0000)]
MFC r306507: Update blacklistd.8 with changes from NetBSD

Sponsored by: The FreeBSD Foundation

7 years agoMFC r306528: Fix `sesutil fault` operation.
mav [Fri, 7 Oct 2016 01:32:29 +0000 (01:32 +0000)]
MFC r306528: Fix `sesutil fault` operation.

Fault and ident bits are located in different control bytes, so previous
code was just doing nothing, writing into reserved bit.

7 years agoMFC 302859: Include command line arguments in core dump process info.
jhb [Thu, 6 Oct 2016 21:17:18 +0000 (21:17 +0000)]
MFC 302859: Include command line arguments in core dump process info.

Fill in pr_psargs in the NT_PRSINFO ELF core dump note with command
line arguments.

7 years agoMFC r306522
davidcs [Thu, 6 Oct 2016 18:52:09 +0000 (18:52 +0000)]
MFC r306522
Upgrade Firmware/Bootloader/ResetSeq/Minidump to revision 5.4.62

7 years agoMFC 303754: Add __printflike() to bus_describe_intr() to enable -Wformat checks.
jhb [Thu, 6 Oct 2016 17:21:19 +0000 (17:21 +0000)]
MFC 303754: Add __printflike() to bus_describe_intr() to enable -Wformat checks.

Fix a few places that were passing a raw string as the format to use
a "%s" format string instead.

7 years agoMFC r306279: Use g_wither_provider() where applicable.
mav [Thu, 6 Oct 2016 15:35:36 +0000 (15:35 +0000)]
MFC r306279: Use g_wither_provider() where applicable.

It is just a helper function combining G_PF_WITHER setting with
g_orphan_provider().

7 years agoMFC r306459:
ae [Thu, 6 Oct 2016 08:11:53 +0000 (08:11 +0000)]
MFC r306459:
  Fix bug introduced in r274300.

  In icmp6_reflect() use original source address of erroneous packet as
  destination address for source selection algorithm when original
  destination address is not one of our own.

  Reported by: Mark Kamichoff <prox at prolixium com>

7 years agoMFC 305922: Fix LINT building.
jhb [Wed, 5 Oct 2016 22:26:48 +0000 (22:26 +0000)]
MFC 305922: Fix LINT building.

7 years agoMFC r306090:
kib [Wed, 5 Oct 2016 22:04:22 +0000 (22:04 +0000)]
MFC r306090:
Simple post-mortem reporter for amd64 loader.efi.

7 years agoMFC r306097:
kib [Wed, 5 Oct 2016 22:02:36 +0000 (22:02 +0000)]
MFC r306097:
Add kernel interfaces to call EFI Runtime Services.

MFC r306104:
Fix build of the module outside the kernel tree.

MFC r306209 (by imp):
Change the efi_get_table interface to a void **.

MFC r306351:
Handle TLB shootdown IPI during the EFI runtime calls, on SandyBridges.

7 years agoMFC 303226: Fix kernel builds with "device cxgbe".
jhb [Wed, 5 Oct 2016 00:49:39 +0000 (00:49 +0000)]
MFC 303226: Fix kernel builds with "device cxgbe".

7 years agoMFC r306061:
markj [Wed, 5 Oct 2016 00:33:52 +0000 (00:33 +0000)]
MFC r306061:
Protect ccbq access with devq->send_mtx in the XPT_ABORT handler.

7 years agoMFC 303859,305851: Fix a typo and some whitespace nits.
jhb [Tue, 4 Oct 2016 22:36:36 +0000 (22:36 +0000)]
MFC 303859,305851: Fix a typo and some whitespace nits.

7 years agoMFC 303454: Mark spg_len and fl_pktshift static.
jhb [Tue, 4 Oct 2016 22:34:12 +0000 (22:34 +0000)]
MFC 303454: Mark spg_len and fl_pktshift static.

These variables are no longer exported to t4_netmap.c after r296478.

7 years agoMFC 304482: Adjust t4_port_init() to work with VF devices.
jhb [Tue, 4 Oct 2016 22:32:43 +0000 (22:32 +0000)]
MFC 304482: Adjust t4_port_init() to work with VF devices.

Specifically, the FW_PORT_CMD may or may not work for a VF (the PF
driver can choose whether or not to permit access to this command),
so don't attempt to fetch port information on a VF if permission is
denied by the PF.

7 years agoMFC 305548: Don't break out of the m_advance() loop if len drops to zero.
jhb [Tue, 4 Oct 2016 22:15:42 +0000 (22:15 +0000)]
MFC 305548: Don't break out of the m_advance() loop if len drops to zero.

If a packet contains the Ethernet header (14 bytes) in the first mbuf
and the payload (IP + UDP + data) in the second mbuf, then the attempt
to fetch the l3hdr will return a NULL pointer.  The first loop iteration
will drop len to zero and exit the loop without setting 'p'.  However,
the desired data is at the start of the second mbuf, so the correct
behavior is to loop around and let the conditional set 'p' to m_data of
the next mbuf (and leave offset as 0).

7 years agoMerge r306212:
glebius [Tue, 4 Oct 2016 20:26:18 +0000 (20:26 +0000)]
Merge r306212:
  Fix regression from r297400, which truncates headers in case of low socket
  buffer and put a small optimization for low socket buffer case:

  - Do not hack uio_resid, and let m_uiotombuf() properly take care of it. This
    fixes truncation of headers at low buffer.
  - If headers ate all the space, jump right to the end of the cycle, to
    avoid doing single page I/O and allocating zero length mbuf.
  - Clear hdr_uio only if space is positive, which indicates that all uio
    was copied in.