]> granicus.if.org Git - zfs/commitdiff
Fix error text for EINVAL in zfs_receive_one()
authorTom Caputi <tcaputi@datto.com>
Wed, 3 Jul 2019 00:30:00 +0000 (20:30 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 3 Jul 2019 00:29:59 +0000 (17:29 -0700)
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

lib/libzfs/libzfs_sendrecv.c

index 359845f503967b70ec4cb248765fd7c66d48206e..885f263bf0d9c21b86f90e8bc1c63a8eb7b8f914 100644 (file)
@@ -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: