Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=029a76b4f830750cc312c…
Commit: 029a76b4f830750cc312c062d77cdaa4d1a1bba9
Parent: c365d7de4f49a0b175772548c92961143c078921
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Apr 30 15:47:00 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Apr 30 15:56:51 2018 -0500
clvmd: don't repair vg from vg_read in clvmd
The mixed up vg repair code in vg_read was trying
to repair a vg when vg_read was called by clvmd.
The clvmd daemon isn't supposed to be repairing
or writing a vg.
(This is a temporary workaround; vg repair will soon
be pulled out of vg_read so it can be called in a
controlled way and consolidated instead of spread
around.)
---
lib/metadata/metadata.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 97225df..5e376f3 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4282,6 +4282,11 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
return correct_vg;
}
+ if (cmd->is_clvmd) {
+ _free_pv_list(&all_pvs);
+ return correct_vg;
+ }
+
if (skipped_rescan) {
log_warn("Not repairing metadata for VG %s.", vgname);
_free_pv_list(&all_pvs);
@@ -4335,7 +4340,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
}
/* We have the VG now finally, check if PV ext info is in sync with VG metadata. */
- if (!_check_or_repair_pv_ext(cmd, correct_vg,
+ if (!cmd->is_clvmd && !_check_or_repair_pv_ext(cmd, correct_vg,
skipped_rescan ? 0 : *consistent,
&inconsistent_pvs)) {
release_vg(correct_vg);
@@ -4344,7 +4349,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
*consistent = !inconsistent_pvs;
- if (correct_vg && *consistent && !skipped_rescan) {
+ if (!cmd->is_clvmd && correct_vg && *consistent && !skipped_rescan) {
if (update_old_pv_ext && !_vg_update_old_pv_ext_if_needed(correct_vg)) {
release_vg(correct_vg);
return_NULL;
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=89935ace29bd209746720…
Commit: 89935ace29bd2097467201546e9211ebed23c4bc
Parent: 39f24a169c7cdec5e927a20aacb774e88407d31a
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Apr 30 13:00:05 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Apr 30 13:03:15 2018 -0500
clvmd: keep old saved_vg if it matches new
There is no need to release the old saved_vg
if it matches the new version.
---
lib/cache/lvmcache.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index bd92055..cb19030 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -360,7 +360,8 @@ struct volume_group *lvmcache_get_saved_vg(const char *vgid, int precommitted)
/* Do we need to actually set saved_vg_old to match saved_vg_new?
* By just dropping old, we force a subsequent request for old to
* reread it rather than just using new. */
- if (vginfo->saved_vg_old) {
+
+ if (vginfo->saved_vg_old && (vginfo->saved_vg_old < vg->seqno)) {
log_debug_cache("lvmcache: drop saved_vg_old because new invalidates");
_saved_vg_free(vginfo, 1, 0);
}
@@ -425,7 +426,8 @@ struct volume_group *lvmcache_get_saved_vg_latest(const char *vgid)
/* Do we need to actually set saved_vg_old to match saved_vg_new?
* By just dropping old, we force a subsequent request for old to
* reread it rather than just using new. */
- if (vginfo->saved_vg_old) {
+
+ if (vginfo->saved_vg_old && (vginfo->saved_vg_old->seqno < vg->seqno)) {
log_debug_cache("lvmcache: drop saved_vg_old because new invalidates");
_saved_vg_free(vginfo, 1, 0);
}