diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index 1ffe805aab..437f83c2a8 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -3882,10 +3882,25 @@ zfs_do_redact(int argc, char **argv) switch (err) { case 0: break; - case ENOENT: - (void) fprintf(stderr, - gettext("provided snapshot %s does not exist\n"), snap); + case ENOENT: { + zfs_handle_t *zhp = zfs_open(g_zfs, snap, ZFS_TYPE_SNAPSHOT); + if (zhp == NULL) { + (void) fprintf(stderr, gettext("provided snapshot %s " + "does not exist\n"), snap); + } else { + zfs_close(zhp); + } + for (int i = 0; i < numrsnaps; i++) { + zhp = zfs_open(g_zfs, rsnaps[i], ZFS_TYPE_SNAPSHOT); + if (zhp == NULL) { + (void) fprintf(stderr, gettext("provided " + "snapshot %s does not exist\n"), rsnaps[i]); + } else { + zfs_close(zhp); + } + } break; + } case EEXIST: (void) fprintf(stderr, gettext("specified redaction bookmark " "(%s) provided already exists\n"), bookname);