Properly detect if the filters were refreshed properly.
(May needs few more fixes ??)
Filter refresh may fail because it may be out of free file descriptors
when clvmd gets overloaded.
Version 2.02.89 -
==================================
+ Add check for access through NULL pointer when refresh_filter() fails.
Use pthread condition for SINGLENODE lock implementation.
Improve backtrace reporting for some dev_manager_ functions.
Change message severity to log_warn when symlink creation fails.
goto out;
}
- if (full_scan == 2 && !cmd->filter->use_count && !refresh_filters(cmd)) {
- log_error("refresh filters failed");
- goto out;
- }
+ if (full_scan == 2 && (cmd->filter && !cmd->filter->use_count) && !refresh_filters(cmd))
+ goto_out;
- if (!(iter = dev_iter_create(cmd->filter, (full_scan == 2) ? 1 : 0))) {
+ if (!cmd->filter || !(iter = dev_iter_create(cmd->filter, (full_scan == 2) ? 1 : 0))) {
log_error("dev_iter creation failed");
goto out;
}
cmd->dump_filter = 0;
if (!(f3 = _init_filter_components(cmd)))
- return 0;
+ return_0;
init_ignore_suspended_devices(find_config_tree_int(cmd,
"devices/ignore_suspended_devices", DEFAULT_IGNORE_SUSPENDED_DEVICES));
cmd->filter = NULL;
}
- r = _init_filters(cmd, 0);
+ if (!(r = _init_filters(cmd, 0)))
+ stack;
/*
* During repair code must not reset suspended flag.
/* Is there an md superblock here? */
/* FIXME: still possible issues here - rescan cache? */
if (!dev && md_filtering()) {
- refresh_filters(cmd);
+ if (!refresh_filters(cmd))
+ goto_bad;
+
init_md_filtering(0);
dev = dev_cache_get(name, cmd->filter);
init_md_filtering(1);