HardenedBSD/src 00d7ff8cddl/contrib/opensolaris/cmd/zfs zfs_main.c, cddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c

MFV r337161: 9512 zfs remap poolname at snapname coredumps

Only filesystems and volumes are valid "zfs remap" parameters: when passed
a snapshot name zfs_remap_indirects() does not handle the EINVAL returned
from libzfs_core, which results in failing an assertion and consequently
crashing.

illumos/illumos-gate at 0b2e8253986c5c761129b58cfdac46d204903de1

Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Reviewed by: John Wren Kennedy <john.kennedy at delphix.com>
Reviewed by: Sara Hartse <sara.hartse at delphix.com>
Approved by: Matt Ahrens <mahrens at delphix.com>
Author:     loli10K <ezomori.nozomu at gmail.com>
DeltaFile
+17-0cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
+14-2cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+31-22 files

HardenedBSD/src c423a5e (r337163)cddl/contrib/opensolaris/cmd/zfs zfs_main.c, cddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c

MFV r337161: 9512 zfs remap poolname at snapname coredumps

Only filesystems and volumes are valid "zfs remap" parameters: when passed
a snapshot name zfs_remap_indirects() does not handle the EINVAL returned
from libzfs_core, which results in failing an assertion and consequently
crashing.

illumos/illumos-gate at 0b2e8253986c5c761129b58cfdac46d204903de1

Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Reviewed by: John Wren Kennedy <john.kennedy at delphix.com>
Reviewed by: Sara Hartse <sara.hartse at delphix.com>
Approved by: Matt Ahrens <mahrens at delphix.com>
Author:     loli10K <ezomori.nozomu at gmail.com>
DeltaFile
+17-0cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
+14-2cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+31-22 files

HardenedBSD/src 1105449cddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c, cddl/lib/libzfs_core Makefile

Do not blindly include illumos kernel headers instead of user-space.
It is not needed now, and I doubt it much helped at all, creating more
confusions then good.
DeltaFile
+2-0cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+0-1cddl/lib/libzfs_core/Makefile
+0-1cddl/lib/libzpool/Makefile
+0-1cddl/sbin/zfs/Makefile
+0-1cddl/sbin/zpool/Makefile
+0-1cddl/usr.bin/zinject/Makefile
+2-58 files not shown
+2-1314 files

HardenedBSD/src 7fca1b9 (r337160)cddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c, cddl/lib/libzpool Makefile

Do not blindly include illumos kernel headers instead of user-space.
It is not needed now, and I doubt it much helped at all, creating more
confusions then good.
DeltaFile
+2-0cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+0-1cddl/usr.bin/ztest/Makefile
+0-1cddl/usr.bin/zstreamdump/Makefile
+0-1cddl/usr.bin/zinject/Makefile
+0-1cddl/sbin/zfs/Makefile
+0-1cddl/lib/libzpool/Makefile
+2-58 files not shown
+2-1314 files

HardenedBSD/src 232f763cddl/contrib/opensolaris/cmd/zdb zdb.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs space_map.c metaslab.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/unstable

* origin/hardened/current/master:
  MFV r336960: 9256 zfs send space estimation off by > 10% on some datasets
  MFV r336958: 9337 zfs get all is slow due to uncached metadata
  Add a regression test related to PR 131876.
  MFV r336955: 9236 nuke spa_dbgmsg
  MFV r336952: 9192 explicitly pass good_writes to vdev_uberblock/label_sync
  MFV r336950: 9290 device removal reduces redundancy of mirrors
  MFV r336948: 9112 Improve allocation performance on high-end systems
  MFV r336946: 9238 ZFS Spacemap Encoding V2
  MFV r336944: 9286 want refreservation=auto
DeltaFile
+604-210sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c
+414-160sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
+536-18sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
+203-167sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c
+146-36sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
+89-56cddl/contrib/opensolaris/cmd/zdb/zdb.c
+1,992-64736 files not shown
+2,853-95842 files

HardenedBSD/src b1c0226cddl/contrib/opensolaris/cmd/zdb zdb.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs space_map.c metaslab.c

Merge branch 'freebsd/current/master' into hardened/current/master

* freebsd/current/master:
  MFV r336960: 9256 zfs send space estimation off by > 10% on some datasets
  MFV r336958: 9337 zfs get all is slow due to uncached metadata
  Add a regression test related to PR 131876.
  MFV r336955: 9236 nuke spa_dbgmsg
  MFV r336952: 9192 explicitly pass good_writes to vdev_uberblock/label_sync
  MFV r336950: 9290 device removal reduces redundancy of mirrors
  MFV r336948: 9112 Improve allocation performance on high-end systems
  MFV r336946: 9238 ZFS Spacemap Encoding V2
  MFV r336944: 9286 want refreservation=auto
