From 8623bd962da29716bab6bc0f0a4ef219d3151dd8 Mon Sep 17 00:00:00 2001 From: Philipp Riederer Date: Mon, 20 Dec 2021 19:50:46 +0100 Subject: [PATCH] Fix error propagation from lzc_send_redacted Any error from lzc_send_redacted is overwritten by the error of send_conclusion_record; skip writing the conclusion record if there was an earlier error. Reviewed-by: Paul Dagnelie Reviewed-by: Brian Behlendorf Signed-off-by: Philipp Riederer Closes #12766 --- lib/libzfs/libzfs_sendrecv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 098c7777ce65..9143ea11e5d4 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -2542,7 +2542,7 @@ zfs_send_one(zfs_handle_t *zhp, const char *from, int fd, sendflags_t *flags, "progress thread exited nonzero"))); } - if (flags->props || flags->holds || flags->backup) { + if (err == 0 && (flags->props || flags->holds || flags->backup)) { /* Write the final end record. */ err = send_conclusion_record(fd, NULL); if (err != 0)