From ba92d00cc70ccba132b3d08ff943df44dbadaf91 Mon Sep 17 00:00:00 2001 From: "Eric A. Borisch" Date: Mon, 15 Aug 2022 17:04:54 -0500 Subject: [PATCH 1/2] Don't complain about recv -x mountpoint on volumes When a recursive send is performed that contains volumes (to backup a system that has VMs run from the main zpool, for example), the destination receive run with '-x mountpoint' will complain with "Warning: backup/path/to/volume: property 'mountpoint' does not apply to datasets of this type". While this is of course true, the intent of '-x mountpoint' is still being met -- the received volume will not have its mountpoint property modified by the received stream. (The fact that it cannot be set on the volume is likely not of interest to the user running 'zfs send -R zroot@... | zfs recv -x mountpoint ...', and the noise of these warning messages distracts from any actual issues that may be reported.). As the requested behavior isn't actually being overridden here (we're still not modifying 'mountpoint' based on the stream data), and the fact that this use case (backing up a system pool) was the original impetus for -o/-x in openzfs/zfs@a3eeab2 and therefore not unlikely to be encountered, I propose silencing these particular warnings. Signed-off-by: Eric A. Borisch --- lib/libzfs/libzfs_sendrecv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 87a30f54fe..6d29d798c6 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -4218,6 +4218,12 @@ zfs_setup_cmdline_props(libzfs_handle_t *hdl, zfs_type_t type, */ if (!zfs_prop_valid_for_type(prop, type, B_FALSE) && !zfs_prop_user(name)) { + if (type == ZFS_TYPE_VOLUME && + strncmp("mountpoint", name, 10) == 0) { + // Don't complain about '-x mountpoint' + // applied to a volume. + continue; + } (void) fprintf(stderr, dgettext(TEXT_DOMAIN, "Warning: %s: property '%s' does not " "apply to datasets of this type\n"), From 95f7107d15703b79ba562e4183778aa5d8cd9c40 Mon Sep 17 00:00:00 2001 From: "Eric A. Borisch" Date: Tue, 11 Jul 2023 22:39:58 -0500 Subject: [PATCH 2/2] recv: don't complain about 'no-op' -x options. When a recursive send is performed that contains volumes (to backup a system that has VMs run from the main zpool, for example), the destination receive run with '-x mountpoint' will complain with Warning: backup/path/to/volume: property 'mountpoint' does not apply to datasets of this type. This change disables these warnings for mis-matched (could not be in send stream) options. --- lib/libzfs/libzfs_sendrecv.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 6d29d798c6..2862b427b4 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -4218,16 +4218,14 @@ zfs_setup_cmdline_props(libzfs_handle_t *hdl, zfs_type_t type, */ if (!zfs_prop_valid_for_type(prop, type, B_FALSE) && !zfs_prop_user(name)) { - if (type == ZFS_TYPE_VOLUME && - strncmp("mountpoint", name, 10) == 0) { - // Don't complain about '-x mountpoint' - // applied to a volume. - continue; - } - (void) fprintf(stderr, dgettext(TEXT_DOMAIN, - "Warning: %s: property '%s' does not " - "apply to datasets of this type\n"), - fsname, name); + /* + * These are non-user properties that are not + * supported for this particular type of + * destination. These could not have been set + * on the source, so there is no reason to + * complain about eliding them (-x) during the + * receive. + */ continue; } /*