1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

debug: reduce some debugging noise

Resolve event_activation configure option just once.

Do not print debug_devs about 'bad' filtering, when
actually filter already printed reason for skipping

Do not trace more then once about backup being disabled.

No debug when unlinked file does not exists in pvscan.
This commit is contained in:
Zdenek Kabelac 2021-10-14 18:16:49 +02:00
parent ae92888a7b
commit 8784211958
6 changed files with 14 additions and 7 deletions

View File

@ -765,6 +765,7 @@ static int _process_config(struct cmd_context *cmd)
init_pv_min_size((uint64_t)pv_min_kb * (1024 >> SECTOR_SHIFT));
cmd->check_pv_dev_sizes = find_config_tree_bool(cmd, metadata_check_pv_device_sizes_CFG, NULL);
cmd->event_activation = find_config_tree_bool(cmd, global_event_activation_CFG, NULL);
if (!process_profilable_config(cmd))
return_0;

View File

@ -199,6 +199,8 @@ struct cmd_context {
unsigned check_devs_used:1; /* check devs used by LVs */
unsigned print_device_id_not_found:1; /* print devices file entries not found */
unsigned ignore_device_name_mismatch:1; /* skip updating devices file names */
unsigned backup_disabled:1; /* skip repeated debug message */
unsigned event_activation:1; /* whether event_activation is set */
/*
* Devices and filtering.

View File

@ -137,7 +137,8 @@ static int _lookup_p(struct cmd_context *cmd, struct dev_filter *f, struct devic
l = PF_GOOD_DEVICE;
}
log_debug_devs("filter caching %s %s", pass ? "good" : "bad", dev_name(dev));
if (!dev->filtered_flags) /* skipping reason already logged by filter */
log_debug_devs("filter caching %s %s", pass ? "good" : "bad", dev_name(dev));
dm_list_iterate_items(sl, &dev->aliases)
if (!dm_hash_insert(pf->devices, sl->str, l)) {

View File

@ -626,7 +626,10 @@ void check_current_backup(struct volume_group *vg)
int old_suppress;
if (!vg->cmd->backup_params->enabled || !vg->cmd->backup_params->dir) {
log_debug("Skipping check for current backup, since backup is disabled.");
if (!vg->cmd->backup_disabled) {
log_debug("Skipping check for current backup, since backup is disabled.");
vg->cmd->backup_disabled = 1;
}
return;
}

View File

@ -271,7 +271,7 @@ static void _lookup_file_remove(char *vgname)
log_debug("Unlink pvs_lookup: %s", path);
if (unlink(path))
if (unlink(path) && (errno != ENOENT))
log_sys_debug("unlink", path);
}
@ -292,7 +292,7 @@ void online_vg_file_remove(const char *vgname)
log_debug("Unlink vg online: %s", path);
if (unlink(path))
if (unlink(path) && (errno != ENOENT))
log_sys_debug("unlink", path);
}
@ -332,7 +332,7 @@ static void _online_pvid_file_remove_devno(int major, int minor)
if ((file_major == major) && (file_minor == minor)) {
log_debug("Unlink pv online %s", path);
if (unlink(path))
if (unlink(path) && (errno != ENOENT))
log_sys_debug("unlink", path);
if (file_vgname[0]) {
@ -360,7 +360,7 @@ static void _online_files_remove(const char *dirpath)
memset(path, 0, sizeof(path));
snprintf(path, sizeof(path), "%s/%s", dirpath, de->d_name);
if (unlink(path))
if (unlink(path) && (errno != ENOENT))
log_sys_debug("unlink", path);
}
if (closedir(dir))

View File

@ -828,7 +828,7 @@ int lv_change_activate(struct cmd_context *cmd, struct logical_volume *lv,
* user may want to take charge of activation changes to the VG
* and not have the system autoactivation interfere.
*/
if (!is_change_activating(activate) && find_config_tree_bool(cmd, global_event_activation_CFG, NULL))
if (!is_change_activating(activate) && cmd->event_activation)
online_vg_file_remove(lv->vg->name);
set_lv_notify(lv->vg->cmd);