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 <behlendorf1@llnl.gov>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8977
This commit is contained in:
Tom Caputi 2019-07-02 20:30:00 -04:00 committed by Brian Behlendorf
parent df358db7c3
commit 2ba59fa9f1
1 changed files with 3 additions and 2 deletions

View File

@ -5021,14 +5021,15 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
*cp = '@'; *cp = '@';
break; break;
case EINVAL: case EINVAL:
if (flags->resumable) if (flags->resumable) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"kernel modules must be upgraded to " "kernel modules must be upgraded to "
"receive this stream.")); "receive this stream."));
if (embedded && !raw) } else if (embedded && !raw) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"incompatible embedded data stream " "incompatible embedded data stream "
"feature with encrypted receive.")); "feature with encrypted receive."));
}
(void) zfs_error(hdl, EZFS_BADSTREAM, errbuf); (void) zfs_error(hdl, EZFS_BADSTREAM, errbuf);
break; break;
case ECKSUM: case ECKSUM: