aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/cmd
Commit message (Collapse)AuthorAgeFilesLines
* fix zpool list property namesAndriy Gapon2019-11-071-7/+5
| | | | | | | | | | | | | This change is based on r354380 8899 zpool list property documentation doesn't match actual behaviour There is no "used" pool property, "alloc" is actually spelled "allocated". MFC after: 5 days Notes: svn path=/head/; revision=354437
* MFV r354377: 10554 Implemented zpool sync commandAndriy Gapon2019-11-072-0/+61
| | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@9c2acf00e275b6b2125a306f33cdddcc58393220 https://github.com/illumos/illumos-gate/commit/9c2acf00e275b6b2125a306f33cdddcc58393220 https://www.illumos.org/issues/10554 During the port of MMP (illumos bug 10499) from ZoL, I found this earlier ZoL project is a prerequisite. Here is the original description. This addition will enable us to sync an open TXG to the main pool on demand. The functionality is similar to 'sync(2)' but 'zpool sync' will return when data has hit the main storage instead of potentially just the ZIL as is the case with the 'sync(2)' cmd. Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com> Author: Alek Pinchuk <apinchuk@datto.com> MFC after: 3 weeks Relnotes: possibly Notes: svn path=/head/; revision=354436
* MFZoL: Avoid retrieving unused snapshot propsAlan Somers2019-10-262-8/+35
| | | | | | | | | | | | | | | | | | | | | This patch modifies the zfs_ioc_snapshot_list_next() ioctl to enable it to take input parameters that alter the way looping through the list of snapshots is performed. The idea here is to restrict functions that throw away some of the snapshots returned by the ioctl to a range of snapshots that these functions actually use. This improves efficiency and execution speed for some rollback and send operations. Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed by: Matt Ahrens <mahrens@delphix.com> Signed-off-by: Alek Pinchuk <apinchuk@datto.com> Closes #8077 zfsonlinux/zfs@4c0883fb4af0d5565459099b98fcf90ecbfa1ca1 MFC after: 2 weeks Notes: svn path=/head/; revision=354116
* zfs.8: fix a typo in the dateAndriy Gapon2019-10-251-1/+1
| | | | | | | | Reported by: Trond Endrestøl <trond.endrestol@ximalas.info> MFC after: 3 days Notes: svn path=/head/; revision=354062
* fix section number in zfs-program.8Andriy Gapon2019-10-161-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=353649
* MFV r348596: 9689 zfs range lock code should not be zpl-specificAndriy Gapon2019-10-161-7/+9
| | | | | | | | | | | | | | illumos/illumos-gate@7931524763ef94dc16989451dddd206563d03bb4 FreeBSD note: some tweaking was needed to avoid a conflict with sys/rangelock.h. Author: Matthew Ahrens <mahrens@delphix.com> Obtained from: illumos MFC after: 3 weeks Notes: svn path=/head/; revision=353634
* MFV r353623: 10473 zfs(1M) missing cross-reference to zfs-program(1M)Andriy Gapon2019-10-161-3/+3
| | | | | | | | | | | | | | illumos/illumos-gate@736e6700391d17ab1494985a80076fc185722699 https://github.com/illumos/illumos-gate/commit/736e6700391d17ab1494985a80076fc185722699 https://www.illumos.org/issues/10473 Author: Jason King <jason.king@joyent.com> Obtained from: illumos MFC after: 6 days Notes: svn path=/head/; revision=353624
* MFV r353615: 9485 Optimize possible split block search spaceAndriy Gapon2019-10-161-1/+10
| | | | | | | | | | | | | | | | illumos/illumos-gate@a21fe349793c3805ec504bbe5e9acf06c2d63d7a https://github.com/illumos/illumos-gate/commit/a21fe349793c3805ec504bbe5e9acf06c2d63d7a https://www.illumos.org/issues/9485 Port this commit from ZoL: https://github.com/zfsonlinux/zfs/commit/4589f3ae4c1bb435777da8640eb915f3c713b14d Author: Brian Behlendorf <behlendorf1@llnl.gov> Obtained from: illumos, ZoL MFC after: 3 weeks Notes: svn path=/head/; revision=353616
* MFC r353611: 10330 merge recent ZoL vdev and metaslab changesAndriy Gapon2019-10-161-5/+2
| | | | | | | | | | | | | | | | | | | illumos/illumos-gate@a0b03b161c4df3cfc54fbc741db09b3bdc23ffba https://github.com/illumos/illumos-gate/commit/a0b03b161c4df3cfc54fbc741db09b3bdc23ffba https://www.illumos.org/issues/10330 3 recent ZoL changes in the vdev and metaslab code which we can pull over: PR 8324 c853f382db 8324 Change target size of metaslabs from 256GB to 16GB PR 8290 b194fab0fb 8290 Factor metaslab_load_wait() in metaslab_load() PR 8286 419ba59145 8286 Update vdev_is_spacemap_addressable() for new spacemap encoding Author: Serapheim Dimitropoulos <serapheimd@gmail.com> Obtained from: illumos, ZoL MFC after: 2 weeks Notes: svn path=/head/; revision=353612
* MFV r353606: 10067 Miscellaneous man page typosAndriy Gapon2019-10-161-1/+1
| | | | | | | | | | | | https://www.illumos.org/issues/10067 fileystem - man1m/zfs.1m man1m/boot.1m Author: Peter Tribble <peter.tribble@gmail.com> Obtained from: illumos MFC after: 1 week Notes: svn path=/head/; revision=353607
* zfs: remove incorrect warning about boot support for large_dnodeAndriy Gapon2019-10-091-6/+0
| | | | | | | | | | | Fixes r353341 Reported by: tsoome MFC after: 4 days X-MFC with: r353341 Notes: svn path=/head/; revision=353342
* zfs: document large_dnode featureAndriy Gapon2019-10-091-0/+30
| | | | | | | | | | | The text is copied from illumos. The conversion to mdoc is mine. The FreeBSD boot warning is copied from large_block description. MFC after: 4 days Notes: svn path=/head/; revision=353341
* MFV r350898, r351075: 8423 8199 7432 Implement large_dnode pool featureAndriy Gapon2019-10-074-34/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8423 8199 7432 Implement large_dnode pool feature 7432 Large dnode pool feature 8199 multi-threaded dmu_object_alloc() 8423 Implement large_dnode pool feature 10406 large_dnode changes broke zfs recv of legacy stream llumos/illumos-gate@54811da5ac6b517992fdc173df5d605e4e61fdc0 https://github.com/illumos/illumos-gate/commit/54811da5ac6b517992fdc173df5d605e4e61fdc0 https://www.illumos.org/issues/8423 https://www.illumos.org/issues/8199 https://www.illumos.org/issues/7432 illumos/illumos-gate@811964cd9f1fbae0fc3b93d116269e9b1fca090a https://github.com/illumos/illumos-gate/commit/811964cd9f1fbae0fc3b93d116269e9b1fca090a https://www.illumos.org/issues/10406 ZoL issues: Improved dnode allocation #6564 Clean up large dnode code #6262 Fix dnode_hold() freeing dnode behavior #8172 Fix dnode allocation race #6414, #6439 Partial: Raw sends must be able to decrease nlevels #6821, #6864 Remove unnecessary txg syncs from receive_object() Closes #7197 This updates FreeBSD large_dnode code (that was imported from ZoL) to a version that was committed to illumos. It has some cleanups, improvements and fixes comparing to what we have in FreeBSD now. I think that the most significant update is 8199 multi-threaded dmu_object_alloc(). This commit reverts r351077 that was a revert of r351074 and r351076 and restores those changes. Required atomic operations should be available now on all platforms where we build ZFS. Obtained from: illumos MFC after: 3 weeks Notes: svn path=/head/; revision=353176
* ZFS: add bookmark renamingAndriy Gapon2019-10-032-1/+29
| | | | | | | | | | | | | | | | | | | | | The feature is implemented as an extension of the existing ZFS_IOC_RENAME ioctl. Both the userland and the DSL interfaces support renaming only a single bookmark at a time. As of now, there is no ZCP interface to the new functionality. I am going to add it once the DSL interface passes a test of time. This change picks up support for zfs_ioc_namecheck_t::ENTITY_NAME that was added to ZoL as part of Redacted Send/Receive feature by Paul Dagnelie <pcd@delphix.com>. This is needed to allow a bookmark name in zc_name. Discussed with: mahrens Reviewed by: bcr (man page) Sponsored by: CyberSecure Differential Revision: https://reviews.freebsd.org/D21795 Notes: svn path=/head/; revision=353037
* update zfs send usage help with r352447Andriy Gapon2019-09-191-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=352507
* MFZoL: Add -vnP support to 'zfs send' for bookmarksAndriy Gapon2019-09-172-17/+27
| | | | | | | | | | | | | | zfsonlinux/zfs@835db58592d7d947e5818eb7281882e2a46073e0 We have long supported estimating a size of an incremental stream from a snapshot. We should do the same for bookmarks as well. Obtained from: ZoL Author: loli10K <ezomori.nozomu@gmail.com> MFC after: 3 days Notes: svn path=/head/; revision=352447
* Fix dtrace test case after r351423 due to ping6(8) options changedLi-Wen Hsu2019-08-311-1/+1
| | | | | | | | | | Failure test case: cddl.usr.sbin.dtrace.common.ip.t_dtrace_contrib.tst_ipv6localicmp_ksh Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351644
* Fix tests use /etc/motd after r350184 by using an always existing fileLi-Wen Hsu2019-08-313-3/+3
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351643
* Add hold events for lockmgr probes, missed in r351361.Mark Johnston2019-08-211-2/+6
| | | | | | | MFC with: r351361 Notes: svn path=/head/; revision=351363
* Add lockmgr(9) probes to the lockstat DTrace provider.Mark Johnston2019-08-211-10/+14
| | | | | | | | | | | | | | | | | They follow the conventions set by rw and sx lock probes. There is an additional lockstat:::lockmgr-disown probe. Update lockstat(1) to report on contention and hold events for lockmgr locks. Document the new probes in dtrace_lockstat.4, and deduplicate some of the existing probe descriptions. Reviewed by: mjg MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21355 Notes: svn path=/head/; revision=351361
* Fix inverted predicates for sx lock hold events in lockstat(1).Mark Johnston2019-08-211-2/+2
| | | | | | | | | | | | This caused shared sx holds to be reported as exclusive, and vice versa. Reviewed by: mjg MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351359
* zpool-features.7: Fix a typoMateusz Piotrowski2019-08-161-2/+2
| | | | | | | | | | Reported by: pstef Reviewed by: pstef Approved by: src (pstef) Differential Revision: https://reviews.freebsd.org/D21290 Notes: svn path=/head/; revision=351115
* Revert r351076 and r351074 because of atomic_swap_64 on 32-bit platformsAndriy Gapon2019-08-154-93/+34
| | | | | | | Trying to sort it out. Notes: svn path=/head/; revision=351077
* MFV r350898: 8423 8199 7432 Implement large_dnode pool featureAndriy Gapon2019-08-154-34/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8423 8199 7432 Implement large_dnode pool feature 8423 Implement large_dnode pool feature 8199 multi-threaded dmu_object_alloc() 7432 Large dnode pool feature llumos/illumos-gate@54811da5ac6b517992fdc173df5d605e4e61fdc0 https://github.com/illumos/illumos-gate/commit/54811da5ac6b517992fdc173df5d605e4e61fdc0 https://www.illumos.org/issues/8423 https://www.illumos.org/issues/8199 https://www.illumos.org/issues/7432 ZoL issues: Improved dnode allocation #6564 Clean up large dnode code #6262 Fix dnode_hold() freeing dnode behavior #8172 Fix dnode allocation race #6414, #6439 Partial: Raw sends must be able to decrease nlevels #6821, #6864 Remove unnecessary txg syncs from receive_object() Closes #7197 This updates FreeBSD large_dnode code (that was imported from ZoL) to a version that was committed to illumos. It has some cleanups, improvements and fixes comparing to what we have in FreeBSD now. I think that the most significant update is 8199 multi-threaded dmu_object_alloc(). Obtained from: illumos MFC after: 3 weeks Notes: svn path=/head/; revision=351074
* MFV r350896: 6585 sha512, skein, and edonr have an unenforced dependency on ↵Andriy Gapon2019-08-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | extensible dataset illumos/illumos-gate@892586e8a147c02d7f4053cc405229a13e796928 https://github.com/illumos/illumos-gate/commit/892586e8a147c02d7f4053cc405229a13e796928 https://www.illumos.org/issues/6585 In any pool without the extensible dataset feature flag already enabled, creating a dataset with dedup set to use one of the new checksums would result in the following panic as soon as any data was added: panic[cpu0]/thread=ffffff0006761c40: feature_get_refcount(spa, feature, &refcount) != 48 (0x30 != 0x30), file: ../../common/fs/zfs/zfeature.c line 390 ffffff0006761830 fffffffffba8fbdd () ffffff0006761890 zfs:feature_do_action+11a () ffffff00067618c0 zfs:spa_feature_incr+1e () ffffff0006761920 zfs:dmu_object_zapify+b7 () ffffff00067619b0 zfs:dsl_dataset_activate_feature+97 () ffffff0006761a20 zfs:dsl_dataset_sync+ba () ffffff0006761ab0 zfs:dsl_pool_sync+153 () ffffff0006761b70 zfs:spa_sync+26e () ffffff0006761c20 zfs:txg_sync_thread+227 () ffffff0006761c30 unix:thread_start+8 () Inspection showed that feature->fi_feature was 7, which is the value of SPA_FEATURE_EXTENSIBLE_DATASET in the spa_feature enum. Testing shows that the panic can be prevented by explicitly setting extensible dataset as a dependency for the sha512, edonr, and skein feature flags. Alternatively, the new checksums code could possibly be changed to obviate the need for the dependency. Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Richard Laager <rlaager@wiktel.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: ilovezfs <ilovezfs@icloud.com> Note that FreeBSD does not support ednor yet. MFC after: 2 weeks Notes: svn path=/head/; revision=350897
* Allow ZVOL bookmarks to be listed recursivelyAndriy Gapon2019-08-121-3/+3
| | | | | | | | | | | | | | | | | | | Many thanks to cryx-freebsd@h3q.com for reporting the problem and submitting a fix. I have chosen to take an equivalent but textually different patch from ZoL just to avoid increasing divergence between OpenZFS flavours. ZoL commit: zfsonlinux/zfse33da554c5daf0103b093f44ab5b90ad6c064c3f Author: loli10K <ezomori.nozomu@gmail.com> Date: Wed Sep 7 19:34:20 2016 +0200 PR: 197821 Submitted by: cryx-freebsd@h3q.com (alternative version) Reported by: cryx-freebsd@h3q.com Obtained from: ZoL MFC after: 1 week Notes: svn path=/head/; revision=350893
* add forgotten opening bracket "("Wolfram Schneider2019-07-311-1/+3
| | | | | | | | | | PR: 237514 Reviewed by: allanjude MFC after: soon for 11.3 and 12 series Differential Revision: https://reviews.freebsd.org/D21009 Notes: svn path=/head/; revision=350486
* zpool.8: the comment property is not read-onlyAllan Jude2019-06-061-4/+0
| | | | | | | | | | | | | The comment property was listed in the man page twice, once under the list of read-only properties, and again (correctly), under the list of user editable properties. PR: 238355 Reported by: Michael Zuo <muh.muhten@gmail.com> Sponsored by: Klara Systems Notes: svn path=/head/; revision=348714
* DTrace: create an amd64 test suitMariusz Zaborski2019-06-053-0/+161
| | | | | | | | | | | | | Create two tests checking if we can read urgs registers and if the rax register returns a correct number. Reviewed by: markj Discussed with: lwhsu MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20364 Notes: svn path=/head/; revision=348706
* MFV r348583: 9847 leaking dd_clones (DMU_OT_DSL_CLONES) objectsAlexander Motin2019-06-031-3/+234
| | | | | | | | | | | | | illumos/illumos-gate@17fb938fd6cdce3ff1bb47dafda0774f742249a3 Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com> Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov> Approved by: Richard Lowe <richlowe@richlowe.net> Author: Matthew Ahrens <mahrens@delphix.com> Notes: svn path=/head/; revision=348584
* MFV r348578: 9962 zil_commit should omit cache thrashAlexander Motin2019-06-031-3/+1
| | | | | | | | | | | | | | illumos/illumos-gate@cab3a55e158118937e07d059c46f1bc14d1f254d Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: Brad Lewis <brad.lewis@delphix.com> Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Approved by: Joshua M. Clulow <josh@sysmgr.org> Author: Prakash Surya <prakash.surya@delphix.com> Notes: svn path=/head/; revision=348579
* MFV r348568: 9466 add JSON output support to channel programsAlexander Motin2019-06-033-10/+30
| | | | | | | | | | | | | | illumos/illumos-gate@5267591016146502784860802129b16dab6f135c Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com> Reviewed by: Sara Hartse <sara.hartse@delphix.com> Reviewed by: John Kennedy <john.kennedy@delphix.com> Approved by: Dan McDonald <danmcd@joyent.com> Author: Alek Pinchuk <apinchuk@datto.com> Notes: svn path=/head/; revision=348570
* MFV r348553: 9681 ztest failure in spa_history_log_internal due to spa_rename()Alexander Motin2019-06-031-74/+0
| | | | | | | | | | | | illumos/illumos-gate@6aee0ad76969eb0027131b3a338f2d94ae86f728 Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Matthew Ahrens <mahrens@delphix.com> Notes: svn path=/head/; revision=348565
* MFV r348552: 9682 page fault in dsl_async_clone_destroy() while opening poolAlexander Motin2019-06-031-2/+3
| | | | | | | | | | | | | illumos/illumos-gate@ade2c82828f0dca1f46919aa1bd936ea1a5a0047 Reviewed by: Brad Lewis <brad.lewis@delphix.com> Reviewed by: Matt Ahrens <matt@delphix.com> Reviewed by: Sara Hartse <sara.hartse@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Serapheim Dimitropoulos <serapheim@delphix.com> Notes: svn path=/head/; revision=348564
* MFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the firstAllan Jude2019-05-181-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | zfsonlinux/zfs@88cfff182432e4d1c24c877f33b47ee6cf109eee zfs_main: fix `zfs userspace` squashing unresolved entries The `zfs userspace` squashes all entries with unresolved numeric values into a single output entry due to the comparsion always made by the string name which is empty in case of unresolved IDs. Fix this by falling to a numerical comparison when either one of string values is not found. This then compares any numerical values after all with a name resolved. Signed-off-by: Pavel Boldin <boldin.pavel@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Reported by: clusteradm Obtained from: ZFS-on-Linux MFC after: 3 days Notes: svn path=/head/; revision=347953
* Fix dataset name comparison in zfs_compare().Alexander Motin2019-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The code never returned match comparing two datasets (not snapshots). As result, uu_avl_find(), called from zfs_callback(), never succeeded, allowing to add same dataset into the list multiple times, for example: # zfs get name pers pers pers@z pers@z NAME PROPERTY VALUE SOURCE pers name pers - pers name pers - pers@z name pers@z - With the patch: # zfs get name pers pers pers@z pers@z NAME PROPERTY VALUE SOURCE pers name pers - pers@z name pers@z - MFC after: 1 week Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=347240
* Add a trailing empty line to match the test code outputLi-Wen Hsu2019-04-291-0/+1
| | | | | | | | | | | This is added for letting these long failing test case pass, and for consistency. The test code should be fixed later to not output this extra empty line. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=346873
* Some test scripts use ncat --sctp --listen port to run an SCTP discardMichael Tuexen2019-04-282-36/+68
| | | | | | | | | | | | | | | | | | | server in the background. However, when running in the background, stdin is closed and ncat initiates a graceful shutdown of the SCTP association. This is not expected by the client. Therefore, the ncat-based discard server is replaced by a perl-based one. In addition, to remove the dependency from ncat, which needs to be installed via the nmap port, also the code testing for a free SCTP port is changed to use the perl-based client. Finally, remove some debug output from the report generated. Reviewed by: lwhsu@ Differential Revision: https://reviews.freebsd.org/D20086 Notes: svn path=/head/; revision=346854
* Ensure that we use a 64-bit value for the last mmap() argument.Mark Johnston2019-03-201-1/+2
| | | | | | | | | | | | When using __syscall(2), the offset argument is passed on the stack on amd64. Previously only 32 bits were written, so the upper 32 bits were garbage and could cause the test to fail. MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=345355
* Fix a regression introduced in r344569Baptiste Daroussin2019-02-271-3/+0
| | | | | | | | | | | | | | | Import a fix from illumos (thanks Toomas Soomas for pointing at it) See https://www.illumos.org/issues/10205 for more details Illumos commit: https://github.com/illumos/illumos-gate/commit/247b7da039fd88350c50e3d7fef15bdab6bef215 Submitted by: jack@gandi.net Reported by: cy Reviewed by: tsoome, cy, bapt Obtained from: Illumos Notes: svn path=/head/; revision=344621
* Set process title during zfs send.Sean Eric Fagan2019-02-262-5/+11
| | | | | | | | | | | | | | | | This adds a '-V' option to 'zfs send', which sets the process title once a second to the progress information. This code has been in FreeNAS for a long time now; this is just upstreaming it here. It was originially written by delphij. Reviewed by: mav Obtained from: iXsystems, Inc Sponsored by: iXsystems, Inc Differential Revision: https://reviews.freebsd.org/D19184 Notes: svn path=/head/; revision=344601
* Implement parallel mounting for ZFS filesystemBaptiste Daroussin2019-02-261-38/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | It was first implemented on Illumos and then ported to ZoL. This patch is a port to FreeBSD of the ZoL version. This patch also includes a fix for a race condition that was amended With such patch Delphix has seen a huge decrease in latency of the mount phase (https://github.com/openzfs/openzfs/commit/a3f0e2b569 for details). With that current change Gandi has measured improvments that are on par with those reported by Delphix. Zol commits incorporated: https://github.com/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825c70c9c9e303 https://github.com/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d4077567dfea21 Reviewed by: avg, sef Approved by: avg, sef Obtained from: ZoL MFC after: 1 month Relnotes: yes Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D19098 Notes: svn path=/head/; revision=344569
* zpool.8: sort zpool status flags in the same order as in illumos manualAndriy Gapon2019-02-201-8/+8
| | | | | | | | | Just in case, while I was here. MFC after: 1 week Notes: svn path=/head/; revision=344361
* zpool.8: document -D flag for zpool statusAndriy Gapon2019-02-201-3/+9
| | | | | | | | | | The description is taken from the illumos manual. Reported by: stilezy@gmail.com MFC after: 1 week Notes: svn path=/head/; revision=344360
* MFV r342532: 5882 Temporary pool namesAndriy Gapon2018-12-261-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that this commit brings only formatting changes that were done during the final review of the illumos change, because FreeBSD got the main changes before illumos. illumos/illumos-gate@04e56356520b98d5a93c496b10f02530bb6647e0 https://github.com/illumos/illumos-gate/commit/04e56356520b98d5a93c496b10f02530bb6647e0 https://www.illumos.org/issues/5882 This is an import of the temporary pool names functionality from ZoL: https://github.com/zfsonlinux/zfs/commit/e2282ef57edc79cdce2a4b9b7e3333c56494a807 https://github.com/zfsonlinux/zfs/commit/26b42f3f9d03f85cc7966dc2fe4dfe9216601b0e https://github.com/zfsonlinux/zfs/commit/2f3ec9006146844af6763d1fa4e823fd9047fd54 https://github.com/zfsonlinux/zfs/commit/00d2a8c92f614f49d23dea5d73f7ea7eb489ccf1 https://github.com/zfsonlinux/zfs/commit/83e9986f6eefdf0afc387f06407087bba3ead4e9 https://github.com/zfsonlinux/zfs/commit/023bbe6f017380f4a04c5060feb24dd8cdda9fce It is intended to assist the creation and management of virtual machines that have their rootfs on ZFS on hosts that also have their rootfs on ZFS. These situations cause SPA namespace collisions when the standard name rpool is used in both cases. The solution is either to give each guest pool a name unique to the host, which is not always desireable, or boot a VM environment containing an ISO image to install it, which is cumbersome. MFC after: 1 week Sponsored by: Panzura Notes: svn path=/head/; revision=342541
* dtrace(1): remove reference to dtruss that was removed from baseYuri Pankov2018-10-311-2/+1
| | | | | | | | | | | | system in r300226. PR: 211618 Reviewed by: gnn, markj, 0mp Approved by: kib (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D17762 Notes: svn path=/head/; revision=339956
* Add support for send, receive and state-change DTrace providers forMichael Tuexen2018-08-229-7/+623
| | | | | | | | | | | | SCTP. They are based on what is specified in the Solaris DTrace manual for Solaris 11.4. Reviewed by: 0mp, dteske, markj Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16839 Notes: svn path=/head/; revision=338213
* Add partial documentation for dtrace(1)'s -x configuration options.Mark Johnston2018-08-161-2/+111
| | | | | | | | | | | | | Some options are still missing descriptions, but they can be filled in over time. Submitted by: raichoo <raichoo@googlemail.com> Reviewed by: 0mp (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16671 Notes: svn path=/head/; revision=337926
* MFV/ZoL: Implement large_dnode pool featureMatt Macy2018-08-123-47/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 50c957f702ea6d08a634e42f73e8a49931dd8055 Author: Ned Bass <bass6@llnl.gov> Date: Wed Mar 16 18:25:34 2016 -0700 Implement large_dnode pool feature Justification ------------- This feature adds support for variable length dnodes. Our motivation is to eliminate the overhead associated with using spill blocks. Spill blocks are used to store system attribute data (i.e. file metadata) that does not fit in the dnode's bonus buffer. By allowing a larger bonus buffer area the use of a spill block can be avoided. Spill blocks potentially incur an additional read I/O for every dnode in a dnode block. As a worst case example, reading 32 dnodes from a 16k dnode block and all of the spill blocks could issue 33 separate reads. Now suppose those dnodes have size 1024 and therefore don't need spill blocks. Then the worst case number of blocks read is reduced to from 33 to two--one per dnode block. In practice spill blocks may tend to be co-located on disk with the dnode blocks so the reduction in I/O would not be this drastic. In a badly fragmented pool, however, the improvement could be significant. ZFS-on-Linux systems that make heavy use of extended attributes would benefit from this feature. In particular, ZFS-on-Linux supports the xattr=sa dataset property which allows file extended attribute data to be stored in the dnode bonus buffer as an alternative to the traditional directory-based format. Workloads such as SELinux and the Lustre distributed filesystem often store enough xattr data to force spill bocks when xattr=sa is in effect. Large dnodes may therefore provide a performance benefit to such systems. Other use cases that may benefit from this feature include files with large ACLs and symbolic links with long target names. Furthermore, this feature may be desirable on other platforms in case future applications or features are developed that could make use of a larger bonus buffer area. Implementation -------------- The size of a dnode may be a multiple of 512 bytes up to the size of a dnode block (currently 16384 bytes). A dn_extra_slots field was added to the current on-disk dnode_phys_t structure to describe the size of the physical dnode on disk. The 8 bits for this field were taken from the zero filled dn_pad2 field. The field represents how many "extra" dnode_phys_t slots a dnode consumes in its dnode block. This convention results in a value of 0 for 512 byte dnodes which preserves on-disk format compatibility with older software. Similarly, the in-memory dnode_t structure has a new dn_num_slots field to represent the total number of dnode_phys_t slots consumed on disk. Thus dn->dn_num_slots is 1 greater than the corresponding dnp->dn_extra_slots. This difference in convention was adopted because, unlike on-disk structures, backward compatibility is not a concern for in-memory objects, so we used a more natural way to represent size for a dnode_t. The default size for newly created dnodes is determined by the value of a new "dnodesize" dataset property. By default the property is set to "legacy" which is compatible with older software. Setting the property to "auto" will allow the filesystem to choose the most suitable dnode size. Currently this just sets the default dnode size to 1k, but future code improvements could dynamically choose a size based on observed workload patterns. Dnodes of varying sizes can coexist within the same dataset and even within the same dnode block. For example, to enable automatically-sized dnodes, run # zfs set dnodesize=auto tank/fish The user can also specify literal values for the dnodesize property. These are currently limited to powers of two from 1k to 16k. The power-of-2 limitation is only for simplicity of the user interface. Internally the implementation can handle any multiple of 512 up to 16k, and consumers of the DMU API can specify any legal dnode value. The size of a new dnode is determined at object allocation time and stored as a new field in the znode in-memory structure. New DMU interfaces are added to allow the consumer to specify the dnode size that a newly allocated object should use. Existing interfaces are unchanged to avoid having to update every call site and to preserve compatibility with external consumers such as Lustre. The new interfaces names are given below. The versions of these functions that don't take a dnodesize parameter now just call the _dnsize() versions with a dnodesize of 0, which means use the legacy dnode size. New DMU interfaces: dmu_object_alloc_dnsize() dmu_object_claim_dnsize() dmu_object_reclaim_dnsize() New ZAP interfaces: zap_create_dnsize() zap_create_norm_dnsize() zap_create_flags_dnsize() zap_create_claim_norm_dnsize() zap_create_link_dnsize() The constant DN_MAX_BONUSLEN is renamed to DN_OLD_MAX_BONUSLEN. The spa_maxdnodesize() function should be used to determine the maximum bonus length for a pool. These are a few noteworthy changes to key functions: * The prototype for dnode_hold_impl() now takes a "slots" parameter. When the DNODE_MUST_BE_FREE flag is set, this parameter is used to ensure the hole at the specified object offset is large enough to hold the dnode being created. The slots parameter is also used to ensure a dnode does not span multiple dnode blocks. In both of these cases, if a failure occurs, ENOSPC is returned. Keep in mind, these failure cases are only possible when using DNODE_MUST_BE_FREE. If the DNODE_MUST_BE_ALLOCATED flag is set, "slots" must be 0. dnode_hold_impl() will check if the requested dnode is already consumed as an extra dnode slot by an large dnode, in which case it returns ENOENT. * The function dmu_object_alloc() advances to the next dnode block if dnode_hold_impl() returns an error for a requested object. This is because the beginning of the next dnode block is the only location it can safely assume to either be a hole or a valid starting point for a dnode. * dnode_next_offset_level() and other functions that iterate through dnode blocks may no longer use a simple array indexing scheme. These now use the current dnode's dn_num_slots field to advance to the next dnode in the block. This is to ensure we properly skip the current dnode's bonus area and don't interpret it as a valid dnode. zdb --- The zdb command was updated to display a dnode's size under the "dnsize" column when the object is dumped. For ZIL create log records, zdb will now display the slot count for the object. ztest ----- Ztest chooses a random dnodesize for every newly created object. The random distribution is more heavily weighted toward small dnodes to better simulate real-world datasets. Unused bonus buffer space is filled with non-zero values computed from the object number, dataset id, offset, and generation number. This helps ensure that the dnode traversal code properly skips the interior regions of large dnodes, and that these interior regions are not overwritten by data belonging to other dnodes. A new test visits each object in a dataset. It verifies that the actual dnode size matches what was stored in the ztest block tag when it was created. It also verifies that the unused bonus buffer space is filled with the expected data patterns. ZFS Test Suite -------------- Added six new large dnode-specific tests, and integrated the dnodesize property into existing tests for zfs allow and send/recv. Send/Receive ------------ ZFS send streams for datasets containing large dnodes cannot be received on pools that don't support the large_dnode feature. A send stream with large dnodes sets a DMU_BACKUP_FEATURE_LARGE_DNODE flag which will be unrecognized by an incompatible receiving pool so that the zfs receive will fail gracefully. While not implemented here, it may be possible to generate a backward-compatible send stream from a dataset containing large dnodes. The implementation may be tricky, however, because the send object record for a large dnode would need to be resized to a 512 byte dnode, possibly kicking in a spill block in the process. This means we would need to construct a new SA layout and possibly register it in the SA layout object. The SA layout is normally just sent as an ordinary object record. But if we are constructing new layouts while generating the send stream we'd have to build the SA layout object dynamically and send it at the end of the stream. For sending and receiving between pools that do support large dnodes, the drr_object send record type is extended with a new field to store the dnode slot count. This field was repurposed from unused padding in the structure. ZIL Replay ---------- The dnode slot count is stored in the uppermost 8 bits of the lr_foid field. The bits were unused as the object id is currently capped at 48 bits. Resizing Dnodes --------------- It should be possible to resize a dnode when it is dirtied if the current dnodesize dataset property differs from the dnode's size, but this functionality is not currently implemented. Clearly a dnode can only grow if there are sufficient contiguous unused slots in the dnode block, but it should always be possible to shrink a dnode. Growing dnodes may be useful to reduce fragmentation in a pool with many spill blocks in use. Shrinking dnodes may be useful to allow sending a dataset to a pool that doesn't support the large_dnode feature. Feature Reference Counting -------------------------- The reference count for the large_dnode pool feature tracks the number of datasets that have ever contained a dnode of size larger than 512 bytes. The first time a large dnode is created in a dataset the dataset is converted to an extensible dataset. This is a one-way operation and the only way to decrement the feature count is to destroy the dataset, even if the dataset no longer contains any large dnodes. The complexity of reference counting on a per-dnode basis was too high, so we chose to track it on a per-dataset basis similarly to the large_block feature. Signed-off-by: Ned Bass <bass6@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #3542 Notes: svn path=/head/; revision=337669
* Extend the info about the limitations of datasets in jails.Alexander Leidinger2018-08-111-3/+6
| | | | | | | | Reviewed by: allanjude Sponsored by: Essen Hackathon Notes: svn path=/head/; revision=337658