]> granicus.if.org Git - zfs/commitdiff
Fix error message when zfs module is not loaded
authorTom Caputi <tcaputi@datto.com>
Fri, 7 Dec 2018 18:54:38 +0000 (13:54 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 7 Dec 2018 18:54:38 +0000 (10:54 -0800)
This patch corrects a small issue where the wrong error message
was being displayed when the zfs kernel module was not loaded.
This also avoids waiting for the (by default) 10s timeout to see
if the /dev/zfs device appears.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8187

lib/libzfs/libzfs_util.c

index 9f4fe3b724782ed03119d07c58a425a37f276446..776d887a27761a3d1f0c2061f90d3c715539e665 100644 (file)
@@ -907,10 +907,10 @@ libzfs_load_module(const char *module)
                if (load) {
                        if (libzfs_run_process("/sbin/modprobe", argv, 0))
                                return (ENOEXEC);
-
-                       if (!libzfs_module_loaded(module))
-                               return (ENXIO);
                }
+
+               if (!libzfs_module_loaded(module))
+                       return (ENXIO);
        }
 
        /*