Whamcloud - gitweb
LU-6816 utils: remove libzfs_load_module() call 39/15539/2
authorOlaf Faaland <faaland1@llnl.gov>
Wed, 8 Jul 2015 17:14:35 +0000 (10:14 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 16 Jul 2015 15:28:00 +0000 (15:28 +0000)
Remove libzfs_load_module() call from the OSD.  The function is no
longer exported by libzfs2 in ZFS master, as it was intended as an
internal function to begin with.  libzfs_init(), which is already
being used to set up the OSD, loads the module if necessary.

The intent of the call to libzfs_load_module apparently was to make
zfs_init() fail silently if ZFS was improperly installed (e.g. the
userspace libraries were missing), but fail with an error message if
ZFS initialization failed.  However it's not clear how this could ever
work.

Handling such error conditions will be dealt with in a separate ticket
as it's a larger concern.

Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Change-Id: I97a2de7cd1a32c8251d805192aaf557f48840584
Reviewed-on: http://review.whamcloud.com/15539
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
lustre/utils/mount_utils_zfs.c

index ec53cc8..854f174 100644 (file)
@@ -615,25 +615,14 @@ int zfs_init(void)
 {
        int ret = 0;
 
-       /* If the ZFS libs are not installed, don't print an error to avoid
-        * spamming ldiskfs users. An error message will still be printed if
-        * someone tries to do some real work involving a ZFS backend */
-
-       if (libzfs_load_module("zfs") != 0) {
-               /* The ZFS modules are not installed */
-               ret = EINVAL;
-               goto out;
-       }
-
        g_zfs = libzfs_init();
        if (g_zfs == NULL) {
                fprintf(stderr, "Failed to initialize ZFS library\n");
                ret = EINVAL;
+       } else {
+               osd_zfs_setup = 1;
        }
-out:
-       osd_zfs_setup = 1;
-       if (ret)
-               zfs_fini();
+
        return ret;
 }