Page MenuHomeFreeBSD

D36188.id109282.diff
No OneTemporary

D36188.id109282.diff

Index: lib/libbe/be.c
===================================================================
--- lib/libbe/be.c
+++ 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
Thu, Apr 2, 12:51 PM (6 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30723225
Default Alt Text
D36188.id109282.diff (838 B)

Event Timeline