DeltaFile
+604-210sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c
+414-160sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
+536-18sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
+203-167sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c
+146-36sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
+89-56cddl/contrib/opensolaris/cmd/zdb/zdb.c
+1,992-64736 files not shown
+2,853-95842 files

HardenedBSD/src 184cebbcddl/contrib/opensolaris/cmd/zfs zfs.8, cddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c libzfs_util.c

MFV r336944: 9286 want refreservation=auto

When a ZFS volume is created with zfs create -V (but without -s), the
refreservation property is set to a value that is volsize plus the maximum
size of metadata. If refreservation is ever set to another value, it is
impossible to set it back to the automatically determined value. There are
other cases where refreservation may be wrong. These include receiving a
volume that was sent without properties and zfs clone.

We need:

zfs set refreservation=auto <volume>
zfs clone -o refreservation=auto <volume>

Each one would use the same function used by zfs create -V to determine the
proper value for refreservation.

illumos/illumos-gate at 1c10ae76c0cb31326c320e7cef1d3f24a1f47125


    [6 lines not shown]
DeltaFile
+78-2cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+33-5cddl/contrib/opensolaris/cmd/zfs/zfs.8
+30-3cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
+141-103 files

HardenedBSD/src 1960706 (r336945)cddl/contrib/opensolaris/cmd/zfs zfs.8, cddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c libzfs_util.c

MFV r336944: 9286 want refreservation=auto

When a ZFS volume is created with zfs create -V (but without -s), the
refreservation property is set to a value that is volsize plus the maximum
size of metadata. If refreservation is ever set to another value, it is
impossible to set it back to the automatically determined value. There are
other cases where refreservation may be wrong. These include receiving a
volume that was sent without properties and zfs clone.

We need:

zfs set refreservation=auto <volume>
zfs clone -o refreservation=auto <volume>

Each one would use the same function used by zfs create -V to determine the
proper value for refreservation.

illumos/illumos-gate at 1c10ae76c0cb31326c320e7cef1d3f24a1f47125


    [6 lines not shown]
DeltaFile
+78-2cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+33-5cddl/contrib/opensolaris/cmd/zfs/zfs.8
+30-3cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
+141-103 files

HardenedBSD/src f70f08acddl/contrib/opensolaris/cmd/zdb zdb.c, cddl/contrib/opensolaris/cmd/ztest ztest.c

Merge remote-tracking branch 'origin/hardened/11-stable/master' into hardened/11-stable/unstable

* origin/hardened/11-stable/master: (21 commits)
  MFC r331950: 9434 Speculative prefetch is blocked by device removal code.
  MFC r331713: MFV r331712: 9280 Assertion failure while running removal_with_ganging test with 4K devices
  MFC r331711: MFV 331710: 9188 increase size of dbuf cache to reduce indirect block decompression
  MFC r331709: MFV r331708: 9321 arc_loan_compressed_buf() can increment arc_loaned_bytes by the wrong value
  MFC r331707: MFV r331706: 9235 rename zpool_rewind_policy_t to zpool_load_policy_t
  MFC r331705: MFV 331704: 9191 dump vdev tree to zfs_dbgmsg when spa load fails due to missing log devices
  MFC r331703: MFV 331702: 9187 racing condition between vdev label and spa_last_synced_txg in vdev_validate
  MFC r331701: MFV r331695, 331700: 9166 zfs storage pool checkpoint
  MFC r331699: Partial MFV r329753: 8809 libzpool should leverage work done in libfakekernel
  MFC r331420 (by avg): zfs: fix mismatch between format specifier and type
  MFC r331414: Reduce struct aggsum_bucket padding to fit into one cache line.
  MFC r331408: MFV r331407: 9213 zfs: sytem typo
  MFC r331406: MFV r331405: 9084 spa_*_ashift must ignore spare devices
  MFC r331404: MFV r331400: 8484 Implement aggregate sum and use for arc counters
  MFC r329808: MFV r329807: 8940 Sending an intra-pool resumable send stream may result in EXDEV
  MFC r329805: MFV r329803: 9080 recursive enter of vdev_indirect_rwlock from vdev_indirect_remap()

    [5 lines not shown]
