From 1833de81033e0bac0f68d1d3dc5f35454efc019a Mon Sep 17 00:00:00 2001 From: Philipp Riederer Date: Mon, 20 Dec 2021 19:50:46 +0100 Subject: 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(-) (limited to 'lib') diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 86ff8c91a..3e2eb5d91 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -2532,7 +2532,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) -- cgit v1.2.3