receive: don't fail inheriting (-x) properties on wrong dataset type
authorPrawn <Insane.Prawny@gmail.com>
Tue, 27 Apr 2021 00:23:51 +0000 (02:23 +0200)
committerGitHub <noreply@github.com>
Tue, 27 Apr 2021 00:23:51 +0000 (17:23 -0700)
commitb0269cd8ced242e66afc4fa856d62be29bb5a4ff
tree5ff26efa41462f799863868890fa85cae7575eb0
parentf172f759b913ca1d0bbee02c6edd8d92d213480d
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 <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
Closes #11416
Closes #11840
Closes #11864
lib/libzfs/libzfs_sendrecv.c
tests/zfs-tests/tests/functional/cli_root/zfs_receive/receive-o-x_props_override.ksh