main - debug: reduce some debugging noise
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8784211958ee0ea663171e186bd5217b1c7b52c7 Commit: 8784211958ee0ea663171e186bd5217b1c7b52c7 Parent: ae92888a7baf3f1882168a6084eca23c9b85b998 Author: Zdenek Kabelac <[email protected]> AuthorDate: Thu Oct 14 18:16:49 2021 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Thu Oct 14 23:34:11 2021 +0200
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.
--- lib/commands/toolcontext.c | 1 + lib/commands/toolcontext.h | 2 ++ lib/filters/filter-persistent.c | 3 ++- lib/format_text/archiver.c | 5 ++++- tools/pvscan.c | 8 ++++---- tools/toollib.c | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-)
lib/commands/toolcontext.c +1 -0
@@ -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;
lib/commands/toolcontext.h +2 -0
@@ -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.
lib/filters/filter-persistent.c +2 -1
@@ -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)) {
lib/format_text/archiver.c +4 -1
@@ -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 ; }
tools/pvscan.c +4 -4
@@ -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))
tools/toollib.c +1 -1
@@ -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);