Skip to content

Commit

Permalink
Fix error propagation from lzc_send_redacted
Browse files Browse the repository at this point in the history
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
  • Loading branch information
toelke authored Dec 20, 2021
1 parent 3fa5266 commit 8623bd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/libzfs/libzfs_sendrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8623bd9

Please sign in to comment.