From a2ffc0e0254116294f42614e18fed36cefbbf3ba Mon Sep 17 00:00:00 2001 From: Rich Ercolani <214141+rincebrain@users.noreply.github.com> Date: Tue, 2 Nov 2021 17:45:20 -0400 Subject: [PATCH] Add more explicit warning about dedup being dropped "has unsupported feature: [number]" seems reasonable when we can't know what the problem was, but with the send -D removal, we know what it was, and can explicitly tell people "don't do that; try this if you must". So let's. Reviewed-by: Matthew Ahrens Reviewed-by: John Kennedy Signed-off-by: Rich Ercolani Closes #12708 --- lib/libzfs/libzfs_sendrecv.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index a3e3ad21c2..7460ffc413 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -5103,9 +5103,24 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, if (!DMU_STREAM_SUPPORTED(featureflags) || (hdrtype != DMU_SUBSTREAM && hdrtype != DMU_COMPOUNDSTREAM)) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "stream has unsupported feature, feature flags = %llx"), - (unsigned long long)featureflags); + /* + * Let's be explicit about this one, since rather than + * being a new feature we can't know, it's an old + * feature we dropped. + */ + if (featureflags & DMU_BACKUP_FEATURE_DEDUP) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "stream has deprecated feature: dedup, try " + "'zstream redup [send in a file] | zfs recv " + "[...]'")); + } else { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "stream has unsupported feature, feature flags = " + "%llx (unknown flags = %llx)"), + (u_longlong_t)featureflags, + (u_longlong_t)((featureflags) & + ~DMU_BACKUP_FEATURE_MASK)); + } return (zfs_error(hdl, EZFS_BADSTREAM, errbuf)); }