Fix error message when zfs module is not loaded

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
This commit is contained in:
Tom Caputi 2018-12-07 13:54:38 -05:00 committed by Brian Behlendorf
parent ef57371a92
commit 4b611761bd

View File

@ -907,11 +907,11 @@ 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);
}
}
/*
* Device creation by udev is asynchronous and waiting may be