summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2017-07-28 15:35:19 -0500
committerDavid Teigland <teigland@redhat.com>2017-10-11 10:47:10 -0500
commitbbf5b05c82d58a0de8aa2e0e89b32b2a2cccac08 (patch)
tree51dfc467208e701d68139b0d793c38215557d7f6
parent6ebe78e96f6191b6a1b263403dda8942e8056fda (diff)
downloadlvm2-bbf5b05c82d58a0de8aa2e0e89b32b2a2cccac08.tar.gz
labels: avoid label_read when getting fmt in vg_read
When vg_read() begins, it looks up the format (fmt) for the VG name in lvmcache, telling lvmcache_fmt_from_vgname() to reread labels on all devices in the VG. Avoid rereading the labels on all the devices, and trust that lvmcache has correct information. If the format of the VG is not available, the calling code already rescans labels and retries.
-rw-r--r--lib/metadata/metadata.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 410962ef1..4656f6b77 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4307,7 +4307,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
/* Find the vgname in the cache */
/* If it's not there we must do full scan to be completely sure */
- if (!(fmt = lvmcache_fmt_from_vgname(cmd, vgname, vgid, 1))) {
+ if (!(fmt = lvmcache_fmt_from_vgname(cmd, vgname, vgid, 0))) {
lvmcache_label_scan(cmd);
if (!(fmt = lvmcache_fmt_from_vgname(cmd, vgname, vgid, 1))) {
/* Independent MDAs aren't supported under low memory */