From 95db503e4fde9b5e1b66a2f928c8f3e52d5d5f73 Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Fri, 6 Nov 2015 13:48:34 -0500 Subject: [PATCH] LU-7377 utils: Don't fail on plugin load for mount/tunefs While loading mount_utils_zfs, if zfs modules aren't loaded, but zfs plugin is present, it will return an error, this shouldn't cause all module loading to fail. Signed-off-by: Nathaniel Clark Change-Id: Idad52745cdfa9d673ab9bd4afe38de4d51ae9a49 Reviewed-on: http://review.whamcloud.com/17128 Tested-by: Jenkins Reviewed-by: Alex Zhuravlev Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/utils/mount_utils.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lustre/utils/mount_utils.c b/lustre/utils/mount_utils.c index 2ec3489..b19aeef 100644 --- a/lustre/utils/mount_utils.c +++ b/lustre/utils/mount_utils.c @@ -573,7 +573,7 @@ int backfs_mount_type_okay(enum ldd_mount_type mount_type) } if (backfs_ops[mount_type] == NULL) { fatal(); - fprintf(stderr, "unhandled fs type %d '%s'\n", + fprintf(stderr, "unhandled/unloaded fs type %d '%s'\n", mount_type, mt_str(mount_type)); return 0; } @@ -706,14 +706,19 @@ int osd_enable_quota(struct mkfs_opts *mop) int osd_init(void) { - int i, ret = 0; + int i, rc, ret = EINVAL; for (i = 0; i < LDD_MT_LAST; ++i) { + rc = 0; backfs_ops[i] = load_backfs_module(i); if (backfs_ops[i] != NULL) - ret = backfs_ops[i]->init(); - if (ret) - break; + rc = backfs_ops[i]->init(); + if (rc != 0) { + backfs_ops[i]->fini(); + unload_backfs_module(backfs_ops[i]); + backfs_ops[i] = NULL; + } else + ret = 0; } return ret; -- 1.8.3.1