master - lvmetad: warn about making changes while not using lvmetad
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1134ab63240de66850c30fe1576bbb8b4f3e7052 Commit: 1134ab63240de66850c30fe1576bbb8b4f3e7052 Parent: 6e6f8025ff6ad8b3909a4631f71f310821ea7d4b Author: David Teigland <[email protected]> AuthorDate: Thu Apr 21 10:28:01 2016 -0500 Committer: David Teigland <[email protected]> CommitterDate: Thu Apr 21 10:28:01 2016 -0500
lvmetad: warn about making changes while not using lvmetad
If lvmetad is running, and a command opts to not use it (--config global/use_lvmetad=0), and the command changes metadata, then the metadata change is not visible to lvmetad. Subsequent commands using lvmetad to change metadata may cause corruption based on the invalid lvmetad state.
Eventually we can set the disabled state in lvmetad to prevent this problem, but for now print a warning about the possibility.
--- lib/commands/toolcontext.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
lib/commands/toolcontext.c +3 -1
@@ -1720,8 +1720,10 @@ static int _init_lvmetad(struct cmd_context *cmd) }if (!find_config_tree_bool (cmd, global_use_lvmetad_CFG,NULL )) { -if (lvmetad_pidfile_present ()) +if (lvmetad_pidfile_present ()) {log_warn ("WARNING: Not using lvmetad because config setting use_lvmetad=0." ); +log_warn ("WARNING: To avoid corruption, rescan devices to make changes visible (pvscan --cache)." ); + }return 1 ; }