mirror_zfs/tests/zfs-tests/tests/functional
Serapheim Dimitropoulos 5b72a38d68 OpenZFS 8677 - Open-Context Channel Programs
Authored by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Chris Williamson <chris.williamson@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Ported-by: Don Brady <don.brady@delphix.com>

We want to be able to run channel programs outside of synching
context. This would greatly improve performance for channel programs
that just gather information, as they won't have to wait for synching
context anymore.

=== What is implemented?

This feature introduces the following:
- A new command line flag in "zfs program" to specify our intention
  to run in open context. (The -n option)
- A new flag/option within the channel program ioctl which selects
  the context.
- Appropriate error handling whenever we try a channel program in
  open-context that contains zfs.sync* expressions.
- Documentation for the new feature in the manual pages.

=== How do we handle zfs.sync functions in open context?

When such a function is found by the interpreter and we are running
in open context we abort the script and we spit out a descriptive
runtime error. For example, given the script below ...

arg = ...
fs = arg["argv"][1]
err = zfs.sync.destroy(fs)
msg = "destroying " .. fs .. " err=" .. err
return msg

if we run it in open context, we will get back the following error:

Channel program execution failed:
[string "channel program"]:3: running functions from the zfs.sync
submodule requires passing sync=TRUE to lzc_channel_program()
(i.e. do not specify the "-n" command line argument)
stack traceback:
            [C]: in function 'destroy'
            [string "channel program"]:3: in main chunk

=== What about testing?

We've introduced new wrappers for all channel program tests that
run each channel program as both (startard & open-context) and
expect the appropriate behavior depending on the program using
the zfs.sync module.

OpenZFS-issue: https://www.illumos.org/issues/8677
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/17a49e15
Closes #6558
2018-02-08 16:05:57 -08:00
..
acl Fix shellcheck v0.4.6 warnings 2018-01-17 10:17:16 -08:00
arc Add dbuf hash and dbuf cache kstats 2018-01-29 10:24:52 -08:00
atime OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
bootfs Fix some ZFS Test Suite issues 2017-09-25 10:32:34 -07:00
cache Fix some ZFS Test Suite issues 2017-09-25 10:32:34 -07:00
cachefile Remove vn_rename and vn_remove dependency 2017-10-19 10:06:55 -07:00
casenorm Verify ZFS Test Suite scripts executability 2018-02-07 12:43:24 -08:00
channel_program OpenZFS 8677 - Open-Context Channel Programs 2018-02-08 16:05:57 -08:00
chattr Fix chattr_001_pos 2017-07-07 15:45:29 -07:00
checksum Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
clean_mirror Implemented zpool sync command 2017-05-19 12:33:11 -07:00
cli_root Verify ZFS Test Suite scripts executability 2018-02-07 12:43:24 -08:00
cli_user Add dbuf hash and dbuf cache kstats 2018-01-29 10:24:52 -08:00
compression OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
ctime Add configure option to enable gcov analysis 2017-09-15 10:24:13 -07:00
deadman Extend deadman logic 2018-01-25 13:40:38 -08:00
delegate Enable remaining tests 2017-05-22 12:34:32 -04:00
devices Enable remaining tests 2017-05-22 12:34:32 -04:00
events Verify ZFS Test Suite scripts executability 2018-02-07 12:43:24 -08:00
exec Enable remaining tests 2017-05-22 12:34:32 -04:00
fault Various ZED fixes 2017-12-08 16:58:41 -08:00
features Fix ARC behavior on 32-bit systems 2017-10-10 15:19:19 -07:00
grow_pool Fix ZTS grow_pool/setup 2017-08-15 16:40:04 -07:00
grow_replicas Enable remaining tests 2017-05-22 12:34:32 -04:00
history Disable history_004_pos 2018-01-10 10:41:30 -08:00
hkdf Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
inheritance OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
inuse Enable remaining tests 2017-05-22 12:34:32 -04:00
large_files Enable remaining tests 2017-05-22 12:34:32 -04:00
largest_pool Enable remaining tests 2017-05-22 12:34:32 -04:00
libzfs Add libtpool (thread pools) 2017-08-09 15:31:08 -07:00
link_count Enable remaining tests 2017-05-22 12:34:32 -04:00
migration OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
mmap Enable remaining tests 2017-05-22 12:34:32 -04:00
mmp Fix multihost stale cache file import 2017-12-18 10:28:27 -08:00
mount Enable remaining tests 2017-05-22 12:34:32 -04:00
mv_files OpenZFS 7629 - Fix for 7290 neglected to remove some escape sequences 2017-04-07 09:30:05 -07:00
nestedfs OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
no_space Fix size inflation in spa_get_worst_case_asize() 2017-04-10 15:28:21 -07:00
nopwrite Enable remaining tests 2017-05-22 12:34:32 -04:00
online_offline Enable remaining tests 2017-05-22 12:34:32 -04:00
pool_names Fix some ZFS Test Suite issues 2017-09-25 10:32:34 -07:00
poolversion Fix some ZFS Test Suite issues 2017-09-25 10:32:34 -07:00
privilege ZTS: replace su commands by run_user function 2017-07-05 10:46:52 -07:00
quota OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
raidz OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
redundancy Enable remaining tests 2017-05-22 12:34:32 -04:00
refquota OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
refreserv Relax (ref)reservation constraints on ZVOLs 2017-09-12 11:33:22 -07:00
rename_dirs Enable remaining tests 2017-05-22 12:34:32 -04:00
replacement OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
reservation Fix some ZFS Test Suite issues 2017-09-25 10:32:34 -07:00
rootpool OpenZFS 8076 - zfs-tests suite fails rootpool_002_neg 2017-05-25 17:29:08 -07:00
rsend Verify ZFS Test Suite scripts executability 2018-02-07 12:43:24 -08:00
scrub_mirror OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
slog OpenZFS 8909 - 8585 can cause a use-after-free kernel panic 2017-12-28 10:18:04 -08:00
snapshot Fix some ZFS Test Suite issues 2017-09-25 10:32:34 -07:00
snapused OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
sparse OpenZFS 7290 - ZFS test suite needs to control what utilities it can run 2017-04-06 09:25:36 -07:00
threadsappend Enable remaining tests 2017-05-22 12:34:32 -04:00
tmpfile Add tmpfile_003_pos to .gitignore 2017-02-03 13:42:49 -08:00
truncate Fix truncate(2) mtime and ctime handling 2017-11-13 09:24:26 -08:00
upgrade Implemented zpool sync command 2017-05-19 12:33:11 -07:00
userquota Fix 'zfs get {user|group}objused@' functionality 2017-11-29 11:59:22 -08:00
vdev_zaps Disable vdev_zaps_004_pos 2017-12-07 16:43:59 -08:00
write_dirs Skip tests that are slow on 32-bit builders 2017-06-06 19:04:01 -07:00
xattr Fix volume WR_INDIRECT log replay 2017-09-08 15:07:00 -07:00
zvol Verify ZFS Test Suite scripts executability 2018-02-07 12:43:24 -08:00
Makefile.am OpenZFS 7431 - ZFS Channel Programs 2018-02-08 15:28:18 -08:00