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 <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Philipp Riederer <philipp@riederer.email>
Closes #12766
This commit is contained in:
Philipp Riederer 2021-12-20 19:50:46 +01:00 committed by Tony Hutter
parent a1a52a356b
commit 1833de8103
1 changed files with 1 additions and 1 deletions

View File

@ -2532,7 +2532,7 @@ zfs_send_one(zfs_handle_t *zhp, const char *from, int fd, sendflags_t *flags,
"progress thread exited nonzero"))); "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. */ /* Write the final end record. */
err = send_conclusion_record(fd, NULL); err = send_conclusion_record(fd, NULL);
if (err != 0) if (err != 0)