main - vdo: report supported range in error path
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9f3eff002cc229d3c22...
Commit: 9f3eff002cc229d3c22dfd7db6da69dadc0bd460
Parent: b5c8e591ed9ee30b67e79d60705d3c0bb8509a2a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Jul 9 21:28:40 2022 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jul 11 01:18:24 2022 +0200
vdo: report supported range in error path
---
device_mapper/vdo/vdo_target.c | 63 ++++++++++++++++++++++++++++++------------
1 file changed, 45 insertions(+), 18 deletions(-)
diff --git a/device_mapper/vdo/vdo_target.c b/device_mapper/vdo/vdo_target.c
index 3ebe0592e..ab3fff26a 100644
--- a/device_mapper/vdo/vdo_target.c
+++ b/device_mapper/vdo/vdo_target.c
@@ -27,81 +27,108 @@ bool dm_vdo_validate_target_params(const struct dm_vdo_target_params *vtp,
/* 512 or 4096 bytes only ATM */
if ((vtp->minimum_io_size != (512 >> SECTOR_SHIFT)) &&
(vtp->minimum_io_size != (4096 >> SECTOR_SHIFT))) {
- log_error("VDO minimum io size %u is unsupported.",
+ log_error("VDO minimum io size %u is unsupported [512, 4096].",
vtp->minimum_io_size);
valid = false;
}
if ((vtp->block_map_cache_size_mb < DM_VDO_BLOCK_MAP_CACHE_SIZE_MINIMUM_MB) ||
(vtp->block_map_cache_size_mb > DM_VDO_BLOCK_MAP_CACHE_SIZE_MAXIMUM_MB)) {
- log_error("VDO block map cache size %u out of range.",
- vtp->block_map_cache_size_mb);
+ log_error("VDO block map cache size %u MiB is out of range [%u..%u].",
+ vtp->block_map_cache_size_mb,
+ DM_VDO_BLOCK_MAP_CACHE_SIZE_MINIMUM_MB,
+ DM_VDO_BLOCK_MAP_CACHE_SIZE_MAXIMUM_MB);
valid = false;
}
if ((vtp->block_map_era_length < DM_VDO_BLOCK_MAP_ERA_LENGTH_MINIMUM) ||
(vtp->block_map_era_length > DM_VDO_BLOCK_MAP_ERA_LENGTH_MAXIMUM)) {
- log_error("VDO block map era length %u out of range.",
- vtp->block_map_era_length);
+ log_error("VDO block map era length %u is out of range [%u..%u].",
+ vtp->block_map_era_length,
+ DM_VDO_BLOCK_MAP_ERA_LENGTH_MINIMUM,
+ DM_VDO_BLOCK_MAP_ERA_LENGTH_MAXIMUM);
valid = false;
}
if ((vtp->index_memory_size_mb < DM_VDO_INDEX_MEMORY_SIZE_MINIMUM_MB) ||
(vtp->index_memory_size_mb > DM_VDO_INDEX_MEMORY_SIZE_MAXIMUM_MB)) {
- log_error("VDO index memory size %u out of range.",
- vtp->index_memory_size_mb);
+ log_error("VDO index memory size %u MiB is out of range [%u..%u].",
+ vtp->index_memory_size_mb,
+ DM_VDO_INDEX_MEMORY_SIZE_MINIMUM_MB,
+ DM_VDO_INDEX_MEMORY_SIZE_MAXIMUM_MB);
valid = false;
}
if ((vtp->slab_size_mb < DM_VDO_SLAB_SIZE_MINIMUM_MB) ||
(vtp->slab_size_mb > DM_VDO_SLAB_SIZE_MAXIMUM_MB)) {
- log_error("VDO slab size %u out of range.",
- vtp->slab_size_mb);
+ log_error("VDO slab size %u MiB is out of range [%u..%u].",
+ vtp->slab_size_mb,
+ DM_VDO_SLAB_SIZE_MINIMUM_MB,
+ DM_VDO_SLAB_SIZE_MAXIMUM_MB);
valid = false;
}
if ((vtp->max_discard < DM_VDO_MAX_DISCARD_MINIMUM) ||
(vtp->max_discard > DM_VDO_MAX_DISCARD_MAXIMUM)) {
- log_error("VDO max discard %u out of range.",
- vtp->max_discard);
+ log_error("VDO max discard %u is out of range [%u..%u].",
+ vtp->max_discard,
+ DM_VDO_MAX_DISCARD_MINIMUM,
+ DM_VDO_MAX_DISCARD_MAXIMUM);
valid = false;
}
if (vtp->ack_threads > DM_VDO_ACK_THREADS_MAXIMUM) {
- log_error("VDO ack threads %u out of range.", vtp->ack_threads);
+ log_error("VDO ack threads %u is out of range [0..%u].",
+ vtp->ack_threads,
+ DM_VDO_ACK_THREADS_MAXIMUM);
valid = false;
}
if ((vtp->bio_threads < DM_VDO_BIO_THREADS_MINIMUM) ||
(vtp->bio_threads > DM_VDO_BIO_THREADS_MAXIMUM)) {
- log_error("VDO bio threads %u out of range.", vtp->bio_threads);
+ log_error("VDO bio threads %u is out of range [%u..%u].",
+ vtp->bio_threads,
+ DM_VDO_BIO_THREADS_MINIMUM,
+ DM_VDO_BIO_THREADS_MAXIMUM);
valid = false;
}
if ((vtp->bio_rotation < DM_VDO_BIO_ROTATION_MINIMUM) ||
(vtp->bio_rotation > DM_VDO_BIO_ROTATION_MAXIMUM)) {
- log_error("VDO bio rotation %u out of range.", vtp->bio_rotation);
+ log_error("VDO bio rotation %u is out of range [%u..%u].",
+ vtp->bio_rotation,
+ DM_VDO_BIO_ROTATION_MINIMUM,
+ DM_VDO_BIO_ROTATION_MAXIMUM);
valid = false;
}
if ((vtp->cpu_threads < DM_VDO_CPU_THREADS_MINIMUM) ||
(vtp->cpu_threads > DM_VDO_CPU_THREADS_MAXIMUM)) {
- log_error("VDO cpu threads %u out of range.", vtp->cpu_threads);
+ log_error("VDO cpu threads %u is out of range [%u..%u].",
+ vtp->cpu_threads,
+ DM_VDO_CPU_THREADS_MINIMUM,
+ DM_VDO_CPU_THREADS_MAXIMUM);
valid = false;
}
if (vtp->hash_zone_threads > DM_VDO_HASH_ZONE_THREADS_MAXIMUM) {
- log_error("VDO hash zone threads %u out of range.", vtp->hash_zone_threads);
+ log_error("VDO hash zone threads %u is out of range [0..%u].",
+ vtp->hash_zone_threads,
+ DM_VDO_HASH_ZONE_THREADS_MAXIMUM);
valid = false;
}
if (vtp->logical_threads > DM_VDO_LOGICAL_THREADS_MAXIMUM) {
- log_error("VDO logical threads %u out of range.", vtp->logical_threads);
+ log_error("VDO logical threads %u is out of range [0..%u].",
+ vtp->logical_threads,
+ DM_VDO_LOGICAL_THREADS_MAXIMUM);
valid = false;
}
if (vtp->physical_threads > DM_VDO_PHYSICAL_THREADS_MAXIMUM) {
- log_error("VDO physical threads %u out of range.", vtp->physical_threads);
+ log_error("VDO physical threads %u is out of range [0..%u].",
+ vtp->physical_threads,
+ DM_VDO_PHYSICAL_THREADS_MAXIMUM);
valid = false;
}
1 year, 9 months
main - vdo: use defines also for configuration defines
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b5c8e591ed9ee30b67e...
Commit: b5c8e591ed9ee30b67e79d60705d3c0bb8509a2a
Parent: f445624c339a5c1436a47d2b51046869f183eb03
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 24 15:54:08 2022 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jul 11 01:18:24 2022 +0200
vdo: use defines also for configuration defines
Keep single source for most of values printed in lvm.conf
(still needs some conversion)
Correct max for logical threads to 60
(we may refuse some older configuration which might eventually
user higher numbers - but so far let's assume no user have ever set this
as it's been non-trivial and if would complicate code unnecessarily.)
Accept maximum of 4PiB for virtual size of VDO LV
(lvm2 will drop 'header borders to 0 for this case').
---
conf/example.conf.in | 9 +++----
device_mapper/vdo/vdo_limits.h | 55 ++++++++++++++++++++++--------------------
device_mapper/vdo/vdo_target.c | 11 +++++----
lib/config/config_settings.h | 32 +++++++++++++++---------
4 files changed, 60 insertions(+), 47 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index 94f7a23fd..4e5482fee 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -625,13 +625,12 @@ allocation {
# Enables or disables whether VDO volume should tag its latency-critical
# writes with the REQ_SYNC flag. Some device mapper targets such as dm-raid5
# process writes with this flag at a higher priority.
- # Default is enabled.
# This configuration option has an automatic default value.
# vdo_use_metadata_hints = 1
# Configuration option allocation/vdo_minimum_io_size.
# The minimum IO size for VDO volume to accept, in bytes.
- # Valid values are 512 or 4096. The recommended and default value is 4096.
+ # Valid values are 512 or 4096. The recommended value is 4096.
# This configuration option has an automatic default value.
# vdo_minimum_io_size = 4096
@@ -684,7 +683,7 @@ allocation {
# Configuration option allocation/vdo_bio_threads.
# Specifies the number of threads to use for submitting I/O
# operations to the storage device of VDO volume.
- # The value must be in range [1..100]
+ # The value must be in range [1..100].
# Each additional thread after the first will use an additional 18MiB of RAM,
# plus 1.12 MiB of RAM per megabyte of configured read cache size.
# This configuration option has an automatic default value.
@@ -698,7 +697,7 @@ allocation {
# Configuration option allocation/vdo_cpu_threads.
# Specifies the number of threads to use for CPU-intensive work such as
- # hashing or compression for VDO volume. The value must be in range [1..100]
+ # hashing or compression for VDO volume. The value must be in range [1..100].
# This configuration option has an automatic default value.
# vdo_cpu_threads = 2
@@ -716,7 +715,7 @@ allocation {
# processing based on the hash value computed from the block data.
# A logical thread count of 9 or more will require explicitly specifying
# a sufficiently large block map cache size, as well.
- # The value must be in range [0..100].
+ # The value must be in range [0..60].
# vdo_hash_zone_threads, vdo_logical_threads and vdo_physical_threads must be
# either all zero or all non-zero.
# This configuration option has an automatic default value.
diff --git a/device_mapper/vdo/vdo_limits.h b/device_mapper/vdo/vdo_limits.h
index e145100b1..db365ace2 100644
--- a/device_mapper/vdo/vdo_limits.h
+++ b/device_mapper/vdo/vdo_limits.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2018-2022 Red Hat, Inc. All rights reserved.
*
* This file is part of the device-mapper userspace tools.
*
@@ -15,49 +15,52 @@
#ifndef DEVICE_MAPPER_VDO_LIMITS_H
#define DEVICE_MAPPER_VDO_LIMITS_H
+#ifndef SECTOR_SHIFT
+#define SECTOR_SHIFT 9L
+#endif
+
#define DM_VDO_BLOCK_SIZE UINT64_C(8) // 4KiB in sectors
+#define DM_VDO_BLOCK_SIZE_KB (DM_VDO_BLOCK_SIZE << SECTOR_SHIFT)
#define DM_VDO_BLOCK_MAP_CACHE_SIZE_MINIMUM_MB (128) // 128MiB
#define DM_VDO_BLOCK_MAP_CACHE_SIZE_MAXIMUM_MB (16 * 1024 * 1024 - 1) // 16TiB - 1
#define DM_VDO_BLOCK_MAP_CACHE_SIZE_MINIMUM_PER_LOGICAL_THREAD (4096 * DM_VDO_BLOCK_SIZE_KB)
-#define DM_VDO_BLOCK_MAP_ERA_LENGTH_MINIMUM (1)
-#define DM_VDO_BLOCK_MAP_ERA_LENGTH_MAXIMUM (16380)
+#define DM_VDO_BLOCK_MAP_ERA_LENGTH_MINIMUM 1
+#define DM_VDO_BLOCK_MAP_ERA_LENGTH_MAXIMUM 16380
-#define DM_VDO_INDEX_MEMORY_SIZE_MINIMUM_MB (256) // 0.25 GiB
+#define DM_VDO_INDEX_MEMORY_SIZE_MINIMUM_MB 256 // 0.25 GiB
#define DM_VDO_INDEX_MEMORY_SIZE_MAXIMUM_MB (1024 * 1024 * 1024) // 1TiB
-//#define DM_VDO_READ_CACHE_SIZE_MINIMUM_MB (0)
-#define DM_VDO_READ_CACHE_SIZE_MAXIMUM_MB (16 * 1024 * 1024 - 1) // 16TiB - 1
-
-#define DM_VDO_SLAB_SIZE_MINIMUM_MB (128) // 128MiB
+#define DM_VDO_SLAB_SIZE_MINIMUM_MB 128 // 128MiB
#define DM_VDO_SLAB_SIZE_MAXIMUM_MB (32 * 1024) // 32GiB
+#define DM_VDO_SLABS_MAXIMUM 8192
-//#define DM_VDO_LOGICAL_SIZE_MINIMUM_MB (0)
-#define DM_VDO_LOGICAL_SIZE_MAXIMUM_MB (UINT64_C(4) * 1024 * 1024 * 1024) // 4PiB
+#define DM_VDO_LOGICAL_SIZE_MAXIMUM (UINT64_C(4) * 1024 * 1024 * 1024 * 1024 * 1024 >> SECTOR_SHIFT) // 4PiB
+#define DM_VDO_PHYSICAL_SIZE_MAXIMUM (UINT64_C(64) * DM_VDO_BLOCK_SIZE_KB * 1024 * 1024 * 1024 >> SECTOR_SHIFT) // 256TiB
-//#define DM_VDO_ACK_THREADS_MINIMUM (0)
-#define DM_VDO_ACK_THREADS_MAXIMUM (100)
+#define DM_VDO_ACK_THREADS_MINIMUM 0
+#define DM_VDO_ACK_THREADS_MAXIMUM 100
-#define DM_VDO_BIO_THREADS_MINIMUM (1)
-#define DM_VDO_BIO_THREADS_MAXIMUM (100)
+#define DM_VDO_BIO_THREADS_MINIMUM 1
+#define DM_VDO_BIO_THREADS_MAXIMUM 100
-#define DM_VDO_BIO_ROTATION_MINIMUM (1)
-#define DM_VDO_BIO_ROTATION_MAXIMUM (1024)
+#define DM_VDO_BIO_ROTATION_MINIMUM 1
+#define DM_VDO_BIO_ROTATION_MAXIMUM 1024
-#define DM_VDO_CPU_THREADS_MINIMUM (1)
-#define DM_VDO_CPU_THREADS_MAXIMUM (100)
+#define DM_VDO_CPU_THREADS_MINIMUM 1
+#define DM_VDO_CPU_THREADS_MAXIMUM 100
-//#define DM_VDO_HASH_ZONE_THREADS_MINIMUM (0)
-#define DM_VDO_HASH_ZONE_THREADS_MAXIMUM (100)
+#define DM_VDO_HASH_ZONE_THREADS_MINIMUM 0
+#define DM_VDO_HASH_ZONE_THREADS_MAXIMUM 100
-//#define DM_VDO_LOGICAL_THREADS_MINIMUM (0)
-#define DM_VDO_LOGICAL_THREADS_MAXIMUM (100)
+#define DM_VDO_LOGICAL_THREADS_MINIMUM 0
+#define DM_VDO_LOGICAL_THREADS_MAXIMUM 60
-//#define DM_VDO_PHYSICAL_THREADS_MINIMUM (0)
-#define DM_VDO_PHYSICAL_THREADS_MAXIMUM (16)
+#define DM_VDO_PHYSICAL_THREADS_MINIMUM 0
+#define DM_VDO_PHYSICAL_THREADS_MAXIMUM 16
-#define DM_VDO_MAX_DISCARD_MINIMUM (1)
-#define DM_VDO_MAX_DISCARD_MAXIMUM (UINT32_MAX / 4096)
+#define DM_VDO_MAX_DISCARD_MINIMUM 1
+#define DM_VDO_MAX_DISCARD_MAXIMUM (UINT32_MAX / (uint32_t)(DM_VDO_BLOCK_SIZE_KB))
#endif // DEVICE_MAPPER_VDO_LIMITS_H
diff --git a/device_mapper/vdo/vdo_target.c b/device_mapper/vdo/vdo_target.c
index 0e5abd162..3ebe0592e 100644
--- a/device_mapper/vdo/vdo_target.c
+++ b/device_mapper/vdo/vdo_target.c
@@ -18,14 +18,15 @@
#include "vdo_limits.h"
#include "target.h"
+/* validate vdo target parameters and 'vdo_size' in sectors */
bool dm_vdo_validate_target_params(const struct dm_vdo_target_params *vtp,
uint64_t vdo_size)
{
bool valid = true;
/* 512 or 4096 bytes only ATM */
- if ((vtp->minimum_io_size != 1) &&
- (vtp->minimum_io_size != 8)) {
+ if ((vtp->minimum_io_size != (512 >> SECTOR_SHIFT)) &&
+ (vtp->minimum_io_size != (4096 >> SECTOR_SHIFT))) {
log_error("VDO minimum io size %u is unsupported.",
vtp->minimum_io_size);
valid = false;
@@ -127,10 +128,10 @@ bool dm_vdo_validate_target_params(const struct dm_vdo_target_params *vtp,
valid = false;
}
- if (vdo_size >= (DM_VDO_LOGICAL_SIZE_MAXIMUM_MB * UINT64_C(1024 * 2))) {
+ if (vdo_size > DM_VDO_LOGICAL_SIZE_MAXIMUM) {
log_error("VDO logical size is by " FMTu64 "KiB bigger then limit " FMTu64 "TiB.",
- (vdo_size - (DM_VDO_LOGICAL_SIZE_MAXIMUM_MB * UINT64_C(1024 * 2))) / 2,
- DM_VDO_LOGICAL_SIZE_MAXIMUM_MB / UINT64_C(1024) / UINT64_C(1024));
+ (vdo_size - DM_VDO_LOGICAL_SIZE_MAXIMUM) / 2,
+ DM_VDO_LOGICAL_SIZE_MAXIMUM / (UINT64_C(1024) * 1024 * 1024 * 1024 >> SECTOR_SHIFT));
valid = false;
}
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index bda6207d7..e97e12152 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -118,6 +118,7 @@
* the previous default value was set (uncommented) in lvm.conf.
*/
#include "lib/config/defaults.h"
+#include "device_mapper/vdo/vdo_limits.h"
cfg_section(root_CFG_SECTION, "(root)", root_CFG_SECTION, 0, vsn(0, 0, 0), 0, NULL, NULL)
@@ -708,12 +709,11 @@ cfg(allocation_vdo_use_deduplication_CFG, "vdo_use_deduplication", allocation_CF
cfg(allocation_vdo_use_metadata_hints_CFG, "vdo_use_metadata_hints", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_USE_METADATA_HINTS, VDO_1ST_VSN, NULL, 0, NULL,
"Enables or disables whether VDO volume should tag its latency-critical\n"
"writes with the REQ_SYNC flag. Some device mapper targets such as dm-raid5\n"
- "process writes with this flag at a higher priority.\n"
- "Default is enabled.\n")
+ "process writes with this flag at a higher priority.\n")
cfg(allocation_vdo_minimum_io_size_CFG, "vdo_minimum_io_size", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_MINIMUM_IO_SIZE, VDO_1ST_VSN, NULL, 0, NULL,
"The minimum IO size for VDO volume to accept, in bytes.\n"
- "Valid values are 512 or 4096. The recommended and default value is 4096.\n")
+ "Valid values are 512 or 4096. The recommended value is 4096.\n")
cfg(allocation_vdo_block_map_cache_size_mb_CFG, "vdo_block_map_cache_size_mb", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_BLOCK_MAP_CACHE_SIZE_MB, VDO_1ST_VSN, NULL, 0, NULL,
"Specifies the amount of memory in MiB allocated for caching block map\n"
@@ -726,7 +726,8 @@ cfg(allocation_vdo_block_map_era_length_CFG, "vdo_block_map_period", allocation_
"The speed with which the block map cache writes out modified block map pages.\n"
"A smaller era length is likely to reduce the amount time spent rebuilding,\n"
"at the cost of increased block map writes during normal operation.\n"
- "The maximum and recommended value is 16380; the minimum value is 1.\n")
+ "The maximum and recommended value is " DM_TO_STRING(DM_VDO_BLOCK_MAP_ERA_LENGTH_MAXIMUM)
+ "; the minimum value is " DM_TO_STRING(DM_VDO_BLOCK_MAP_ERA_LENGTH_MINIMUM) ".\n")
cfg(allocation_vdo_check_point_frequency_CFG, "vdo_check_point_frequency", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_CHECK_POINT_FREQUENCY, VDO_1ST_VSN, NULL, 0, NULL,
"The default check point frequency for VDO volume.\n")
@@ -748,27 +749,34 @@ cfg(allocation_vdo_slab_size_mb_CFG, "vdo_slab_size_mb", allocation_CFG_SECTION,
cfg(allocation_vdo_ack_threads_CFG, "vdo_ack_threads", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_ACK_THREADS, VDO_1ST_VSN, NULL, 0, NULL,
"Specifies the number of threads to use for acknowledging\n"
"completion of requested VDO I/O operations.\n"
- "The value must be at in range [0..100].\n")
+ "The value must be at in range [" DM_TO_STRING(DM_VDO_ACK_THREADS_MINIMUM) ".."
+ DM_TO_STRING(DM_VDO_ACK_THREADS_MAXIMUM) "].\n")
cfg(allocation_vdo_bio_threads_CFG, "vdo_bio_threads", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_BIO_THREADS, VDO_1ST_VSN, NULL, 0, NULL,
"Specifies the number of threads to use for submitting I/O\n"
"operations to the storage device of VDO volume.\n"
- "The value must be in range [1..100]\n"
+ "The value must be in range [" DM_TO_STRING(DM_VDO_BIO_THREADS_MINIMUM) ".."
+ DM_TO_STRING(DM_VDO_BIO_THREADS_MAXIMUM) "].\n"
"Each additional thread after the first will use an additional 18MiB of RAM,\n"
"plus 1.12 MiB of RAM per megabyte of configured read cache size.\n")
cfg(allocation_vdo_bio_rotation_CFG, "vdo_bio_rotation", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_BIO_ROTATION, VDO_1ST_VSN, NULL, 0, NULL,
"Specifies the number of I/O operations to enqueue for each bio-submission\n"
- "thread before directing work to the next. The value must be in range [1..1024].\n")
+ "thread before directing work to the next. The value must be in range ["
+ DM_TO_STRING(DM_VDO_BIO_ROTATION_MINIMUM) ".."
+ DM_TO_STRING(DM_VDO_BIO_ROTATION_MAXIMUM) "].\n")
cfg(allocation_vdo_cpu_threads_CFG, "vdo_cpu_threads", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_CPU_THREADS, VDO_1ST_VSN, NULL, 0, NULL,
"Specifies the number of threads to use for CPU-intensive work such as\n"
- "hashing or compression for VDO volume. The value must be in range [1..100]\n")
+ "hashing or compression for VDO volume. The value must be in range ["
+ DM_TO_STRING(DM_VDO_CPU_THREADS_MINIMUM) ".."
+ DM_TO_STRING(DM_VDO_CPU_THREADS_MAXIMUM) "].\n")
cfg(allocation_vdo_hash_zone_threads_CFG, "vdo_hash_zone_threads", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_HASH_ZONE_THREADS, VDO_1ST_VSN, NULL, 0, NULL,
"Specifies the number of threads across which to subdivide parts of the VDO\n"
"processing based on the hash value computed from the block data.\n"
- "The value must be at in range [0..100].\n"
+ "The value must be at in range [" DM_TO_STRING(DM_VDO_HASH_ZONE_THREADS_MINIMUM) ".."
+ DM_TO_STRING(DM_VDO_HASH_ZONE_THREADS_MAXIMUM) "].\n"
"vdo_hash_zone_threads, vdo_logical_threads and vdo_physical_threads must be\n"
"either all zero or all non-zero.\n")
@@ -777,7 +785,8 @@ cfg(allocation_vdo_logical_threads_CFG, "vdo_logical_threads", allocation_CFG_SE
"processing based on the hash value computed from the block data.\n"
"A logical thread count of 9 or more will require explicitly specifying\n"
"a sufficiently large block map cache size, as well.\n"
- "The value must be in range [0..100].\n"
+ "The value must be in range [" DM_TO_STRING(DM_VDO_LOGICAL_THREADS_MINIMUM) ".."
+ DM_TO_STRING(DM_VDO_LOGICAL_THREADS_MAXIMUM) "].\n"
"vdo_hash_zone_threads, vdo_logical_threads and vdo_physical_threads must be\n"
"either all zero or all non-zero.\n")
@@ -785,7 +794,8 @@ cfg(allocation_vdo_physical_threads_CFG, "vdo_physical_threads", allocation_CFG_
"Specifies the number of threads across which to subdivide parts of the VDO\n"
"processing based on physical block addresses.\n"
"Each additional thread after the first will use an additional 10MiB of RAM.\n"
- "The value must be in range [0..16].\n"
+ "The value must be in range [" DM_TO_STRING(DM_VDO_PHYSICAL_THREADS_MINIMUM) ".."
+ DM_TO_STRING(DM_VDO_PHYSICAL_THREADS_MAXIMUM) "].\n"
"vdo_hash_zone_threads, vdo_logical_threads and vdo_physical_threads must be\n"
"either all zero or all non-zero.\n")
1 year, 9 months
main - vdo: update info about memory
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f445624c339a5c1436a...
Commit: f445624c339a5c1436a47d2b51046869f183eb03
Parent: 8ca2b1bc213188037ecedfbf76de53de871c7f5b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jul 4 15:00:26 2022 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jul 11 01:18:24 2022 +0200
vdo: update info about memory
Add more info about kernel target memory allocation associated with
VDO pool usage.
---
man/lvmvdo.7_main | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/man/lvmvdo.7_main b/man/lvmvdo.7_main
index 14bd640b5..8c3e3eeaa 100644
--- a/man/lvmvdo.7_main
+++ b/man/lvmvdo.7_main
@@ -12,7 +12,7 @@ for primary storage.
.P
Deduplication is a technique for reducing the consumption of storage
resources by eliminating multiple copies of duplicate blocks. Compression
-takes the individual unique blocks and shrinks them.
+takes the individual unique blocks and shrinks them.
These reduced blocks are then efficiently packed together into
physical blocks. Thin provisioning manages the mapping from logical blocks
presented by VDO to where the data has actually been physically stored,
@@ -358,8 +358,17 @@ take otherwise as device is already expected to be empty.
.
.SS \n+[step]. Memory usage
.
-The VDO target requires 370 MiB of RAM plus an additional 268 MiB
-per each 1 TiB of physical storage managed by the volume.
+The VDO target requires 38 MiB of RAM and several variable amounts:
+.IP \(bu 2
+1.15 MiB of RAM for each 1 MiB of configured block map cache size.
+The block map cache requires a minimum of 150 MiB RAM.
+.br
+.IP \(bu
+1.6 MiB of RAM for each 1 TiB of logical space.
+.br
+.IP \(bu
+268 MiB of RAM for each 1 TiB of physical storage managed by the volume.
+.br
.P
UDS requires a minimum of 250 MiB of RAM,
which is also the default amount that deduplication uses.
1 year, 9 months
main - vdo: use single validator
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8ca2b1bc213188037ec...
Commit: 8ca2b1bc213188037ecedfbf76de53de871c7f5b
Parent: fe6fb1ec521407ec586ebda66d67345e33cfc39e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jul 4 16:08:30 2022 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jul 11 01:18:24 2022 +0200
vdo: use single validator
Add era lenght validation into dm_vdo_validate_target_params()
and reuse this validator also for _check_lv_segment().
---
device_mapper/vdo/vdo_target.c | 9 ++++++++-
lib/metadata/merge.c | 37 ++-----------------------------------
2 files changed, 10 insertions(+), 36 deletions(-)
diff --git a/device_mapper/vdo/vdo_target.c b/device_mapper/vdo/vdo_target.c
index 2ffd29145..0e5abd162 100644
--- a/device_mapper/vdo/vdo_target.c
+++ b/device_mapper/vdo/vdo_target.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2018-2022 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@@ -38,6 +38,13 @@ bool dm_vdo_validate_target_params(const struct dm_vdo_target_params *vtp,
valid = false;
}
+ if ((vtp->block_map_era_length < DM_VDO_BLOCK_MAP_ERA_LENGTH_MINIMUM) ||
+ (vtp->block_map_era_length > DM_VDO_BLOCK_MAP_ERA_LENGTH_MAXIMUM)) {
+ log_error("VDO block map era length %u out of range.",
+ vtp->block_map_era_length);
+ valid = false;
+ }
+
if ((vtp->index_memory_size_mb < DM_VDO_INDEX_MEMORY_SIZE_MINIMUM_MB) ||
(vtp->index_memory_size_mb > DM_VDO_INDEX_MEMORY_SIZE_MAXIMUM_MB)) {
log_error("VDO index memory size %u out of range.",
diff --git a/lib/metadata/merge.c b/lib/metadata/merge.c
index 8eff74297..5209f51b5 100644
--- a/lib/metadata/merge.c
+++ b/lib/metadata/merge.c
@@ -545,41 +545,8 @@ static void _check_lv_segment(struct logical_volume *lv, struct lv_segment *seg,
seg_error("is missing a VDO pool data LV");
} else if (!lv_is_vdo_pool_data(seg_lv(seg, 0)))
seg_error("is not VDO pool data LV");
- if ((seg->vdo_params.minimum_io_size != (512 >> SECTOR_SHIFT)) &&
- (seg->vdo_params.minimum_io_size != (4096 >> SECTOR_SHIFT)))
- seg_error("sets unsupported VDO minimum io size");
- if ((seg->vdo_params.block_map_cache_size_mb < DM_VDO_BLOCK_MAP_CACHE_SIZE_MINIMUM_MB) ||
- (seg->vdo_params.block_map_cache_size_mb > DM_VDO_BLOCK_MAP_CACHE_SIZE_MAXIMUM_MB))
- seg_error("sets unsupported VDO block map cache size");
- if ((seg->vdo_params.block_map_era_length < DM_VDO_BLOCK_MAP_ERA_LENGTH_MINIMUM) ||
- (seg->vdo_params.block_map_era_length > DM_VDO_BLOCK_MAP_ERA_LENGTH_MAXIMUM))
- seg_error("sets unsupported VDO block map era length");
- if ((seg->vdo_params.index_memory_size_mb < DM_VDO_INDEX_MEMORY_SIZE_MINIMUM_MB) ||
- (seg->vdo_params.index_memory_size_mb > DM_VDO_INDEX_MEMORY_SIZE_MAXIMUM_MB))
- seg_error("sets unsupported VDO index memory size");
- if ((seg->vdo_params.slab_size_mb < DM_VDO_SLAB_SIZE_MINIMUM_MB) ||
- (seg->vdo_params.slab_size_mb > DM_VDO_SLAB_SIZE_MAXIMUM_MB))
- seg_error("sets unsupported VDO slab size");
- if ((seg->vdo_params.max_discard < DM_VDO_MAX_DISCARD_MINIMUM) ||
- (seg->vdo_params.max_discard > DM_VDO_MAX_DISCARD_MAXIMUM))
- seg_error("sets unsupported VDO max discard");
- if (seg->vdo_params.ack_threads > DM_VDO_ACK_THREADS_MAXIMUM)
- seg_error("sets unsupported VDO ack threads");
- if ((seg->vdo_params.bio_threads < DM_VDO_BIO_THREADS_MINIMUM) ||
- (seg->vdo_params.bio_threads > DM_VDO_BIO_THREADS_MAXIMUM))
- seg_error("sets unsupported VDO bio threads");
- if ((seg->vdo_params.bio_rotation < DM_VDO_BIO_ROTATION_MINIMUM) ||
- (seg->vdo_params.bio_rotation > DM_VDO_BIO_ROTATION_MAXIMUM))
- seg_error("sets unsupported VDO bio rotation");
- if ((seg->vdo_params.cpu_threads < DM_VDO_CPU_THREADS_MINIMUM) ||
- (seg->vdo_params.cpu_threads > DM_VDO_CPU_THREADS_MAXIMUM))
- seg_error("sets unsupported VDO cpu threads");
- if (seg->vdo_params.hash_zone_threads > DM_VDO_HASH_ZONE_THREADS_MAXIMUM)
- seg_error("sets unsupported VDO hash zone threads");
- if (seg->vdo_params.logical_threads > DM_VDO_LOGICAL_THREADS_MAXIMUM)
- seg_error("sets unsupported VDO logical threads");
- if (seg->vdo_params.physical_threads > DM_VDO_PHYSICAL_THREADS_MAXIMUM)
- seg_error("sets unsupported VDO physical threads");
+ if (!dm_vdo_validate_target_params(&seg->vdo_params, 0))
+ seg_error("sets invalid VDO parameter(s)");
} else { /* !VDO pool */
if (seg->vdo_pool_header_size)
seg_error("sets vdo_pool_header_size");
1 year, 9 months
main - man: space after size
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fe6fb1ec521407ec586...
Commit: fe6fb1ec521407ec586ebda66d67345e33cfc39e
Parent: d2667bc25bccaf0f70cc2ded0fd3f25a79cb4f6c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jul 4 15:10:58 2022 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jul 11 01:18:24 2022 +0200
man: space after size
Put space between size and SI unit.
Automatically make this 'space' as fixed size by Makefile sed script.
---
man/Makefile.in | 1 +
man/dmstats.8_main | 4 ++--
man/lvconvert.8_pregen | 12 ++++++------
man/lvcreate.8_end | 24 ++++++++++++------------
man/lvcreate.8_pregen | 12 ++++++------
man/lvmcache.7_main | 6 +++---
man/pvcreate.8_end | 6 +++---
man/vgchange.8_pregen | 2 +-
man/vgcreate.8_pregen | 2 +-
tools/args.h | 18 +++++++++---------
10 files changed, 44 insertions(+), 43 deletions(-)
diff --git a/man/Makefile.in b/man/Makefile.in
index d3f0f583a..8488d309f 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -202,6 +202,7 @@ $(SED) -i -e "/^.TH/ !s+-+\\\-+g" \
-e "s+machine-id+machine\\\-id+g" \
-e "s+lvm-full+lvm\\\-full+g" \
-e "s+lvm-lvpoll+lvm\\\-lvpoll+g" \
+ -e "s+\([[:digit:]]\)\s\([KMGTPE]iB\)+\1\\\ \2+g" \
$@
endef
diff --git a/man/dmstats.8_main b/man/dmstats.8_main
index bf492c554..4f9a9fc7f 100644
--- a/man/dmstats.8_main
+++ b/man/dmstats.8_main
@@ -1142,7 +1142,7 @@ Delete all regions on all devices
#
.B dmstats delete --alldevices --allregions
.P
-Create a whole-device region with areas 10GiB in size on vg00/lvol1
+Create a whole-device region with areas 10 GiB in size on vg00/lvol1
using dmsetup
.br
.br
@@ -1151,7 +1151,7 @@ using dmsetup
.br
vg00-lvol1: Created new region with 5 area(s) as region ID 1
.P
-Create a 1GiB region with 16 areas at the start of vg00/lvol1
+Create a 1 GiB region with 16 areas at the start of vg00/lvol1
.br
#
.B dmstats create --start 0 --len 1G --areas=16 vg00/lvol1
diff --git a/man/lvconvert.8_pregen b/man/lvconvert.8_pregen
index 22de7467f..1e5582bf9 100644
--- a/man/lvconvert.8_pregen
+++ b/man/lvconvert.8_pregen
@@ -1091,14 +1091,14 @@ The name of a cache volume.
\fB-c\fP|\fB--chunksize\fP \fISize\fP[k|UNIT]
.br
The size of chunks in a snapshot, cache pool or thin pool.
-For snapshots, the value must be a power of 2 between 4KiB and 512KiB
+For snapshots, the value must be a power of 2 between 4 KiB and 512 KiB
and the default value is 4.
-For a cache pool the value must be between 32KiB and 1GiB
+For a cache pool the value must be between 32 KiB and 1 GiB
and the default value is 64.
-For a thin pool the value must be between 64KiB and 1GiB
+For a thin pool the value must be between 64 KiB and 1 GiB
and the default value starts with 64 and scales up to fit the
-pool metadata size within 128MiB, if the pool metadata size is not specified.
-The value must be a multiple of 64KiB.
+pool metadata size within 128 MiB, if the pool metadata size is not specified.
+The value must be a multiple of 64 KiB.
See \fBlvmthin\fP(7) and \fBlvmcache\fP(7) for more information.
.
.HP
@@ -1589,7 +1589,7 @@ answer yes. Use with extreme caution.
.HP
\fB-Z\fP|\fB--zero\fP \fBy\fP|\fBn\fP
.br
-For snapshots, this controls zeroing of the first 4KiB of data in the
+For snapshots, this controls zeroing of the first 4 KiB of data in the
snapshot. If the LV is read-only, the snapshot will not be zeroed.
For thin pools, this controls zeroing of provisioned blocks.
Provisioning of large zeroed chunks negatively impacts performance.
diff --git a/man/lvcreate.8_end b/man/lvcreate.8_end
index 30e862d83..466470cb7 100644
--- a/man/lvcreate.8_end
+++ b/man/lvcreate.8_end
@@ -2,7 +2,7 @@
.SH EXAMPLES
.
.P
-Create a striped LV with 3 stripes, a stripe size of 8KiB and a size of 100MiB.
+Create a striped LV with 3 stripes, a stripe size of 8 KiB and a size of 100 MiB.
The LV name is chosen by lvcreate.
.br
.B lvcreate -i 3 -I 8 -L 100m vg00
@@ -33,17 +33,17 @@ for overwriting 20% of the size of the original LV.
.br
.B lvcreate -s -l 20%ORIGIN -n mysnap vg00/mylv
.P
-Create a sparse LV with 1TiB of virtual space, and actual space just under
-100MiB.
+Create a sparse LV with 1 TiB of virtual space, and actual space just under
+100 MiB.
.br
.B lvcreate --snapshot --virtualsize 1t --size 100m --name mylv vg00
.P
-Create a linear LV with a usable size of 64MiB on specific physical extents.
+Create a linear LV with a usable size of 64 MiB on specific physical extents.
.br
.B lvcreate -L 64m -n mylv vg00 /dev/sda:0-7 /dev/sdb:0-7
.P
-Create a RAID5 LV with a usable size of 5GiB, 3 stripes, a stripe size of
-64KiB, using a total of 4 devices (including one for parity).
+Create a RAID5 LV with a usable size of 5 GiB, 3 stripes, a stripe size of
+64 KiB, using a total of 4 devices (including one for parity).
.br
.B lvcreate --type raid5 -L 5G -i 3 -I 64 -n mylv vg00
.P
@@ -57,7 +57,7 @@ the VG, in which case \fB-i 7\fP must be used to get to the current maximum of
.B --type raid5 -l 100%FREE -n mylv vg00
.RE
.P
-Create RAID10 LV with a usable size of 5GiB, using 2 stripes, each on
+Create RAID10 LV with a usable size of 5 GiB, using 2 stripes, each on
a two-image mirror. (Note that the \fB-i\fP and \fB-m\fP arguments behave
differently:
\fB-i\fP specifies the total number of stripes,
@@ -66,13 +66,13 @@ to the first image).
.br
.B lvcreate --type raid10 -L 5G -i 2 -m 1 -n mylv vg00
.P
-Create a 1TiB thin LV mythin, with 256GiB thinpool tpool0 in vg00.
+Create a 1 TiB thin LV mythin, with 256 GiB thinpool tpool0 in vg00.
.br
.B lvcreate -T -V 1T --size 256G --name mythin vg00/tpool0
.P
-Create a 1TiB thin LV, first creating a new thin pool for it, where
-the thin pool has 100MiB of space, uses 2 stripes, has a 64KiB stripe
-size, and 256KiB chunk size.
+Create a 1 TiB thin LV, first creating a new thin pool for it, where
+the thin pool has 100 MiB of space, uses 2 stripes, has a 64 KiB stripe
+size, and 256 KiB chunk size.
.br
.B lvcreate --type thin --name mylv --thinpool mypool
.RS
@@ -102,6 +102,6 @@ then combining the new origin LV with an existing cache pool.
.B -L 100G -n mylv vg00 /dev/slow1
.RE
.P
-Create a VDO LV vdo0 with VDOPoolLV size of 10GiB and name vpool1.
+Create a VDO LV vdo0 with VDOPoolLV size of 10 GiB and name vpool1.
.br
.B lvcreate --vdo --size 10G --name vdo0 vg00/vpool1
diff --git a/man/lvcreate.8_pregen b/man/lvcreate.8_pregen
index efca91c19..3940aa77e 100644
--- a/man/lvcreate.8_pregen
+++ b/man/lvcreate.8_pregen
@@ -954,14 +954,14 @@ The name of a cache volume.
\fB-c\fP|\fB--chunksize\fP \fISize\fP[k|UNIT]
.br
The size of chunks in a snapshot, cache pool or thin pool.
-For snapshots, the value must be a power of 2 between 4KiB and 512KiB
+For snapshots, the value must be a power of 2 between 4 KiB and 512 KiB
and the default value is 4.
-For a cache pool the value must be between 32KiB and 1GiB
+For a cache pool the value must be between 32 KiB and 1 GiB
and the default value is 64.
-For a thin pool the value must be between 64KiB and 1GiB
+For a thin pool the value must be between 64 KiB and 1 GiB
and the default value starts with 64 and scales up to fit the
-pool metadata size within 128MiB, if the pool metadata size is not specified.
-The value must be a multiple of 64KiB.
+pool metadata size within 128 MiB, if the pool metadata size is not specified.
+The value must be a multiple of 64 KiB.
See \fBlvmthin\fP(7) and \fBlvmcache\fP(7) for more information.
.
.HP
@@ -1509,7 +1509,7 @@ answer yes. Use with extreme caution.
.HP
\fB-Z\fP|\fB--zero\fP \fBy\fP|\fBn\fP
.br
-Controls zeroing of the first 4KiB of data in the new LV.
+Controls zeroing of the first 4 KiB of data in the new LV.
Default is \fBy\fP.
Snapshot COW volumes are always zeroed.
For thin pools, this controls zeroing of provisioned blocks.
diff --git a/man/lvmcache.7_main b/man/lvmcache.7_main
index 8b8289c74..d46c50d04 100644
--- a/man/lvmcache.7_main
+++ b/man/lvmcache.7_main
@@ -455,7 +455,7 @@ defines the default cache mode.
.
The size of data blocks managed by dm-cache can be specified with the
--chunksize option when caching is started. The default unit is KiB. The
-value must be a multiple of 32KiB between 32KiB and 1GiB. Cache chunks
+value must be a multiple of 32 KiB between 32 KiB and 1 GiB. Cache chunks
bigger then 512KiB shall be only used when necessary.
.P
Using a chunk size that is too large can result in wasteful use of the
@@ -495,9 +495,9 @@ account of normal io traffic going to the devices.
.P
User can set migration threshold via cache policy settings as
"migration_threshold=<#sectors>" to set the maximum number
-of sectors being migrated, the default being 2048 sectors (1MiB).
+of sectors being migrated, the default being 2048 sectors (1 MiB).
.P
-Command to set migration threshold to 2MiB (4096 sectors):
+Command to set migration threshold to 2 MiB (4096 sectors):
.P
.B lvcreate --cachepolicy 'migration_threshold=4096' VG/LV
.P
diff --git a/man/pvcreate.8_end b/man/pvcreate.8_end
index 2dfb7ecb5..7ebf963bb 100644
--- a/man/pvcreate.8_end
+++ b/man/pvcreate.8_end
@@ -5,9 +5,9 @@ Initialize a partition and a full device.
.br
.B pvcreate /dev/sdc4 /dev/sde
.P
-If a device is a 4KiB sector drive that compensates for windows
-partitioning (sector 7 is the lowest aligned logical block, the 4KiB
-sectors start at LBA -1, and consequently sector 63 is aligned on a 4KiB
+If a device is a 4 KiB sector drive that compensates for windows
+partitioning (sector 7 is the lowest aligned logical block, the 4 KiB
+sectors start at LBA -1, and consequently sector 63 is aligned on a 4 KiB
boundary) manually account for this when initializing for use by LVM.
.br
.B pvcreate --dataalignmentoffset 7s /dev/sdb
diff --git a/man/vgchange.8_pregen b/man/vgchange.8_pregen
index 07626ee1b..d70f1e5ac 100644
--- a/man/vgchange.8_pregen
+++ b/man/vgchange.8_pregen
@@ -720,7 +720,7 @@ Metadata may not be changed with this option.
Sets the physical extent size of PVs in the VG.
The value must be either a power of 2 of at least 1 sector
(where the sector size is the largest sector size of the PVs
-currently used in the VG), or at least 128KiB.
+currently used in the VG), or at least 128 KiB.
Once this value has been set, it is difficult to change
without recreating the VG, unless no extents need moving.
Before increasing the physical extent size, you might need to use lvresize,
diff --git a/man/vgcreate.8_pregen b/man/vgcreate.8_pregen
index d07741ffc..2c0c548b5 100644
--- a/man/vgcreate.8_pregen
+++ b/man/vgcreate.8_pregen
@@ -323,7 +323,7 @@ incorrect results.
Sets the physical extent size of PVs in the VG.
The value must be either a power of 2 of at least 1 sector
(where the sector size is the largest sector size of the PVs
-currently used in the VG), or at least 128KiB.
+currently used in the VG), or at least 128 KiB.
Once this value has been set, it is difficult to change
without recreating the VG, unless no extents need moving.
.
diff --git a/tools/args.h b/tools/args.h
index baae333e1..2f94d4535 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -1103,14 +1103,14 @@ arg(blockdevice_ARG, 'b', "blockdevice", 0, 0, 0,
arg(chunksize_ARG, 'c', "chunksize", sizekb_VAL, 0, 0,
"The size of chunks in a snapshot, cache pool or thin pool.\n"
- "For snapshots, the value must be a power of 2 between 4KiB and 512KiB\n"
+ "For snapshots, the value must be a power of 2 between 4 KiB and 512 KiB\n"
"and the default value is 4.\n"
- "For a cache pool the value must be between 32KiB and 1GiB\n"
+ "For a cache pool the value must be between 32 KiB and 1 GiB\n"
"and the default value is 64.\n"
- "For a thin pool the value must be between 64KiB and 1GiB\n"
+ "For a thin pool the value must be between 64 KiB and 1 GiB\n"
"and the default value starts with 64 and scales up to fit the\n"
- "pool metadata size within 128MiB, if the pool metadata size is not specified.\n"
- "The value must be a multiple of 64KiB.\n"
+ "pool metadata size within 128 MiB, if the pool metadata size is not specified.\n"
+ "The value must be a multiple of 64 KiB.\n"
"See \\fBlvmthin\\fP(7) and \\fBlvmcache\\fP(7) for more information.\n")
arg(clustered_ARG, 'c', "clustered", bool_VAL, 0, 0,
@@ -1462,14 +1462,14 @@ arg(physicalextentsize_ARG, 's', "physicalextentsize", sizemb_VAL, 0, 0,
"Sets the physical extent size of PVs in the VG.\n"
"The value must be either a power of 2 of at least 1 sector\n"
"(where the sector size is the largest sector size of the PVs\n"
- "currently used in the VG), or at least 128KiB.\n"
+ "currently used in the VG), or at least 128 KiB.\n"
"Once this value has been set, it is difficult to change\n"
"without recreating the VG, unless no extents need moving.\n"
"#vgchange\n"
"Sets the physical extent size of PVs in the VG.\n"
"The value must be either a power of 2 of at least 1 sector\n"
"(where the sector size is the largest sector size of the PVs\n"
- "currently used in the VG), or at least 128KiB.\n"
+ "currently used in the VG), or at least 128 KiB.\n"
"Once this value has been set, it is difficult to change\n"
"without recreating the VG, unless no extents need moving.\n"
"Before increasing the physical extent size, you might need to use lvresize,\n"
@@ -1626,12 +1626,12 @@ arg(zero_ARG, 'Z', "zero", bool_VAL, 0, 0,
"Set zeroing mode for thin pool. Note: already provisioned blocks from pool\n"
"in non-zero mode are not cleared in unwritten parts when setting --zero y.\n"
"#lvconvert\n"
- "For snapshots, this controls zeroing of the first 4KiB of data in the\n"
+ "For snapshots, this controls zeroing of the first 4 KiB of data in the\n"
"snapshot. If the LV is read-only, the snapshot will not be zeroed.\n"
"For thin pools, this controls zeroing of provisioned blocks.\n"
"Provisioning of large zeroed chunks negatively impacts performance.\n"
"#lvcreate\n"
- "Controls zeroing of the first 4KiB of data in the new LV.\n"
+ "Controls zeroing of the first 4 KiB of data in the new LV.\n"
"Default is \\fBy\\fP.\n"
"Snapshot COW volumes are always zeroed.\n"
"For thin pools, this controls zeroing of provisioned blocks.\n"
1 year, 9 months
main - vdo: fix conversion of vdo_slab_size_mb 2nd
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d2667bc25bccaf0f70c...
Commit: d2667bc25bccaf0f70cc2ded0fd3f25a79cb4f6c
Parent: 92b4fcf57f3c6d212d06b72b097e1a06e6efb84b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jul 11 01:07:24 2022 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jul 11 01:18:24 2022 +0200
vdo: fix conversion of vdo_slab_size_mb 2nd
Patch 1b070f366ba57a6eb24df03241284732db5047e9 should have
been already fixing this issue but since it the incorrect
patch rebasing the change to vdo_slabSize got lost.
So again now with explicit one-line patch.
---
scripts/lvm_import_vdo.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/lvm_import_vdo.sh b/scripts/lvm_import_vdo.sh
index c10b3b050..c4c1d152e 100755
--- a/scripts/lvm_import_vdo.sh
+++ b/scripts/lvm_import_vdo.sh
@@ -324,7 +324,7 @@ allocation {
vdo_check_point_frequency = $vdo_indexCfreq
vdo_use_sparse_index = $(get_enabled_value_ "$vdo_indexSparse")
vdo_index_memory_size_mb = $(awk "BEGIN {print $vdo_indexMemory * 1024}")
- vdo_slab_size_mb = $(( $(get_kb_size_with_unit_ "$vdo_blockMapCacheSize") / 1024 ))
+ vdo_slab_size_mb = $(( $(get_kb_size_with_unit_ "$vdo_slabSize") / 1024 ))
vdo_ack_threads = $vdo_ackThreads
vdo_bio_threads = $vdo_bioThreads
vdo_bio_rotation = $vdo_bioRotationInterval
1 year, 9 months
rhel-8.7.0 - exit with error when --devicesfile name doesn't exist
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=73b9a2805ca2f2c70f6...
Commit: 73b9a2805ca2f2c70f6f631b405f8fea3f72f23b
Parent: e60d7ce8e748cb6d51552879c162d01aafa17160
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Jul 5 17:08:00 2022 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jul 6 10:22:28 2022 -0500
exit with error when --devicesfile name doesn't exist
---
lib/cache/lvmcache.c | 3 ++-
lib/label/label.c | 4 ++--
test/shell/devicesfile-basic.sh | 1 +
tools/pvcreate.c | 3 ++-
tools/pvremove.c | 3 ++-
tools/pvscan.c | 3 ++-
tools/toollib.c | 27 +++++++++++++++++++++------
tools/vgcfgrestore.c | 5 ++++-
tools/vgcreate.c | 5 ++++-
tools/vgextend.c | 3 ++-
tools/vgmerge.c | 3 ++-
tools/vgsplit.c | 3 ++-
12 files changed, 46 insertions(+), 17 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index 0e62cd267..61a2fee6d 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1600,7 +1600,8 @@ int lvmcache_label_scan(struct cmd_context *cmd)
* with infos/vginfos based on reading headers from
* each device, and a vg summary from each mda.
*/
- label_scan(cmd);
+ if (!label_scan(cmd))
+ return_0;
/*
* When devnames are used as device ids (which is dispreferred),
diff --git a/lib/label/label.c b/lib/label/label.c
index 06958b502..00ede2b76 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -800,7 +800,7 @@ static int _setup_bcache(void)
}
if (!(scan_bcache = bcache_create(BCACHE_BLOCK_SIZE_IN_SECTORS, cache_blocks, ioe))) {
- log_error("Failed to create bcache with %d cache blocks.", cache_blocks);
+ log_error("Failed to set up io layer with %d blocks.", cache_blocks);
return 0;
}
@@ -1015,7 +1015,7 @@ int label_scan(struct cmd_context *cmd)
* data to invalidate.)
*/
if (!(iter = dev_iter_create(NULL, 0))) {
- log_error("Scanning failed to get devices.");
+ log_error("Failed to get device list.");
return 0;
}
while ((dev = dev_iter_get(cmd, iter))) {
diff --git a/test/shell/devicesfile-basic.sh b/test/shell/devicesfile-basic.sh
index d1cfb6a35..2d197a73a 100644
--- a/test/shell/devicesfile-basic.sh
+++ b/test/shell/devicesfile-basic.sh
@@ -107,6 +107,7 @@ not vgs --devicesfile test.devices $vg2
# misspelled override name fails
not vgs --devicesfile doesnotexist $vg1
not vgs --devicesfile doesnotexist $vg2
+not vgs --devicesfile doesnotexist
# devicesfile and devices cannot be used together
not vgs --devicesfile test.devices --devices "$dev1","$dev1" $vg1
diff --git a/tools/pvcreate.c b/tools/pvcreate.c
index 71eb060a3..a1ef0e9e1 100644
--- a/tools/pvcreate.c
+++ b/tools/pvcreate.c
@@ -144,7 +144,8 @@ int pvcreate(struct cmd_context *cmd, int argc, char **argv)
cmd->create_edit_devices_file = 1;
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd))
+ return_ECMD_FAILED;
if (!(handle = init_processing_handle(cmd, NULL))) {
log_error("Failed to initialize processing handle.");
diff --git a/tools/pvremove.c b/tools/pvremove.c
index 2dfdbd016..5c39ee0c7 100644
--- a/tools/pvremove.c
+++ b/tools/pvremove.c
@@ -45,7 +45,8 @@ int pvremove(struct cmd_context *cmd, int argc, char **argv)
clear_hint_file(cmd);
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd))
+ return_ECMD_FAILED;
/* When forcibly clearing a PV we don't care about a VG lock. */
if (pp.force == DONT_PROMPT_OVERRIDE)
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 50d46051a..bce1fbb40 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -1626,7 +1626,8 @@ static int _pvscan_cache_all(struct cmd_context *cmd, int argc, char **argv,
* which we want 'pvscan --cache' to do, and that uses
* info from lvmcache, e.g. duplicate pv info.
*/
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd))
+ return_0;
cmd->pvscan_recreate_hints = 0;
cmd->use_hints = 0;
diff --git a/tools/toollib.c b/tools/toollib.c
index 01ba03658..210b3dca5 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1601,7 +1601,10 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv,
log_set_report_object_type(LOG_REPORT_OBJECT_TYPE_LABEL);
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd)) {
+ ret_max = ECMD_FAILED;
+ goto_out;
+ }
if (argc) {
for (; opt < argc; opt++) {
@@ -2381,8 +2384,13 @@ int process_each_vg(struct cmd_context *cmd,
* Scan all devices to populate lvmcache with initial
* list of PVs and VGs.
*/
- if (!(read_flags & PROCESS_SKIP_SCAN))
- lvmcache_label_scan(cmd);
+ if (!(read_flags & PROCESS_SKIP_SCAN)) {
+ if (!lvmcache_label_scan(cmd)) {
+ ret_max = ECMD_FAILED;
+ goto_out;
+ }
+ }
+
/*
* A list of all VGs on the system is needed when:
@@ -3932,7 +3940,10 @@ int process_each_lv(struct cmd_context *cmd,
* Scan all devices to populate lvmcache with initial
* list of PVs and VGs.
*/
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd)) {
+ ret_max = ECMD_FAILED;
+ goto_out;
+ }
/*
* A list of all VGs on the system is needed when:
@@ -4568,8 +4579,12 @@ int process_each_pv(struct cmd_context *cmd,
goto_out;
}
- if (!(read_flags & PROCESS_SKIP_SCAN))
- lvmcache_label_scan(cmd);
+ if (!(read_flags & PROCESS_SKIP_SCAN)) {
+ if (!lvmcache_label_scan(cmd)) {
+ ret_max = ECMD_FAILED;
+ goto_out;
+ }
+ }
if (!lvmcache_get_vgnameids(cmd, &all_vgnameids, only_this_vgname, 1)) {
ret_max = ret;
diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c
index e49313d14..9fcba89d4 100644
--- a/tools/vgcfgrestore.c
+++ b/tools/vgcfgrestore.c
@@ -132,7 +132,10 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
clear_hint_file(cmd);
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd)) {
+ unlock_vg(cmd, NULL, vg_name);
+ return_ECMD_FAILED;
+ }
cmd->handles_unknown_segments = 1;
diff --git a/tools/vgcreate.c b/tools/vgcreate.c
index dde3f1eac..14608777f 100644
--- a/tools/vgcreate.c
+++ b/tools/vgcreate.c
@@ -84,7 +84,10 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv)
cmd->create_edit_devices_file = 1;
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd)) {
+ unlock_vg(cmd, NULL, vp_new.vg_name);
+ return_ECMD_FAILED;
+ }
if (lvmcache_vginfo_from_vgname(vp_new.vg_name, NULL)) {
unlock_vg(cmd, NULL, vp_new.vg_name);
diff --git a/tools/vgextend.c b/tools/vgextend.c
index 0856b4c78..fecd6bdd5 100644
--- a/tools/vgextend.c
+++ b/tools/vgextend.c
@@ -160,7 +160,8 @@ int vgextend(struct cmd_context *cmd, int argc, char **argv)
cmd->edit_devices_file = 1;
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd))
+ return_ECMD_FAILED;
if (!(handle = init_processing_handle(cmd, NULL))) {
log_error("Failed to initialize processing handle.");
diff --git a/tools/vgmerge.c b/tools/vgmerge.c
index 08615cd62..4ed4a8f0b 100644
--- a/tools/vgmerge.c
+++ b/tools/vgmerge.c
@@ -72,7 +72,8 @@ static int _vgmerge_single(struct cmd_context *cmd, const char *vg_name_to,
return ECMD_FAILED;
}
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd))
+ return_ECMD_FAILED;
if (strcmp(vg_name_to, vg_name_from) > 0)
lock_vg_from_first = 1;
diff --git a/tools/vgsplit.c b/tools/vgsplit.c
index a085ac2ba..9d6534e89 100644
--- a/tools/vgsplit.c
+++ b/tools/vgsplit.c
@@ -559,7 +559,8 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
return ECMD_FAILED;
}
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd))
+ return_ECMD_FAILED;
if (!(vginfo_to = lvmcache_vginfo_from_vgname(vg_name_to, NULL))) {
if (!validate_name(vg_name_to)) {
1 year, 9 months
main - exit with error when --devicesfile name doesn't exist
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=92b4fcf57f3c6d212d0...
Commit: 92b4fcf57f3c6d212d06b72b097e1a06e6efb84b
Parent: d0f94e763d6e6bca491c74cea93ec3062f32757e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Jul 5 17:08:00 2022 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jul 6 10:10:58 2022 -0500
exit with error when --devicesfile name doesn't exist
---
lib/cache/lvmcache.c | 3 ++-
lib/label/label.c | 4 ++--
test/shell/devicesfile-basic.sh | 1 +
tools/pvcreate.c | 3 ++-
tools/pvremove.c | 3 ++-
tools/pvscan.c | 3 ++-
tools/toollib.c | 27 +++++++++++++++++++++------
tools/vgcfgrestore.c | 5 ++++-
tools/vgcreate.c | 5 ++++-
tools/vgextend.c | 3 ++-
tools/vgmerge.c | 3 ++-
tools/vgsplit.c | 3 ++-
12 files changed, 46 insertions(+), 17 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index 22edcfd84..a1c4a61c8 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1612,7 +1612,8 @@ int lvmcache_label_scan(struct cmd_context *cmd)
* with infos/vginfos based on reading headers from
* each device, and a vg summary from each mda.
*/
- label_scan(cmd);
+ if (!label_scan(cmd))
+ return_0;
/*
* When devnames are used as device ids (which is dispreferred),
diff --git a/lib/label/label.c b/lib/label/label.c
index 711edb6f4..f845abb96 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -801,7 +801,7 @@ static int _setup_bcache(void)
}
if (!(scan_bcache = bcache_create(BCACHE_BLOCK_SIZE_IN_SECTORS, cache_blocks, ioe))) {
- log_error("Failed to create bcache with %d cache blocks.", cache_blocks);
+ log_error("Failed to set up io layer with %d blocks.", cache_blocks);
return 0;
}
@@ -1292,7 +1292,7 @@ int label_scan(struct cmd_context *cmd)
* data to invalidate.)
*/
if (!(iter = dev_iter_create(NULL, 0))) {
- log_error("Scanning failed to get devices.");
+ log_error("Failed to get device list.");
return 0;
}
while ((dev = dev_iter_get(cmd, iter))) {
diff --git a/test/shell/devicesfile-basic.sh b/test/shell/devicesfile-basic.sh
index 77fe265a0..715c579b3 100644
--- a/test/shell/devicesfile-basic.sh
+++ b/test/shell/devicesfile-basic.sh
@@ -107,6 +107,7 @@ not vgs --devicesfile test.devices $vg2
# misspelled override name fails
not vgs --devicesfile doesnotexist $vg1
not vgs --devicesfile doesnotexist $vg2
+not vgs --devicesfile doesnotexist
# devicesfile and devices cannot be used together
not vgs --devicesfile test.devices --devices "$dev1","$dev1" $vg1
diff --git a/tools/pvcreate.c b/tools/pvcreate.c
index 71eb060a3..a1ef0e9e1 100644
--- a/tools/pvcreate.c
+++ b/tools/pvcreate.c
@@ -144,7 +144,8 @@ int pvcreate(struct cmd_context *cmd, int argc, char **argv)
cmd->create_edit_devices_file = 1;
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd))
+ return_ECMD_FAILED;
if (!(handle = init_processing_handle(cmd, NULL))) {
log_error("Failed to initialize processing handle.");
diff --git a/tools/pvremove.c b/tools/pvremove.c
index 2dfdbd016..5c39ee0c7 100644
--- a/tools/pvremove.c
+++ b/tools/pvremove.c
@@ -45,7 +45,8 @@ int pvremove(struct cmd_context *cmd, int argc, char **argv)
clear_hint_file(cmd);
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd))
+ return_ECMD_FAILED;
/* When forcibly clearing a PV we don't care about a VG lock. */
if (pp.force == DONT_PROMPT_OVERRIDE)
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 1e47d754a..72c3279c3 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -1407,7 +1407,8 @@ static int _pvscan_cache_all(struct cmd_context *cmd, int argc, char **argv,
* which we want 'pvscan --cache' to do, and that uses
* info from lvmcache, e.g. duplicate pv info.
*/
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd))
+ return_0;
cmd->pvscan_recreate_hints = 0;
cmd->use_hints = 0;
diff --git a/tools/toollib.c b/tools/toollib.c
index d77092d89..544791808 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1655,7 +1655,10 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv,
log_set_report_object_type(LOG_REPORT_OBJECT_TYPE_LABEL);
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd)) {
+ ret_max = ECMD_FAILED;
+ goto_out;
+ }
if (argc) {
for (; opt < argc; opt++) {
@@ -2435,8 +2438,13 @@ int process_each_vg(struct cmd_context *cmd,
* Scan all devices to populate lvmcache with initial
* list of PVs and VGs.
*/
- if (!(read_flags & PROCESS_SKIP_SCAN))
- lvmcache_label_scan(cmd);
+ if (!(read_flags & PROCESS_SKIP_SCAN)) {
+ if (!lvmcache_label_scan(cmd)) {
+ ret_max = ECMD_FAILED;
+ goto_out;
+ }
+ }
+
/*
* A list of all VGs on the system is needed when:
@@ -3987,7 +3995,10 @@ int process_each_lv(struct cmd_context *cmd,
* Scan all devices to populate lvmcache with initial
* list of PVs and VGs.
*/
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd)) {
+ ret_max = ECMD_FAILED;
+ goto_out;
+ }
/*
* A list of all VGs on the system is needed when:
@@ -4623,8 +4634,12 @@ int process_each_pv(struct cmd_context *cmd,
goto_out;
}
- if (!(read_flags & PROCESS_SKIP_SCAN))
- lvmcache_label_scan(cmd);
+ if (!(read_flags & PROCESS_SKIP_SCAN)) {
+ if (!lvmcache_label_scan(cmd)) {
+ ret_max = ECMD_FAILED;
+ goto_out;
+ }
+ }
if (!lvmcache_get_vgnameids(cmd, &all_vgnameids, only_this_vgname, 1)) {
ret_max = ret;
diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c
index e49313d14..9fcba89d4 100644
--- a/tools/vgcfgrestore.c
+++ b/tools/vgcfgrestore.c
@@ -132,7 +132,10 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
clear_hint_file(cmd);
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd)) {
+ unlock_vg(cmd, NULL, vg_name);
+ return_ECMD_FAILED;
+ }
cmd->handles_unknown_segments = 1;
diff --git a/tools/vgcreate.c b/tools/vgcreate.c
index dde3f1eac..14608777f 100644
--- a/tools/vgcreate.c
+++ b/tools/vgcreate.c
@@ -84,7 +84,10 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv)
cmd->create_edit_devices_file = 1;
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd)) {
+ unlock_vg(cmd, NULL, vp_new.vg_name);
+ return_ECMD_FAILED;
+ }
if (lvmcache_vginfo_from_vgname(vp_new.vg_name, NULL)) {
unlock_vg(cmd, NULL, vp_new.vg_name);
diff --git a/tools/vgextend.c b/tools/vgextend.c
index 0856b4c78..fecd6bdd5 100644
--- a/tools/vgextend.c
+++ b/tools/vgextend.c
@@ -160,7 +160,8 @@ int vgextend(struct cmd_context *cmd, int argc, char **argv)
cmd->edit_devices_file = 1;
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd))
+ return_ECMD_FAILED;
if (!(handle = init_processing_handle(cmd, NULL))) {
log_error("Failed to initialize processing handle.");
diff --git a/tools/vgmerge.c b/tools/vgmerge.c
index 08615cd62..4ed4a8f0b 100644
--- a/tools/vgmerge.c
+++ b/tools/vgmerge.c
@@ -72,7 +72,8 @@ static int _vgmerge_single(struct cmd_context *cmd, const char *vg_name_to,
return ECMD_FAILED;
}
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd))
+ return_ECMD_FAILED;
if (strcmp(vg_name_to, vg_name_from) > 0)
lock_vg_from_first = 1;
diff --git a/tools/vgsplit.c b/tools/vgsplit.c
index 5f113b363..c7f4b8af4 100644
--- a/tools/vgsplit.c
+++ b/tools/vgsplit.c
@@ -559,7 +559,8 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
return ECMD_FAILED;
}
- lvmcache_label_scan(cmd);
+ if (!lvmcache_label_scan(cmd))
+ return_ECMD_FAILED;
if (!(vginfo_to = lvmcache_vginfo_from_vgname(vg_name_to, NULL))) {
if (!validate_name(vg_name_to)) {
1 year, 9 months