1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

lvmetad: disable if command uses lvm1

Alternatively, a command could return an error saying
that lvm1 and lvmetad are not compatible.
This commit is contained in:
David Teigland 2016-04-06 15:57:09 -05:00
parent 1e380864e5
commit 2a17610899

View File

@ -22,6 +22,7 @@
#include "stub.h" #include "stub.h"
#include "last-path-component.h" #include "last-path-component.h"
#include "format1.h"
#include <signal.h> #include <signal.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -1601,6 +1602,13 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
goto out; 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 && if (cmd->metadata_read_only &&
!(cmd->command->flags & PERMITTED_READ_ONLY)) { !(cmd->command->flags & PERMITTED_READ_ONLY)) {
log_error("%s: Command not permitted while global/metadata_read_only " log_error("%s: Command not permitted while global/metadata_read_only "