Page MenuHomeFreeBSD

D36188.diff
No OneTemporary

D36188.diff

diff --git a/lib/libbe/be.c b/lib/libbe/be.c
--- a/lib/libbe/be.c
+++ b/lib/libbe/be.c
@@ -29,6 +29,7 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
+#include <sys/module.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/ucred.h>
@@ -119,6 +120,16 @@
lbh = NULL;
poolname = pos = NULL;
+ /*
+ * If the zfs kmod's not loaded then the later libzfs_init() will load
+ * the module for us, but that's not desirable for a couple reasons. If
+ * the module's not loaded, there's no pool imported and we're going to
+ * fail anyways. We also don't really want libbe consumers to have that
+ * kind of side-effect (module loading) in the general case.
+ */
+ if (modfind("zfs") < 0)
+ goto err;
+
if ((lbh = calloc(1, sizeof(libbe_handle_t))) == NULL)
goto err;

File Metadata

Mime Type
text/plain
Expires
Tue, Jan 28, 5:14 AM (9 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16250996
Default Alt Text
D36188.diff (798 B)

Event Timeline