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

dumpconfig: fix dumpconfig --type diff used in lvm shell as second and later command

The dumpconfig reuses existing config_def_check results in case
the check is done during general lvm command context initialization
(when enabled by config/checks=1) so dumpconfig does not need to run
the same check again during its execution, hence saving some time.

However, we don't check for differences from defaults during general
lvm command initialization as it's useless at that time. It makes
sense only in case when such a check is directly requested (like in
the case of lvm dumpconfig --type diff). We need to take care that
the reused information was already produced with this "diff" checking
before and if not, we need to force the check so the check status also
gathers the new "diff" info now.

Also, do not do diff checking for any other dumpconfig command that
is run after dumpconfig --type diff.
This commit is contained in:
Peter Rajnoha 2014-05-19 14:51:11 +02:00
parent 9a324df3b3
commit 24f32721a9
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
Fix dumpconfig --type diff when run as second and later cmd in lvm shell.
Fix wrong profile reuse from previous run if another cmd is run in lvm shell.
Move cache description from lvm(8) to lvmcache(7) man page.
Display skipped prompt in silent mode.

View File

@ -41,10 +41,14 @@ static int _do_def_check(struct config_def_tree_spec *spec,
handle->force_check = 1;
handle->suppress_messages = 1;
if (spec->type == CFG_DEF_TREE_DIFF)
if (spec->type == CFG_DEF_TREE_DIFF) {
if (!handle->check_diff)
handle->skip_if_checked = 0;
handle->check_diff = 1;
else
} else {
handle->skip_if_checked = 1;
handle->check_diff = 0;
}
config_def_check(handle);
*cft_check_handle = handle;