summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2016-02-01 15:53:45 -0600
committerDavid Teigland <teigland@redhat.com>2016-03-28 15:18:46 -0500
commitfdd9f3684d873eb8736c1186c60d26ead6661b04 (patch)
tree9a44a81be5d15fbe5710344768a8ce2d98fdb61a
parentc5820517fab98a2acb870e103ab86072faea8ee3 (diff)
downloadlvm2-fdd9f3684d873eb8736c1186c60d26ead6661b04.tar.gz
lvmetad: disable when lvm1 metadata is created
We could alternatively report an error and fail the command.
-rw-r--r--tools/lvmcmdline.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index d21c4cf17..6eb7bfcf4 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -22,6 +22,7 @@
#include "stub.h"
#include "last-path-component.h"
+#include "format1.h"
#include <signal.h>
#include <sys/stat.h>
@@ -1601,6 +1602,13 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
goto out;
}
+ if (!strcmp(cmd->fmt->name, FMT_LVM1_NAME) && lvmetad_used()) {
+ log_warn("WARNING: Disabling lvmetad cache which does not support obsolete metadata.");
+ lvmetad_set_disabled(cmd, "LVM1");
+ log_warn("WARNING: Disabling use of lvmetad because lvm1 format is used.");
+ lvmetad_set_active(cmd, 0);
+ }
+
if (cmd->metadata_read_only &&
!(cmd->command->flags & PERMITTED_READ_ONLY)) {
log_error("%s: Command not permitted while global/metadata_read_only "