]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix wrong assertion in libzfs diff error handling
authorRyan Moeller <ryan@freqlabs.com>
Mon, 20 May 2019 00:31:54 +0000 (17:31 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 20 May 2019 00:31:54 +0000 (17:31 -0700)
In compare(), all error cases set the error code to EPIPE, so when an
error is set, the correct assertion to make is that the error is EPIPE,
not EINVAL.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@freqlabs.com>
Closes #8743

lib/libzfs/libzfs_diff.c

index 67e85cd204688f8bcc9b0ccdbb2011a85b3c04e1..1b5c44b047e2b154aa54e4cc740ffa6a3f2444ac 100644 (file)
@@ -478,7 +478,7 @@ differ(void *arg)
        if (err)
                return ((void *)-1);
        if (di->zerr) {
-               ASSERT(di->zerr == EINVAL);
+               ASSERT(di->zerr == EPIPE);
                (void) snprintf(di->errbuf, sizeof (di->errbuf),
                    dgettext(TEXT_DOMAIN,
                    "Internal error: bad data from diff IOCTL"));