diff options
author | David Teigland <teigland@redhat.com> | 2015-11-17 15:00:01 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2015-11-17 15:00:01 -0600 |
commit | 1ca9a14d67eda3611174a2baf79e906e9194ad04 (patch) | |
tree | aaa2a5a026b331350678f99b1daf29e65bef4d74 | |
parent | adbeb5152d6bd71b69f5996131672862830dc311 (diff) | |
download | lvm2-dev-dct-lvmetad-16.tar.gz |
lvmetad: scan devices when duplicate PVs are presentdev-dct-lvmetad-16
lvmetad cannot properly manage duplicate PVs, so
when they are present, commands revert to scanning
devices. When the scanning finds that no duplicate
PVs are present, commands go back to use lvmetad.
-rw-r--r-- | tools/lvmcmdline.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index 3cf7f1bae..01b2dd6bb 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -1648,32 +1648,20 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) * - Another local command may have run with a different global filter * which changed the content of lvmetad from what we want (recognized * by differnet token values.) + * - Duplicate PVs are present. Since duplicate PVs cannot be managed + * by lvmetad, commands revert to scanning devices when they are present. * * The pvscan command does rescanning and lvmetad upates itself, * so it doesn't want this automatic rescanning. */ if (lvmetad_is_connected() && !(cmd->command->flags & SKIP_AUTO_PVSCAN)) { - if (!lvmetad_token_matches(cmd) || cmd->include_foreign_vgs) { + if (!lvmetad_token_matches(cmd) || + lvmetad_check_duplicates(cmd) || + cmd->include_foreign_vgs) { if (!lvmetad_pvscan_all_devs(cmd, NULL)) { log_error("Failed to scan devices"); return ECMD_FAILED; } - } else if (lvmetad_check_duplicates(cmd)) { - /* - * Warn if duplicate PVs exist. Because we're using lvmetad, - * we won't be scanning devices, so we rely on lvmetad to tell - * us if duplicate devices were seen by the last device scan. - * - * FIXME: maybe enhance this by listing the actual duplicate devices? - * The device scan that set the duplicates flag in lvmetad could - * also send lvmetad the names of the duplicate devices it ignored. - * That list could then be returned here and included in this - * warning. However, that list would not always be accurate, - * because a "full picture" scan is needed to construct a truely - * accurate picture of duplicate PVs. - */ - log_warn("WARNING: duplicate PVs have been found."); - log_warn("WARNING: duplicate PVs can be resolved with filters or vgimportclone."); } } |