From: Tom Caputi Date: Wed, 3 Jul 2019 00:30:00 +0000 (-0400) Subject: Fix error text for EINVAL in zfs_receive_one() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ba59fa9f1d1e3bfa012721a35fc1d2a4ba4c4e7;p=zfs Fix error text for EINVAL in zfs_receive_one() This small patch fixes the EINVAL case for zfs_receive_one(). A missing 'else' has been added to the two possible cases, which will ensure the intended error message is printed. Reviewed-by: Brian Behlendorf Reviewed-by: loli10K Signed-off-by: Tom Caputi Closes #8977 --- diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 359845f50..885f263bf 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -5021,14 +5021,15 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, *cp = '@'; break; case EINVAL: - if (flags->resumable) + if (flags->resumable) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "kernel modules must be upgraded to " "receive this stream.")); - if (embedded && !raw) + } else if (embedded && !raw) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "incompatible embedded data stream " "feature with encrypted receive.")); + } (void) zfs_error(hdl, EZFS_BADSTREAM, errbuf); break; case ECKSUM: