diff options
author | David Teigland <teigland@redhat.com> | 2016-04-21 10:28:01 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2016-04-21 10:28:01 -0500 |
commit | 1134ab63240de66850c30fe1576bbb8b4f3e7052 (patch) | |
tree | b3fc092142e25a845e13e44b70fda62f424122ec | |
parent | 6e6f8025ff6ad8b3909a4631f71f310821ea7d4b (diff) | |
download | lvm2-1134ab63240de66850c30fe1576bbb8b4f3e7052.tar.gz |
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.
-rw-r--r-- | lib/commands/toolcontext.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index 67d4f99da..31f3a5071 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -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; } |