Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108670998
D36188.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
798 B
Referenced Files
None
Subscribers
None
D36188.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D36188: libbe: bail out early if the zfs kmod isn't loaded
Attached
Detach File
Event Timeline
Log In to Comment