diff options
author | David Teigland <teigland@redhat.com> | 2016-06-09 11:34:38 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2016-06-09 11:44:46 -0500 |
commit | ec12f5f050e57d8fb8703c5d8526935e7481bfb1 (patch) | |
tree | 2616f69e61149aece6c822d76673f21ed0e9be6a | |
parent | 21d9df6c6fd950da38da54f1cbc834a5a2b30efd (diff) | |
download | lvm2-dev-dct-lvmetad-vg-update-3.tar.gz |
vgsplit: fixes for lvmetad updatedev-dct-lvmetad-vg-update-3
-rw-r--r-- | lib/cache/lvmetad.c | 8 | ||||
-rw-r--r-- | tools/vgsplit.c | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c index 04140db7b..36f637dff 100644 --- a/lib/cache/lvmetad.c +++ b/lib/cache/lvmetad.c @@ -1073,7 +1073,13 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna log_debug_lvmetad("Rescan VG %s because no lvmlockd lock is held", vgname); rescan = 1; } else if (dm_config_find_node(reply.cft->root, "vg_invalid")) { - log_debug_lvmetad("Rescan VG %s because lvmetad returned invalid", vgname); + if (!is_lockd_type(vg->lock_type)) { + /* Can happen if a previous command failed/crashed without updating lvmetad. */ + log_warn("WARNING: Reading VG %s from disk because lvmetad metadata is invalid.", vgname); + } else { + /* This is normal when the VG was modified by another host. */ + log_debug_lvmetad("Rescan VG %s because lvmetad returned invalid", vgname); + } rescan = 1; } diff --git a/tools/vgsplit.c b/tools/vgsplit.c index e7c6e191b..c3ddb8ca6 100644 --- a/tools/vgsplit.c +++ b/tools/vgsplit.c @@ -653,6 +653,8 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv) if (!vg_write(vg_to) || !vg_commit(vg_to)) goto_bad; + lvmetad_vg_update_finish(vg_to); + backup(vg_to); /* @@ -664,6 +666,8 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv) if (!vg_write(vg_from) || !vg_commit(vg_from)) goto_bad; + lvmetad_vg_update_finish(vg_from); + backup(vg_from); } @@ -686,6 +690,8 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv) if (!vg_write(vg_to) || !vg_commit(vg_to)) goto_bad; + lvmetad_vg_update_finish(vg_to); + backup(vg_to); log_print_unless_silent("%s volume group \"%s\" successfully split from \"%s\"", |