summaryrefslogtreecommitdiff
path: root/lib/label/label.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/label/label.c')
-rw-r--r--lib/label/label.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/label/label.c b/lib/label/label.c
index 7eef1d99a..3f2305e0e 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -1221,7 +1221,7 @@ int label_scan(struct cmd_context *cmd)
* If the largest metadata is within 1MB of the bcache size, then start
* warning.
*/
- max_metadata_size_bytes = lvmcache_max_metadata_size();
+ max_metadata_size_bytes = lvmcache_max_metadata_size_bytes();
if (max_metadata_size_bytes + (1024 * 1024) > _current_bcache_size_bytes) {
/* we want bcache to be 1MB larger than the max metadata seen */
@@ -1236,6 +1236,14 @@ int label_scan(struct cmd_context *cmd)
(unsigned long long)want_size_kb);
}
+ /*
+ * If vg metadata is using a large percentage of a metadata area, then
+ * create /run/lvm/scan_lock_global to tell future lvm commands to
+ * begin doing lock_global() prior to scanning to avoid problems due to
+ * metadata wrapping between label_scan and vg_read.
+ */
+ set_scan_lock_global(cmd);
+
dm_list_init(&cmd->hints);
/*