summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2016-04-06 15:57:09 -0500
committerDavid Teigland <teigland@redhat.com>2016-04-11 16:04:25 -0500
commitd34bed9086d244d9637d0c60c5e36299f59016da (patch)
tree537a1d24cfb640944c642455031376a36ba98463
parent5495ec99607abeaa88198c092a73b18a8af8c01e (diff)
downloadlvm2-d34bed9086d244d9637d0c60c5e36299f59016da.tar.gz
lvmetad: disable if command uses lvm1
Alternatively, a command could return an error saying that lvm1 and lvmetad are not compatible.
-rw-r--r--tools/lvmcmdline.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 404c835d3..dd89a7bd6 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: Not using 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 "