From: Olaf Faaland Date: Wed, 8 Jul 2015 17:14:35 +0000 (-0700) Subject: LU-6816 utils: remove libzfs_load_module() call X-Git-Tag: 2.7.57~38 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=4b70236ecb9f51c49795d7c15819c9184cdc16e6 LU-6816 utils: remove libzfs_load_module() call 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 Change-Id: I97a2de7cd1a32c8251d805192aaf557f48840584 Reviewed-on: http://review.whamcloud.com/15539 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Andreas Dilger Reviewed-by: Nathaniel Clark Reviewed-by: Jinshan Xiong --- diff --git a/lustre/utils/mount_utils_zfs.c b/lustre/utils/mount_utils_zfs.c index ec53cc8..854f174 100644 --- a/lustre/utils/mount_utils_zfs.c +++ b/lustre/utils/mount_utils_zfs.c @@ -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; }