DeltaFile
+974-427sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+733-123cddl/contrib/opensolaris/cmd/zdb/zdb.c
+527-170sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
+623-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_checkpoint.c
+292-160sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
+235-136cddl/contrib/opensolaris/cmd/ztest/ztest.c
+3,384-1,01679 files not shown
+6,301-1,56685 files

HardenedBSD/src ae81d63cddl/contrib/opensolaris/cmd/zdb zdb.c, cddl/contrib/opensolaris/cmd/ztest ztest.c

Merge branch 'freebsd/11-stable/master' into hardened/11-stable/master

* freebsd/11-stable/master: (21 commits)
  MFC r331950: 9434 Speculative prefetch is blocked by device removal code.
  MFC r331713: MFV r331712: 9280 Assertion failure while running removal_with_ganging test with 4K devices
  MFC r331711: MFV 331710: 9188 increase size of dbuf cache to reduce indirect block decompression
  MFC r331709: MFV r331708: 9321 arc_loan_compressed_buf() can increment arc_loaned_bytes by the wrong value
  MFC r331707: MFV r331706: 9235 rename zpool_rewind_policy_t to zpool_load_policy_t
  MFC r331705: MFV 331704: 9191 dump vdev tree to zfs_dbgmsg when spa load fails due to missing log devices
  MFC r331703: MFV 331702: 9187 racing condition between vdev label and spa_last_synced_txg in vdev_validate
  MFC r331701: MFV r331695, 331700: 9166 zfs storage pool checkpoint
  MFC r331699: Partial MFV r329753: 8809 libzpool should leverage work done in libfakekernel
  MFC r331420 (by avg): zfs: fix mismatch between format specifier and type
  MFC r331414: Reduce struct aggsum_bucket padding to fit into one cache line.
  MFC r331408: MFV r331407: 9213 zfs: sytem typo
  MFC r331406: MFV r331405: 9084 spa_*_ashift must ignore spare devices
  MFC r331404: MFV r331400: 8484 Implement aggregate sum and use for arc counters
  MFC r329808: MFV r329807: 8940 Sending an intra-pool resumable send stream may result in EXDEV
  MFC r329805: MFV r329803: 9080 recursive enter of vdev_indirect_rwlock from vdev_indirect_remap()

    [5 lines not shown]
DeltaFile
+974-427sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+733-123cddl/contrib/opensolaris/cmd/zdb/zdb.c
+527-170sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
+623-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_checkpoint.c
+292-160sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
+235-136cddl/contrib/opensolaris/cmd/ztest/ztest.c
+3,384-1,01679 files not shown
+6,301-1,56685 files

HardenedBSD/src 61e8f81cddl/contrib/opensolaris/cmd/zdb zdb.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs vdev_removal.c spa.c

Merge remote-tracking branch 'origin/hardened/11-stable/master' into hardened/11-stable/unstable

* origin/hardened/11-stable/master:
  MFC r329771: MFV r329770: 9035 zfs: this statement may fall through
  MFC r329769: MFV r329766: 8962 zdb should work on non-idle pools
  MFC r329765: MFV r329762: 8961 SPA load/import should tell us why it failed
  MFC r329761: MFV r329760: 7638 Refactor spa_load_impl into several functions
  MFC r329759: 9018 Replace kmem_cache_reap_now() with kmem_cache_reap_soon()
  MFC r329755: MFV r329753: 8809 libzpool should leverage work done in libfakekernel
  MFC r329732: MFV r329502: 7614 zfs device evacuation/removal
  MFC r307317: MFV r307313: 5120 zfs should allow large block/gzip/raidz boot pool (loader project)
  MFC r308137, r316312, r332361
  MFC r323108, r323125, r326047-r326049
  geom_aes: Provide some deprecation notices
  MFC r322318-r322319
DeltaFile
+1,919-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c
+887-530sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+1,037-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
+640-62cddl/contrib/opensolaris/cmd/zdb/zdb.c
+513-120sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
+594-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c
+5,590-712112 files not shown
+8,716-1,152118 files

HardenedBSD/src 3566bffcddl/contrib/opensolaris/cmd/zdb zdb.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs vdev_removal.c spa.c

Merge branch 'freebsd/11-stable/master' into hardened/11-stable/master

