summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorChristian Schwarz <[email protected]>2019-11-25 20:08:20 +0100
committerBrian Behlendorf <[email protected]>2020-01-23 09:33:53 -0800
commitf658f61c722872753e8899a118e11546f136e85a (patch)
tree3f6de2564eddf58aa1617b7ecd35197575da8881 /cmd
parent7b53e2e5a9c771869e5629e9cca04f2014e7413b (diff)
cmd/zfs: redact: better error message for common usage errors
Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Matt Ahrens <[email protected]> Signed-off-by: Christian Schwarz <[email protected]> Closes #9867
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zfs/zfs_main.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index a6e75e0ba..20ecb3031 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -3746,8 +3746,13 @@ zfs_do_redact(int argc, char **argv)
"specified\n"));
break;
case EINVAL:
- (void) fprintf(stderr, gettext("redaction snapshot must be "
- "descendent of snapshot being redacted\n"));
+ if (strchr(bookname, '#') != NULL)
+ (void) fprintf(stderr, gettext(
+ "redaction bookmark name must not contain '#'\n"));
+ else
+ (void) fprintf(stderr, gettext(
+ "redaction snapshot must be descendent of "
+ "snapshot being redacted\n"));
break;
case EALREADY:
(void) fprintf(stderr, gettext("attempted to redact redacted "
@@ -3757,6 +3762,10 @@ zfs_do_redact(int argc, char **argv)
(void) fprintf(stderr, gettext("redaction bookmarks feature "
"not enabled\n"));
break;
+ case EXDEV:
+ (void) fprintf(stderr, gettext("potentially invalid redaction "
+ "snapshot; full dataset names required\n"));
+ break;
default:
(void) fprintf(stderr, gettext("internal error: %s\n"),
strerror(errno));