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-23 15:17:31 -0500
commit8dee190ce775b370054b2ee15b41d60bf12d7b40 (patch)
treef020ead67c743013bf8f6d67c7151706e4469c44
parent7ccb9a32e0fc89e3ee79631fc9b81aec0872440e (diff)
downloadlvm2-8dee190ce775b370054b2ee15b41d60bf12d7b40.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 cac106e81..5e9662e71 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -3859,7 +3859,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 */