* freebsd/11-stable/master:
  MFC r329771: MFV r329770: 9035 zfs: this statement may fall through
  MFC r329769: MFV r329766: 8962 zdb should work on non-idle pools
  MFC r329765: MFV r329762: 8961 SPA load/import should tell us why it failed
  MFC r329761: MFV r329760: 7638 Refactor spa_load_impl into several functions
  MFC r329759: 9018 Replace kmem_cache_reap_now() with kmem_cache_reap_soon()
  MFC r329755: MFV r329753: 8809 libzpool should leverage work done in libfakekernel
  MFC r329732: MFV r329502: 7614 zfs device evacuation/removal
  MFC r307317: MFV r307313: 5120 zfs should allow large block/gzip/raidz boot pool (loader project)
  MFC r308137, r316312, r332361
  MFC r323108, r323125, r326047-r326049
  geom_aes: Provide some deprecation notices
  MFC r322318-r322319
DeltaFile
+1,919-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c
+887-530sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+1,037-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
+640-62cddl/contrib/opensolaris/cmd/zdb/zdb.c
+513-120sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
+594-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c
+5,590-712112 files not shown
+8,716-1,152118 files

HardenedBSD/src f78b79ccddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs zfs_ioctl.c

MFC r329783: 8942 zfs promote .../%recv should be an error

illumos/illumos-gate at add927f8c8d101e16c23eb9cd270be4fd7edf7d5

Reported on the ZFSonLinux https://github.com/zfsonlinux/zfs/issues/4843,
fixed by https://github.com/zfsonlinux/zfs/pull/6339:

If we are in the middle of an incremental zfs receive, the child .../%recv
will exist. If you concurrently run zfs promote .../%recv, it will "work",
but then zfs gets confused. For example, there's no obvious way to destroy
the containing filesystem (because it is now a clone of its invisible child).

Attempting to do this promote should be an error. We could fix this by
having zfs_ioc_promote() check if zc_name contains a %, similar to
zfs_ioc_rename().

Reviewed by: Paul Dagnelie <pcd at delphix.com>
Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Approved by: Dan McDonald <danmcd at joyent.com>
Author: loli10K <ezomori.nozomu at gmail.com>
DeltaFile
+10-2sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
+7-0cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+17-22 files

HardenedBSD/src 13f49c3cddl/contrib/opensolaris/cmd/zdb zdb.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs vdev_removal.c vdev_indirect.c

MFC r329732: MFV r329502: 7614 zfs device evacuation/removal

illumos/illumos-gate at 5cabbc6b49070407fb9610cfe73d4c0e0dea3e77

https://www.illumos.org/issues/7614:
This project allows top-level vdevs to be removed from the storage pool with
“zpool remove”, reducing the total amount of storage in the pool. This
operation copies all allocated regions of the device to be removed onto other
devices, recording the mapping from old to new location. After the removal is
complete, read and free operations to the removed (now “indirect”) vdev must
be remapped and performed at the new location on disk. The indirect mapping
table is kept in memory whenever the pool is loaded, so there is minimal
performance overhead when doing operations on the indirect vdev.

The size of the in-memory mapping table will be reduced when its entries
become “obsolete” because they are no longer used by any block pointers in
the pool. An entry becomes obsolete when all the blocks that use it are
freed. An entry can also become obsolete when all the snapshots that
reference it are deleted, and the block pointers that reference it have been

    [21 lines not shown]
DeltaFile
+1,919-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c
+1,037-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
+632-62cddl/contrib/opensolaris/cmd/zdb/zdb.c
+513-120sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
+267-339sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+594-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c
+4,962-52180 files not shown
+7,743-85386 files

HardenedBSD/src 7605ae3cddl/contrib/opensolaris/cmd/zdb zdb_il.c zdb.c, cddl/contrib/opensolaris/cmd/zpool zpool_main.c

Merge remote-tracking branch 'origin/hardened/11-stable/master' into hardened/11-stable/unstable

