c15d36c674
== Motivation and Context The current implementation of 'sharenfs' and 'sharesmb' relies on the use of the sharetab file. The use of this file is os-specific and not required by linux or freebsd. Currently the code must maintain updates to this file which adds complexity and presents a significant performance impact when sharing many datasets. In addition, concurrently running 'zfs sharenfs' command results in missing entries in the sharetab file leading to unexpected failures. == Description This change removes the sharetab logic from the linux and freebsd implementation of 'sharenfs' and 'sharesmb'. It still preserves an os-specific library which contains the logic required for sharing NFS or SMB. The following entry points exist in the vastly simplified libshare library: - sa_enable_share -- shares a dataset but may not commit the change - sa_disable_share -- unshares a dataset but may not commit the change - sa_is_shared -- determine if a dataset is shared - sa_commit_share -- notify NFS/SMB subsystem to commit the shares - sa_validate_shareopts -- determine if sharing options are valid The sa_commit_share entry point is provided as a performance enhancement and is not required. The sa_enable_share/sa_disable_share may commit the share as part of the implementation. Libshare provides a framework for both NFS and SMB but some operating systems may not fully support these protocols or all features of the protocol. NFS Operation: For linux, libshare updates /etc/exports.d/zfs.exports to add and remove shares and then commits the changes by invoking 'exportfs -r'. This file, is automatically read by the kernel NFS implementation which makes for better integration with the NFS systemd service. For FreeBSD, libshare updates /etc/zfs/exports to add and remove shares and then commits the changes by sending a SIGHUP to mountd. SMB Operation: For linux, libshare adds and removes files in /var/lib/samba/usershares by calling the 'net' command directly. There is no need to commit the changes. FreeBSD does not support SMB. == Performance Results To test sharing performance we created a pool with an increasing number of datasets and invoked various zfs actions that would enable and disable sharing. The performance testing was limited to NFS sharing. The following tests were performed on an 8 vCPU system with 128GB and a pool comprised of 4 50GB SSDs: Scale testing: - Share all filesystems in parallel -- zfs sharenfs=on <dataset> & - Unshare all filesystems in parallel -- zfs sharenfs=off <dataset> & Functional testing: - share each filesystem serially -- zfs share -a - unshare each filesystem serially -- zfs unshare -a - reset sharenfs property and unshare -- zfs inherit -r sharenfs <pool> For 'zfs sharenfs=on' scale testing we saw an average reduction in time of 89.43% and for 'zfs sharenfs=off' we saw an average reduction in time of 83.36%. Functional testing also shows a huge improvement: - zfs share -- 97.97% reduction in time - zfs unshare -- 96.47% reduction in time - zfs inhert -r sharenfs -- 99.01% reduction in time Reviewed-by: Matt Ahrens <matt@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Reviewed-by: Bryant G. Ly <bryangly@gmail.com> Signed-off-by: George Wilson <gwilson@delphix.com> External-Issue: DLPX-68690 Closes #1603 Closes #7692 Closes #7943 Closes #10300
179 lines
5.9 KiB
Plaintext
179 lines
5.9 KiB
Plaintext
#
|
|
# This file and its contents are supplied under the terms of the
|
|
# Common Development and Distribution License ("CDDL"), version 1.0.
|
|
# You may only use this file in accordance with the terms of version
|
|
# 1.0 of the CDDL.
|
|
#
|
|
# A full copy of the text of the CDDL should have accompanied this
|
|
# source. A copy of the CDDL is also available via the Internet at
|
|
# http://www.illumos.org/license/CDDL.
|
|
#
|
|
|
|
[DEFAULT]
|
|
pre = setup
|
|
quiet = False
|
|
pre_user = root
|
|
user = root
|
|
timeout = 600
|
|
post_user = root
|
|
post = cleanup
|
|
failsafe_user = root
|
|
failsafe = callbacks/zfs_failsafe
|
|
outputdir = /var/tmp/test_results
|
|
tags = ['functional']
|
|
|
|
[tests/functional/acl/posix:Linux]
|
|
tests = ['posix_001_pos', 'posix_002_pos', 'posix_003_pos']
|
|
tags = ['functional', 'acl', 'posix']
|
|
|
|
[tests/functional/arc:Linux]
|
|
tests = ['dbufstats_001_pos', 'dbufstats_002_pos', 'dbufstats_003_pos',
|
|
'arcstats_runtime_tuning']
|
|
tags = ['functional', 'arc']
|
|
|
|
[tests/functional/atime:Linux]
|
|
tests = ['atime_003_pos', 'root_relatime_on']
|
|
tags = ['functional', 'atime']
|
|
|
|
[tests/functional/chattr:Linux]
|
|
tests = ['chattr_001_pos', 'chattr_002_neg']
|
|
tags = ['functional', 'chattr']
|
|
|
|
[tests/functional/checksum:Linux]
|
|
tests = ['run_edonr_test']
|
|
tags = ['functional', 'checksum']
|
|
|
|
[tests/functional/cli_root/zfs:Linux]
|
|
tests = ['zfs_003_neg']
|
|
tags = ['functional', 'cli_root', 'zfs']
|
|
|
|
[tests/functional/cli_root/zfs_mount:Linux]
|
|
tests = ['zfs_mount_006_pos', 'zfs_mount_008_pos', 'zfs_multi_mount']
|
|
tags = ['functional', 'cli_root', 'zfs_mount']
|
|
|
|
[tests/functional/cli_root/zfs_share:Linux]
|
|
tests = ['zfs_share_005_pos', 'zfs_share_007_neg', 'zfs_share_009_neg']
|
|
tags = ['functional', 'cli_root', 'zfs_share']
|
|
|
|
[tests/functional/cli_root/zfs_sysfs:Linux]
|
|
tests = ['zfeature_set_unsupported', 'zfs_get_unsupported',
|
|
'zfs_set_unsupported', 'zfs_sysfs_live', 'zpool_get_unsupported',
|
|
'zpool_set_unsupported']
|
|
tags = ['functional', 'cli_root', 'zfs_sysfs']
|
|
|
|
[tests/functional/cli_root/zpool_add:Linux]
|
|
tests = ['add_nested_replacing_spare']
|
|
tags = ['functional', 'cli_root', 'zpool_add']
|
|
|
|
[tests/functional/cli_root/zpool_expand:Linux]
|
|
tests = ['zpool_expand_001_pos', 'zpool_expand_002_pos',
|
|
'zpool_expand_003_neg', 'zpool_expand_004_pos', 'zpool_expand_005_pos']
|
|
tags = ['functional', 'cli_root', 'zpool_expand']
|
|
|
|
[tests/functional/cli_root/zpool_reopen:Linux]
|
|
tests = ['zpool_reopen_001_pos', 'zpool_reopen_002_pos',
|
|
'zpool_reopen_003_pos', 'zpool_reopen_004_pos', 'zpool_reopen_005_pos',
|
|
'zpool_reopen_006_neg', 'zpool_reopen_007_pos']
|
|
tags = ['functional', 'cli_root', 'zpool_reopen']
|
|
|
|
[tests/functional/cli_root/zpool_split:Linux]
|
|
tests = ['zpool_split_wholedisk']
|
|
tags = ['functional', 'cli_root', 'zpool_split']
|
|
|
|
[tests/functional/compression:Linux]
|
|
tests = ['compress_004_pos']
|
|
tags = ['functional', 'compression']
|
|
|
|
[tests/functional/deadman:Linux]
|
|
tests = ['deadman_sync', 'deadman_zio']
|
|
pre =
|
|
post =
|
|
tags = ['functional', 'deadman']
|
|
|
|
[tests/functional/devices:Linux]
|
|
tests = ['devices_001_pos', 'devices_002_neg', 'devices_003_pos']
|
|
tags = ['functional', 'devices']
|
|
|
|
[tests/functional/events:Linux]
|
|
tests = ['events_001_pos', 'events_002_pos', 'zed_rc_filter']
|
|
tags = ['functional', 'events']
|
|
|
|
[tests/functional/fallocate:Linux]
|
|
tests = ['fallocate_prealloc', 'fallocate_punch-hole']
|
|
tags = ['functional', 'fallocate']
|
|
|
|
[tests/functional/fault:Linux]
|
|
tests = ['auto_offline_001_pos', 'auto_online_001_pos', 'auto_replace_001_pos',
|
|
'auto_spare_001_pos', 'auto_spare_002_pos', 'auto_spare_multiple',
|
|
'auto_spare_ashift', 'auto_spare_shared', 'decrypt_fault',
|
|
'decompress_fault', 'scrub_after_resilver', 'zpool_status_-s']
|
|
tags = ['functional', 'fault']
|
|
|
|
[tests/functional/features/large_dnode:Linux]
|
|
tests = ['large_dnode_002_pos', 'large_dnode_006_pos', 'large_dnode_008_pos']
|
|
tags = ['functional', 'features', 'large_dnode']
|
|
|
|
[tests/functional/io:Linux]
|
|
tests = ['libaio']
|
|
tags = ['functional', 'io']
|
|
|
|
[tests/functional/mmap:Linux]
|
|
tests = ['mmap_libaio_001_pos']
|
|
tags = ['functional', 'mmap']
|
|
|
|
[tests/functional/mmp:Linux]
|
|
tests = ['mmp_on_thread', 'mmp_on_uberblocks', 'mmp_on_off', 'mmp_interval',
|
|
'mmp_active_import', 'mmp_inactive_import', 'mmp_exported_import',
|
|
'mmp_write_uberblocks', 'mmp_reset_interval', 'multihost_history',
|
|
'mmp_on_zdb', 'mmp_write_distribution', 'mmp_hostid']
|
|
tags = ['functional', 'mmp']
|
|
|
|
[tests/functional/mount:Linux]
|
|
tests = ['umount_unlinked_drain']
|
|
tags = ['functional', 'mount']
|
|
|
|
[tests/functional/pam:Linux]
|
|
tests = ['pam_basic', 'pam_nounmount']
|
|
tags = ['functional', 'pam']
|
|
|
|
[tests/functional/procfs:Linux]
|
|
tests = ['procfs_list_basic', 'procfs_list_concurrent_readers',
|
|
'procfs_list_stale_read', 'pool_state']
|
|
tags = ['functional', 'procfs']
|
|
|
|
[tests/functional/projectquota:Linux]
|
|
tests = ['projectid_001_pos', 'projectid_002_pos', 'projectid_003_pos',
|
|
'projectquota_001_pos', 'projectquota_002_pos', 'projectquota_003_pos',
|
|
'projectquota_004_neg', 'projectquota_005_pos', 'projectquota_006_pos',
|
|
'projectquota_007_pos', 'projectquota_008_pos', 'projectquota_009_pos',
|
|
'projectspace_001_pos', 'projectspace_002_pos', 'projectspace_003_pos',
|
|
'projectspace_004_pos',
|
|
'projecttree_001_pos', 'projecttree_002_pos', 'projecttree_003_neg']
|
|
tags = ['functional', 'projectquota']
|
|
|
|
[tests/functional/rsend:Linux]
|
|
tests = ['send_realloc_dnode_size', 'send_encrypted_files']
|
|
tags = ['functional', 'rsend']
|
|
|
|
[tests/functional/snapshot:Linux]
|
|
tests = ['snapshot_015_pos', 'snapshot_016_pos']
|
|
tags = ['functional', 'snapshot']
|
|
|
|
[tests/functional/tmpfile:Linux]
|
|
tests = ['tmpfile_001_pos', 'tmpfile_002_pos', 'tmpfile_003_pos',
|
|
'tmpfile_stat_mode']
|
|
tags = ['functional', 'tmpfile']
|
|
|
|
[tests/functional/upgrade:Linux]
|
|
tests = ['upgrade_projectquota_001_pos']
|
|
tags = ['functional', 'upgrade']
|
|
|
|
[tests/functional/user_namespace:Linux]
|
|
tests = ['user_namespace_001']
|
|
tags = ['functional', 'user_namespace']
|
|
|
|
[tests/functional/userquota:Linux]
|
|
tests = ['groupspace_001_pos', 'groupspace_002_pos', 'groupspace_003_pos',
|
|
'userquota_013_pos', 'userspace_003_pos']
|
|
tags = ['functional', 'userquota']
|