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 <nathaniel.l.clark@intel.com>
Change-Id: Idad52745cdfa9d673ab9bd4afe38de4d51ae9a49
Reviewed-on: http://review.whamcloud.com/17128
Tested-by: Jenkins
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
}
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;
}
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;