diff options
author | Prawn <[email protected]> | 2021-04-27 02:23:51 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-26 17:23:51 -0700 |
commit | b0269cd8ced242e66afc4fa856d62be29bb5a4ff (patch) | |
tree | 5ff26efa41462f799863868890fa85cae7575eb0 /tests | |
parent | f172f759b913ca1d0bbee02c6edd8d92d213480d (diff) |
receive: don't fail inheriting (-x) properties on wrong dataset type
Receiving datasets while blanket inheriting properties like zfs
receive -x mountpoint can generally be desirable, e.g. to avoid
unexpected mounts on backup hosts.
Currently this will fail to receive zvols due to the mountpoint
property being applicable to filesystems only. This limitation
currently requires operators to special-case their minds and tools
for zvols.
This change gets rid of this limitation for inherit (-x) by
Spiting up the dataset type handling: Warnings for inheriting (-x),
errors for overriding (-o).
Reviewed-by: Paul Dagnelie <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: InsanePrawn <[email protected]>
Closes #11416
Closes #11840
Closes #11864
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_root/zfs_receive/receive-o-x_props_override.ksh | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/receive-o-x_props_override.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/receive-o-x_props_override.ksh index 6f897a96f..2d3c15c62 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_receive/receive-o-x_props_override.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_receive/receive-o-x_props_override.ksh @@ -259,16 +259,21 @@ log_must zfs destroy -r -f $orig log_must zfs destroy -r -f $dest # -# 3.7 Verify we can't receive a send stream overriding or excluding properties -# invalid for the dataset type unless the stream it's recursive, in which -# case only the appropriate properties are set on the destination. -# +# 3.7 Verify we can receive a send stream excluding but not overriding +# properties invalid for the dataset type, in which case only the +# appropriate properties are set on the destination. log_must zfs create -V 128K -s $orig log_must zfs snapshot $orig@snap1 log_must eval "zfs send $orig@snap1 > $streamfile_full" -log_mustnot eval "zfs receive -x atime $dest < $streamfile_full" log_mustnot eval "zfs receive -o atime=off $dest < $streamfile_full" +log_mustnot eval "zfs receive -o atime=off -x canmount $dest < $streamfile_full" +log_must eval "zfs receive -x atime -x canmount $dest < $streamfile_full" +log_must eval "check_prop_source $dest type volume -" +log_must eval "check_prop_source $dest atime - -" +log_must eval "check_prop_source $dest canmount - -" log_must_busy zfs destroy -r -f $orig +log_must_busy zfs destroy -r -f $dest +# Recursive sends also accept (and ignore) such overrides log_must zfs create $orig log_must zfs create -V 128K -s $origsub log_must zfs snapshot -r $orig@snap1 |