* origin/hardened/11-stable/master: (23 commits)
  MFC r331333: Fix kernel memory disclosure in drm_infobufs
  MFC r331339: Correct signedness bug in drm_modeset_ctl
  Fix VERSATILEPB boot after r331402
  MFC r316370-r316371
  MFC r329694: MFV r324198: 8081 Compiler warnings in zdb
  MFC r329691: MFV r322231: 8430 dir_is_empty_readdir() doesn't properly handle error from fdopendir()
  MFC r329690: MFV r319737: 6939 add sysevents to zfs core for commands
  MFC r329683: MFV r319736: 6396 remove SVM
  MFC r329681: MFV r318941: 7446 zpool create should support efi system partition
  MFC r329668: MFV r316918: 7990 libzfs: snapspec_cb() does not need to call zfs_strdup()
  MFC r329667: MFV r316902: 7745 print error if lzc_* is called before libzfs_core_init
  MFC r329665: MFV r316901: 7730 libzfs`add_config() leaks config nvl when reading spare/l2cache devices
  MFC r329664: MFV r316893: 7604 if volblocksize property is the default, it displays as "-" rather than 8K
  MFC r329663: MFV r316876: 7542 zfs_unmount failed with EZFS_UNSHARENFSFAILED
  MFC r329661: MFV r316875: 7336 vfork and O_CLOEXEC causes zfs_mount EBUSY
  MFC r329659: MFV r316873: 7233 dir_is_empty should open directory with CLOEXEC

    [5 lines not shown]
DeltaFile
+140-30cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
+144-0sys/arm/versatile/versatile_scm.c
+75-59cddl/contrib/opensolaris/cmd/zdb/zdb_il.c
+75-55cddl/contrib/opensolaris/cmd/zdb/zdb.c
+97-31cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
+92-6cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
+623-18146 files not shown
+1,248-42952 files

HardenedBSD/src 0a7f028cddl/contrib/opensolaris/cmd/zdb zdb_il.c zdb.c, cddl/contrib/opensolaris/cmd/zpool zpool_main.c

Merge branch 'freebsd/11-stable/master' into hardened/11-stable/master

* freebsd/11-stable/master: (23 commits)
  MFC r331333: Fix kernel memory disclosure in drm_infobufs
  MFC r331339: Correct signedness bug in drm_modeset_ctl
  Fix VERSATILEPB boot after r331402
  MFC r316370-r316371
  MFC r329694: MFV r324198: 8081 Compiler warnings in zdb
  MFC r329691: MFV r322231: 8430 dir_is_empty_readdir() doesn't properly handle error from fdopendir()
  MFC r329690: MFV r319737: 6939 add sysevents to zfs core for commands
  MFC r329683: MFV r319736: 6396 remove SVM
  MFC r329681: MFV r318941: 7446 zpool create should support efi system partition
  MFC r329668: MFV r316918: 7990 libzfs: snapspec_cb() does not need to call zfs_strdup()
  MFC r329667: MFV r316902: 7745 print error if lzc_* is called before libzfs_core_init
  MFC r329665: MFV r316901: 7730 libzfs`add_config() leaks config nvl when reading spare/l2cache devices
  MFC r329664: MFV r316893: 7604 if volblocksize property is the default, it displays as "-" rather than 8K
  MFC r329663: MFV r316876: 7542 zfs_unmount failed with EZFS_UNSHARENFSFAILED
  MFC r329661: MFV r316875: 7336 vfork and O_CLOEXEC causes zfs_mount EBUSY
  MFC r329659: MFV r316873: 7233 dir_is_empty should open directory with CLOEXEC

    [5 lines not shown]
DeltaFile
+140-30cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
+144-0sys/arm/versatile/versatile_scm.c
+75-59cddl/contrib/opensolaris/cmd/zdb/zdb_il.c
+75-55cddl/contrib/opensolaris/cmd/zdb/zdb.c
+97-31cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
+92-6cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
+623-18146 files not shown
+1,248-42952 files

HardenedBSD/src 6f91b82cddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c

MFC r329664: MFV r316893:
7604 if volblocksize property is the default, it displays as "-" rather than 8K

illumos/illumos-gate at 4d86c0eab246bdfddc2dd52410ba808433bd6266
https://github.com/illumos/illumos-gate/commit/4d86c0eab246bdfddc2dd52410ba808433bd6266

https://www.illumos.org/issues/7604
  If a zvol has the default setting for the "volblocksize" property, it is
  8KB. However, it is displayed as "-" (not present), rather than "8K".
  The problem was introduced by:
  commit 25228e830e86924a41243343b1de9daf2d7dd43a
      Author: Matthew Ahrens &lt;mahrens at delphix.com&gt;
      Date:   Thu Nov 17 14:37:24 2016 -0800
  7571 non-present readonly numeric ZFS props do not have default value
  which changed changed get_numeric_property() to indicate that readonly
  default properties are not present. However, zfs_prop_readonly() returns
  TRUE for both readonly and set-once properties (e.g. volblocksize).
  Amusingly, that commit essentially reverted:
  6900484 default volblocksize is no longer being reported correctly

    [25 lines not shown]
DeltaFile
+4-1cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+4-11 files

HardenedBSD/src 291b2cbcddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c, contrib/ldns-host ldns-host.c

Merge remote-tracking branch 'origin/hardened/11-stable/master' into hardened/11-stable/unstable

