1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Check for refresh_filter failure

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.
This commit is contained in:
Zdenek Kabelac 2011-10-11 09:09:00 +00:00
parent 8187aff8b9
commit d4f134b8f6
4 changed files with 10 additions and 8 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.89 - Version 2.02.89 -
================================== ==================================
Add check for access through NULL pointer when refresh_filter() fails.
Use pthread condition for SINGLENODE lock implementation. Use pthread condition for SINGLENODE lock implementation.
Improve backtrace reporting for some dev_manager_ functions. Improve backtrace reporting for some dev_manager_ functions.
Change message severity to log_warn when symlink creation fails. Change message severity to log_warn when symlink creation fails.

View File

@ -597,12 +597,10 @@ int lvmcache_label_scan(struct cmd_context *cmd, int full_scan)
goto out; goto out;
} }
if (full_scan == 2 && !cmd->filter->use_count && !refresh_filters(cmd)) { if (full_scan == 2 && (cmd->filter && !cmd->filter->use_count) && !refresh_filters(cmd))
log_error("refresh filters failed"); goto_out;
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"); log_error("dev_iter creation failed");
goto out; goto out;
} }

View File

@ -786,7 +786,7 @@ static int _init_filters(struct cmd_context *cmd, unsigned load_persistent_cache
cmd->dump_filter = 0; cmd->dump_filter = 0;
if (!(f3 = _init_filter_components(cmd))) if (!(f3 = _init_filter_components(cmd)))
return 0; return_0;
init_ignore_suspended_devices(find_config_tree_int(cmd, init_ignore_suspended_devices(find_config_tree_int(cmd,
"devices/ignore_suspended_devices", DEFAULT_IGNORE_SUSPENDED_DEVICES)); "devices/ignore_suspended_devices", DEFAULT_IGNORE_SUSPENDED_DEVICES));
@ -1402,7 +1402,8 @@ int refresh_filters(struct cmd_context *cmd)
cmd->filter = NULL; cmd->filter = NULL;
} }
r = _init_filters(cmd, 0); if (!(r = _init_filters(cmd, 0)))
stack;
/* /*
* During repair code must not reset suspended flag. * During repair code must not reset suspended flag.

View File

@ -1373,7 +1373,9 @@ static int pvcreate_check(struct cmd_context *cmd, const char *name,
/* Is there an md superblock here? */ /* Is there an md superblock here? */
/* FIXME: still possible issues here - rescan cache? */ /* FIXME: still possible issues here - rescan cache? */
if (!dev && md_filtering()) { if (!dev && md_filtering()) {
refresh_filters(cmd); if (!refresh_filters(cmd))
goto_bad;
init_md_filtering(0); init_md_filtering(0);
dev = dev_cache_get(name, cmd->filter); dev = dev_cache_get(name, cmd->filter);
init_md_filtering(1); init_md_filtering(1);