* origin/hardened/11-stable/master:
  Document EN-18:01, EN-18:02, SA-18:01, SA-18:02.
  MFC r329719: MFV r329718: 8520 7198 lzc_rollback_to should support rolling back to origin
  MFC r329714: MFV r329713: 8731 ASSERT3U(nui64s, <=, UINT16_MAX) fails for large blocks
  MFC r330338: db_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common
  MFC r327206:
  MFC r302779,r302807:
  Revert MFC of r330463 r330462 r330454 r330452 r330451:
DeltaFile
+21-70sys/net80211/ieee80211_freebsd.h
+41-9contrib/ldns-host/ldns-host.c
+43-6sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
+25-16sys/net80211/ieee80211_input.c
+2-36sys/net80211/ieee80211_output.c
+23-9cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+155-14611 files not shown
+222-18717 files

HardenedBSD/src b89319fcddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c, contrib/ldns-host ldns-host.c

Merge branch 'freebsd/11-stable/master' into hardened/11-stable/master

* freebsd/11-stable/master:
  Document EN-18:01, EN-18:02, SA-18:01, SA-18:02.
  MFC r329719: MFV r329718: 8520 7198 lzc_rollback_to should support rolling back to origin
  MFC r329714: MFV r329713: 8731 ASSERT3U(nui64s, <=, UINT16_MAX) fails for large blocks
  MFC r330338: db_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common
  MFC r327206:
  MFC r302779,r302807:
  Revert MFC of r330463 r330462 r330454 r330452 r330451:
DeltaFile
+21-70sys/net80211/ieee80211_freebsd.h
+41-9contrib/ldns-host/ldns-host.c
+43-6sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
+25-16sys/net80211/ieee80211_input.c
+2-36sys/net80211/ieee80211_output.c
+23-9cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+155-14611 files not shown
+222-18717 files

HardenedBSD/src f4896cacddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs dsl_dataset.c zfs_ioctl.c

MFC r329719: MFV r329718: 8520 7198 lzc_rollback_to should support rolling back to origin
DeltaFile
+43-6sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
+23-9cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+7-4sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
+73-193 files

HardenedBSD/src d927fc4contrib/libreadline configure aclocal.m4, contrib/libreadline/examples/rlfe configure

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+0-9,811contrib/libreadline/configure
+0-5,925etc/devd/usb.conf
+0-5,400contrib/libreadline/examples/rlfe/configure
+0-4,001contrib/libreadline/aclocal.m4
+0-3,829sys/contrib/dev/acpica/common/dmtbdump.c
+2,554-1,135sys/netpfil/ipfw/ip_fw_dynamic.c
+2,554-30,1013,700 files not shown
+260,370-141,0923,706 files

HardenedBSD/src 44abeb0stand/lua cli.lua, sys/cddl/contrib/opensolaris/uts/common/fs/zfs spa.c vdev.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/unstable

* origin/hardened/current/master: (53 commits)
  The firewall_type is ignored if not set in rc.conf or rc.conf.local, after r190575 there is an option to call rc.firewall with the firewall_type passed in as an argument.
  Combine BIO_DELETE requests for nda devices
  Introduce capacity flags for periphs
  Note when we tick.
  Wrap an extra long line
  Don't sort TRIMs.
  lualoader: Clear up an empty conditional branch
  Add script for linting stand/lua to tools/boot.
  lualoader: Address some 'luacheck' concerns
  MFV r329807: 8940 Sending an intra-pool resumable send stream may result in EXDEV
  lualoader: Consistently use double quotes
  MFV r329803: 9080 recursive enter of vdev_indirect_rwlock from vdev_indirect_remap()
  lualoader: Eliminate some unused locals
  Remove accidental vim droppings
  Missed pieces of r329799.
  9079 race condition in starting and ending condesing thread for indirect vdevs

    [5 lines not shown]
DeltaFile
+1,088-478sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+395-138sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
+319-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zthr.c
+135-134sys/dev/cxgbe/tom/t4_ddp.c
+140-61sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
+118-0stand/lua/cli.lua
+2,195-81181 files not shown
+3,328-1,31287 files

HardenedBSD/src dcb05b8stand/lua cli.lua, sys/cddl/contrib/opensolaris/uts/common/fs/zfs spa.c vdev.c

Merge remote-tracking branch 'origin/freebsd/current/master' into hardened/current/master

Conflicts:
        sys/i386/linux/imgact_linux.c (deleted)
DeltaFile
+1,088-478sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+395-138sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
+319-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zthr.c
+135-134sys/dev/cxgbe/tom/t4_ddp.c
+140-61sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
+118-0stand/lua/cli.lua
+2,195-81174 files not shown
+3,183-1,25880 files

HardenedBSD/src 613b0d8 (r329783)cddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs zfs_ioctl.c

8942 zfs promote .../%recv should be an error

illumos/illumos-gate at add927f8c8d101e16c23eb9cd270be4fd7edf7d5

Reported on the ZFSonLinux https://github.com/zfsonlinux/zfs/issues/4843,
fixed by https://github.com/zfsonlinux/zfs/pull/6339:

If we are in the middle of an incremental zfs receive, the child .../%recv
will exist. If you concurrently run zfs promote .../%recv, it will "work",
but then zfs gets confused. For example, there's no obvious way to destroy
the containing filesystem (because it is now a clone of its invisible child).

Attempting to do this promote should be an error. We could fix this by
having zfs_ioc_promote() check if zc_name contains a %, similar to
zfs_ioc_rename().

Reviewed by: Paul Dagnelie <pcd at delphix.com>
Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Approved by: Dan McDonald <danmcd at joyent.com>
Author: loli10K <ezomori.nozomu at gmail.com>
DeltaFile
+10-2sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
+7-0cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+17-22 files

HardenedBSD/src 76f8fe6cddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs zfs_ioctl.c

8942 zfs promote .../%recv should be an error

illumos/illumos-gate at add927f8c8d101e16c23eb9cd270be4fd7edf7d5

Reported on the ZFSonLinux https://github.com/zfsonlinux/zfs/issues/4843,
fixed by https://github.com/zfsonlinux/zfs/pull/6339:

If we are in the middle of an incremental zfs receive, the child .../%recv
will exist. If you concurrently run zfs promote .../%recv, it will "work",
but then zfs gets confused. For example, there's no obvious way to destroy
the containing filesystem (because it is now a clone of its invisible child).

Attempting to do this promote should be an error. We could fix this by
having zfs_ioc_promote() check if zc_name contains a %, similar to
zfs_ioc_rename().

Reviewed by: Paul Dagnelie <pcd at delphix.com>
Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Approved by: Dan McDonald <danmcd at joyent.com>
Author: loli10K <ezomori.nozomu at gmail.com>
DeltaFile
+10-2sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
+7-0cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+17-22 files

HardenedBSD/src 20a2df0cddl/contrib/opensolaris/cmd/zdb zdb.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs vdev_removal.c vdev_indirect.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/unstable

* origin/hardened/current/master: (51 commits)
  lualoader: Make kernel autodetection contingent on loader.conf(5) var
  lualoader: Add boot environment support
  Add required header files.
  Remove some files that snuck in via cut and paste.
  stand/zfs: Unbreak build, 'truct' ~= 'struct'
  stand/zfs: Add all bootenvs to environment
  Honor settings for including / excluding cd9660, ufs, ext2fs and msdos.
  Consolidate three copies of ZFS commands into a central location.
  Build getty(8) with WARNS=6.
  ministat: disallow negative variance / nan Stddev
  zdb: raise WARNS from 0 to 2
  Add definition for the PowerPC A2.
  Add definitions for the new Radix MMU mode on POWER9+ CPUs.
  MFV r329718: 8520 7198 lzc_rollback_to should support rolling back to origin
  MFV r329715: 8997 ztest assertion failure in zil_lwb_write_issue
  lualoader: Use the key that interrupts autoboot as a menu choice

    [5 lines not shown]
DeltaFile
+1,919-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c
+1,037-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
+632-62cddl/contrib/opensolaris/cmd/zdb/zdb.c
+513-120sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
+267-339sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+594-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c
+4,962-521121 files not shown
+8,576-1,207127 files

HardenedBSD/src f39304acddl/contrib/opensolaris/cmd/zdb zdb.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs vdev_removal.c vdev_indirect.c

Merge branch 'freebsd/current/master' into hardened/current/master

* freebsd/current/master: (51 commits)
  lualoader: Make kernel autodetection contingent on loader.conf(5) var
  lualoader: Add boot environment support
  Add required header files.
  Remove some files that snuck in via cut and paste.
  stand/zfs: Unbreak build, 'truct' ~= 'struct'
  stand/zfs: Add all bootenvs to environment
  Honor settings for including / excluding cd9660, ufs, ext2fs and msdos.
  Consolidate three copies of ZFS commands into a central location.
  Build getty(8) with WARNS=6.
  ministat: disallow negative variance / nan Stddev
  zdb: raise WARNS from 0 to 2
  Add definition for the PowerPC A2.
  Add definitions for the new Radix MMU mode on POWER9+ CPUs.
  MFV r329718: 8520 7198 lzc_rollback_to should support rolling back to origin
  MFV r329715: 8997 ztest assertion failure in zil_lwb_write_issue
  lualoader: Use the key that interrupts autoboot as a menu choice

    [5 lines not shown]
DeltaFile
+1,919-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c
+1,037-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
+632-62cddl/contrib/opensolaris/cmd/zdb/zdb.c
+513-120sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
+267-339sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+594-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c
+4,962-521121 files not shown
+8,576-1,207127 files

HardenedBSD/src 24433f0 (r329732)cddl/contrib/opensolaris/cmd/zdb zdb.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs vdev_removal.c vdev_indirect.c

MFV r329502: 7614 zfs device evacuation/removal

illumos/illumos-gate at 5cabbc6b49070407fb9610cfe73d4c0e0dea3e77

https://www.illumos.org/issues/7614:
This project allows top-level vdevs to be removed from the storage pool with
“zpool remove”, reducing the total amount of storage in the pool. This
operation copies all allocated regions of the device to be removed onto other
devices, recording the mapping from old to new location. After the removal is
complete, read and free operations to the removed (now “indirect”) vdev must
be remapped and performed at the new location on disk. The indirect mapping
table is kept in memory whenever the pool is loaded, so there is minimal
performance overhead when doing operations on the indirect vdev.

The size of the in-memory mapping table will be reduced when its entries
become “obsolete” because they are no longer used by any block pointers in
the pool. An entry becomes obsolete when all the blocks that use it are
freed. An entry can also become obsolete when all the snapshots that
reference it are deleted, and the block pointers that reference it have been

    [21 lines not shown]
DeltaFile
+1,919-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c
+1,037-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
+632-62cddl/contrib/opensolaris/cmd/zdb/zdb.c
+513-120sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
+267-339sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+594-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c
+4,962-52180 files not shown
+7,743-85386 files

HardenedBSD/src 6da4389cddl/contrib/opensolaris/cmd/zdb zdb.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs vdev_removal.c vdev_indirect.c

MFV r329502: 7614 zfs device evacuation/removal

illumos/illumos-gate at 5cabbc6b49070407fb9610cfe73d4c0e0dea3e77

https://www.illumos.org/issues/7614:
This project allows top-level vdevs to be removed from the storage pool with
“zpool remove”, reducing the total amount of storage in the pool. This
operation copies all allocated regions of the device to be removed onto other
devices, recording the mapping from old to new location. After the removal is
complete, read and free operations to the removed (now “indirect”) vdev must
be remapped and performed at the new location on disk. The indirect mapping
table is kept in memory whenever the pool is loaded, so there is minimal
performance overhead when doing operations on the indirect vdev.

The size of the in-memory mapping table will be reduced when its entries
become “obsolete” because they are no longer used by any block pointers in
the pool. An entry becomes obsolete when all the blocks that use it are
freed. An entry can also become obsolete when all the snapshots that
reference it are deleted, and the block pointers that reference it have been

    [21 lines not shown]
DeltaFile
+1,919-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c
+1,037-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
+632-62cddl/contrib/opensolaris/cmd/zdb/zdb.c
+513-120sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
+267-339sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
+594-0sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c
+4,962-52180 files not shown
+7,743-85386 files

HardenedBSD/src cfb675a (r329719)cddl/contrib/opensolaris/lib/libzfs/common libzfs_dataset.c, sys/cddl/contrib/opensolaris/uts/common/fs/zfs dsl_dataset.c zfs_ioctl.c

MFV r329718: 8520 7198 lzc_rollback_to should support rolling back to origin

illumos/illumos-gate at 95643f75d23914a3e332adc9661ed51749e9858d
https://github.com/illumos/illumos-gate/commit/95643f75d23914a3e332adc9661ed51749e9858d

https://www.illumos.org/issues/8520
  lzc_rollback_to() should support rolling back to a clone's origin.
  The current checks in zfs_ioc_rollback() would not allow that because the
  origin snapshot belongs to a different filesystem.
  The overly restrictive check was introduced in 7600, but it was not a
  regression as none of the existing tools provided a way to rollback to the
  origin.

https://www.illumos.org/issues/7198
  EINVAL is returned when a dataset does not have any snapshots, so there is
  nothing to roll back to.
  Although the code in zfs_do_rollback checks for that condition in advance, it's
  still possible that the snapshot(s) gets removed after the check and before the
  rollback sync task is executed.

    [6 lines not shown]
DeltaFile
+43-6sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
+23-9cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+7-4sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
+73-193 files