main - lvchange: handle unrecognized writecache setting
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9ce55a43d0165da9827...
Commit: 9ce55a43d0165da9827e7b8e75bf25583a571e89
Parent: 6613a61d3b5ce4d12a6fef79195eac34f30ef4da
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Dec 8 15:48:30 2022 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Dec 8 15:48:30 2022 -0600
lvchange: handle unrecognized writecache setting
It was being ignored.
---
tools/lvchange.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 34c9e36fd..dfbefa000 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -665,6 +665,11 @@ static int _lvchange_writecache(struct cmd_context *cmd,
seg->writecache_settings.max_age = settings.max_age;
set_count++;
}
+ if (settings.new_key && settings.new_val) {
+ seg->writecache_settings.new_key = settings.new_key;
+ seg->writecache_settings.new_val = settings.new_val;
+ set_count++;
+ }
if (!set_count) {
/*
1 year, 3 months
rhel-8.8.0 - vdo: report supported range in error path
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=cce56ebaa6b67d53b04...
Commit: cce56ebaa6b67d53b0430d5b52b957e194c9527d
Parent: b16082b05639d4321cbf699d3309fe24a8bc71fa
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Jul 9 21:28:40 2022 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Thu Dec 8 15:25:33 2022 +0100
vdo: report supported range in error path
(cherry picked from commit 9f3eff002cc229d3c22dfd7db6da69dadc0bd460)
---
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, 3 months
rhel-8.8.0 - vdo: use defines also for configuration defines
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b16082b05639d4321cb...
Commit: b16082b05639d4321cbf699d3309fe24a8bc71fa
Parent: d0b5614d43ac41ee24a480a6272f256b1a242873
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 24 15:54:08 2022 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Thu Dec 8 15:25:22 2022 +0100
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').
(cherry picked from commit b5c8e591ed9ee30b67e79d60705d3c0bb8509a2a)
---
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 a78ed7333..897622b9d 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 d280e7adb..2c91e8bb6 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, 3 months
rhel-8.8.0 - vdo: use single validator
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d0b5614d43ac41ee24a...
Commit: d0b5614d43ac41ee24a480a6272f256b1a242873
Parent: 71354c39350b482ca8cf0fd9dcaf025b1d55b7d1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jul 4 16:08:30 2022 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Thu Dec 8 15:25:12 2022 +0100
vdo: use single validator
Add era lenght validation into dm_vdo_validate_target_params()
and reuse this validator also for _check_lv_segment().
(cherry picked from commit 8ca2b1bc213188037ecedfbf76de53de871c7f5b)
---
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, 3 months
rhel-8.8.0 - make: generate
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=71354c39350b482ca8c...
Commit: 71354c39350b482ca8cf0fd9dcaf025b1d55b7d1
Parent: b56e8fc94d4d2b6d384148e3f74c54f4e1d816e6
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Thu Dec 8 14:32:23 2022 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Thu Dec 8 14:32:23 2022 +0100
make: generate
---
man/lvchange.8_pregen | 20 ++++++++++++++++++--
man/lvconvert.8_pregen | 22 ++++++++++++++++++++--
man/lvcreate.8_pregen | 24 ++++++++++++++++++++++--
man/lvdisplay.8_pregen | 5 +++--
man/lvextend.8_pregen | 5 +++--
man/lvm-fullreport.8_pregen | 5 +++--
man/lvm-lvpoll.8_pregen | 5 +++--
man/lvmconfig.8_pregen | 5 +++--
man/lvmdevices.8_pregen | 8 +++++---
man/lvmdiskscan.8_pregen | 5 +++--
man/lvreduce.8_pregen | 5 +++--
man/lvremove.8_pregen | 5 +++--
man/lvrename.8_pregen | 5 +++--
man/lvresize.8_pregen | 5 +++--
man/lvs.8_pregen | 5 +++--
man/lvscan.8_pregen | 5 +++--
man/pvchange.8_pregen | 5 +++--
man/pvck.8_pregen | 5 +++--
man/pvcreate.8_pregen | 5 +++--
man/pvdisplay.8_pregen | 5 +++--
man/pvmove.8_pregen | 5 +++--
man/pvremove.8_pregen | 5 +++--
man/pvresize.8_pregen | 5 +++--
man/pvs.8_pregen | 5 +++--
man/pvscan.8_pregen | 5 +++--
man/vgcfgbackup.8_pregen | 5 +++--
man/vgcfgrestore.8_pregen | 5 +++--
man/vgchange.8_pregen | 5 +++--
man/vgck.8_pregen | 5 +++--
man/vgconvert.8_pregen | 5 +++--
man/vgcreate.8_pregen | 5 +++--
man/vgdisplay.8_pregen | 5 +++--
man/vgexport.8_pregen | 5 +++--
man/vgextend.8_pregen | 5 +++--
man/vgimport.8_pregen | 5 +++--
man/vgimportclone.8_pregen | 5 +++--
man/vgimportdevices.8_pregen | 5 +++--
man/vgmerge.8_pregen | 5 +++--
man/vgmknodes.8_pregen | 5 +++--
man/vgreduce.8_pregen | 5 +++--
man/vgremove.8_pregen | 5 +++--
man/vgrename.8_pregen | 5 +++--
man/vgs.8_pregen | 5 +++--
man/vgscan.8_pregen | 5 +++--
man/vgsplit.8_pregen | 5 +++--
45 files changed, 188 insertions(+), 91 deletions(-)
diff --git a/man/lvchange.8_pregen b/man/lvchange.8_pregen
index b559c89c9..27bee0f14 100644
--- a/man/lvchange.8_pregen
+++ b/man/lvchange.8_pregen
@@ -126,6 +126,8 @@ lvchange \(em Change the attributes of logical volume(s)
\fB--sysinit\fP
.br
\fB-t\fP|\fB--test\fP
+.br
+ \fB--vdosettings\fP \fIString\fP
.br
\fB-v\fP|\fB--verbose\fP
.br
@@ -202,6 +204,8 @@ required, after which the others are optional.
\fB--\fP[\fBraid\fP]\fBminrecoveryrate\fP \fISize\fP[k|UNIT]
.br
\fB--\fP[\fBraid\fP]\fBmaxrecoveryrate\fP \fISize\fP[k|UNIT]
+.br
+ \fB--vdosettings\fP \fIString\fP
.br
\fB--\fP[\fBraid\fP]\fBwritebehind\fP \fINumber\fP
.br
@@ -609,8 +613,9 @@ See \fBlvm.conf\fP(5) for more information about profiles.
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
@@ -927,6 +932,17 @@ error messages in multi-stage operations if a tool relies on reading
back metadata it believes has changed but hasn't.
.
.HP
+\fB--vdosettings\fP \fIString\fP
+.br
+Specifies tunable VDO options for VDO LVs.
+Use the form 'option=value' or 'option1=value option2=value', or
+repeat --vdosettings for each option being set.
+These settings override the default VDO behaviors.
+To remove vdosettings and revert to the default
+VDO behaviors, use --vdosettings 'default'.
+See \fBlvmvdo\fP(7) for more information.
+.
+.HP
\fB-v\fP|\fB--verbose\fP ...
.br
Set verbose level. Repeat from 1 to 4 times to increase the detail
diff --git a/man/lvconvert.8_pregen b/man/lvconvert.8_pregen
index 679519303..fa52da55c 100644
--- a/man/lvconvert.8_pregen
+++ b/man/lvconvert.8_pregen
@@ -155,6 +155,8 @@ lvconvert \(em Change logical volume layout
\fB--usepolicies\fP
.br
\fB--vdopool\fP \fILV\fP
+.br
+ \fB--vdosettings\fP \fIString\fP
.br
\fB-v\fP|\fB--verbose\fP
.br
@@ -742,6 +744,8 @@ Convert LV to type vdopool.
.br
[ \fB--deduplication\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--vdosettings\fP \fIString\fP ]
+.br
[ COMMON_OPTIONS ]
.ad b
.RE
@@ -1131,8 +1135,9 @@ See \fBlvmvdo\fP(7) for more information about VDO usage.
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
@@ -1535,6 +1540,17 @@ The name of a VDO pool LV.
See \fBlvmvdo\fP(7) for more information about VDO usage.
.
.HP
+\fB--vdosettings\fP \fIString\fP
+.br
+Specifies tunable VDO options for VDO LVs.
+Use the form 'option=value' or 'option1=value option2=value', or
+repeat --vdosettings for each option being set.
+These settings override the default VDO behaviors.
+To remove vdosettings and revert to the default
+VDO behaviors, use --vdosettings 'default'.
+See \fBlvmvdo\fP(7) for more information.
+.
+.HP
\fB-v\fP|\fB--verbose\fP ...
.br
Set verbose level. Repeat from 1 to 4 times to increase the detail
@@ -1808,6 +1824,8 @@ Convert LV to type vdopool.
.br
[ \fB--deduplication\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--vdosettings\fP \fIString\fP ]
+.br
[ COMMON_OPTIONS ]
.ad b
.RE
diff --git a/man/lvcreate.8_pregen b/man/lvcreate.8_pregen
index 2cccbbe56..0ffe92a94 100644
--- a/man/lvcreate.8_pregen
+++ b/man/lvcreate.8_pregen
@@ -157,6 +157,8 @@ lvcreate \(em Create a logical volume
\fB--vdo\fP
.br
\fB--vdopool\fP \fILV\fP
+.br
+ \fB--vdosettings\fP \fIString\fP
.br
\fB-v\fP|\fB--verbose\fP
.br
@@ -537,6 +539,8 @@ Create a LV that returns VDO when used.
.br
[ \fB--deduplication\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--vdosettings\fP \fIString\fP ]
+.br
[ COMMON_OPTIONS ]
.ad b
.RE
@@ -1003,8 +1007,9 @@ See \fBlvmvdo\fP(7) for more information about VDO usage.
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
@@ -1438,6 +1443,17 @@ The name of a VDO pool LV.
See \fBlvmvdo\fP(7) for more information about VDO usage.
.
.HP
+\fB--vdosettings\fP \fIString\fP
+.br
+Specifies tunable VDO options for VDO LVs.
+Use the form 'option=value' or 'option1=value option2=value', or
+repeat --vdosettings for each option being set.
+These settings override the default VDO behaviors.
+To remove vdosettings and revert to the default
+VDO behaviors, use --vdosettings 'default'.
+See \fBlvmvdo\fP(7) for more information.
+.
+.HP
\fB-v\fP|\fB--verbose\fP ...
.br
Set verbose level. Repeat from 1 to 4 times to increase the detail
@@ -1966,6 +1982,8 @@ Create a VDO LV with VDO pool.
.br
[ \fB--deduplication\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--vdosettings\fP \fIString\fP ]
+.br
[ COMMON_OPTIONS ]
.ad b
.RE
@@ -1996,6 +2014,8 @@ Create a VDO LV with VDO pool.
.br
[ \fB--deduplication\fP \fBy\fP|\fBn\fP ]
.br
+[ \fB--vdosettings\fP \fIString\fP ]
+.br
[ COMMON_OPTIONS ]
.ad b
.RE
diff --git a/man/lvdisplay.8_pregen b/man/lvdisplay.8_pregen
index 04aab4c09..387a7d30d 100644
--- a/man/lvdisplay.8_pregen
+++ b/man/lvdisplay.8_pregen
@@ -186,8 +186,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/lvextend.8_pregen b/man/lvextend.8_pregen
index be6992e94..8a3e1ea4e 100644
--- a/man/lvextend.8_pregen
+++ b/man/lvextend.8_pregen
@@ -328,8 +328,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/lvm-fullreport.8_pregen b/man/lvm-fullreport.8_pregen
index 02b38ef40..edae0efe3 100644
--- a/man/lvm-fullreport.8_pregen
+++ b/man/lvm-fullreport.8_pregen
@@ -169,8 +169,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/lvm-lvpoll.8_pregen b/man/lvm-lvpoll.8_pregen
index 7f45f6eb3..fa8027f8e 100644
--- a/man/lvm-lvpoll.8_pregen
+++ b/man/lvm-lvpoll.8_pregen
@@ -115,8 +115,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/lvmconfig.8_pregen b/man/lvmconfig.8_pregen
index 51946e1ec..e6762f989 100644
--- a/man/lvmconfig.8_pregen
+++ b/man/lvmconfig.8_pregen
@@ -156,8 +156,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/lvmdevices.8_pregen b/man/lvmdevices.8_pregen
index d64c3a31a..a2397e50f 100644
--- a/man/lvmdevices.8_pregen
+++ b/man/lvmdevices.8_pregen
@@ -322,7 +322,8 @@ Find a device with the PVID and add the device to the devices file.
.HP
\fB--check\fP
.br
-Check the content of the devices file.
+Checks the content of the devices file.
+Reports incorrect device names or PVIDs for entries.
.
.HP
\fB--commandprofile\fP \fIString\fP
@@ -364,8 +365,9 @@ then it will override the default type that lvm would use.
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/lvmdiskscan.8_pregen b/man/lvmdiskscan.8_pregen
index 7fd3d941d..ac0931c88 100644
--- a/man/lvmdiskscan.8_pregen
+++ b/man/lvmdiskscan.8_pregen
@@ -102,8 +102,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/lvreduce.8_pregen b/man/lvreduce.8_pregen
index ea960eb53..cd2e38e5b 100644
--- a/man/lvreduce.8_pregen
+++ b/man/lvreduce.8_pregen
@@ -130,8 +130,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/lvremove.8_pregen b/man/lvremove.8_pregen
index 2bd7997a3..8a4afbdff 100644
--- a/man/lvremove.8_pregen
+++ b/man/lvremove.8_pregen
@@ -136,8 +136,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/lvrename.8_pregen b/man/lvrename.8_pregen
index d41a4c241..27ce2caeb 100644
--- a/man/lvrename.8_pregen
+++ b/man/lvrename.8_pregen
@@ -120,8 +120,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/lvresize.8_pregen b/man/lvresize.8_pregen
index f3ea2536c..10e7dda7c 100644
--- a/man/lvresize.8_pregen
+++ b/man/lvresize.8_pregen
@@ -286,8 +286,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/lvs.8_pregen b/man/lvs.8_pregen
index 2b2c5f193..94a74f9dd 100644
--- a/man/lvs.8_pregen
+++ b/man/lvs.8_pregen
@@ -172,8 +172,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/lvscan.8_pregen b/man/lvscan.8_pregen
index f459ab35b..8d79f22dd 100644
--- a/man/lvscan.8_pregen
+++ b/man/lvscan.8_pregen
@@ -119,8 +119,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/pvchange.8_pregen b/man/pvchange.8_pregen
index 4add9ca69..010845274 100644
--- a/man/pvchange.8_pregen
+++ b/man/pvchange.8_pregen
@@ -179,8 +179,9 @@ multiple tags at once. See \fBlvm\fP(8) for information about tags.
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/pvck.8_pregen b/man/pvck.8_pregen
index 88200f21e..7d6652342 100644
--- a/man/pvck.8_pregen
+++ b/man/pvck.8_pregen
@@ -351,8 +351,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/pvcreate.8_pregen b/man/pvcreate.8_pregen
index a74a5ec2a..6ffd596fe 100644
--- a/man/pvcreate.8_pregen
+++ b/man/pvcreate.8_pregen
@@ -229,8 +229,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/pvdisplay.8_pregen b/man/pvdisplay.8_pregen
index 2f26a8727..59628bedd 100644
--- a/man/pvdisplay.8_pregen
+++ b/man/pvdisplay.8_pregen
@@ -183,8 +183,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/pvmove.8_pregen b/man/pvmove.8_pregen
index 0f70497a2..f633b97d2 100644
--- a/man/pvmove.8_pregen
+++ b/man/pvmove.8_pregen
@@ -206,8 +206,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/pvremove.8_pregen b/man/pvremove.8_pregen
index 3d4a86c09..51c589fd7 100644
--- a/man/pvremove.8_pregen
+++ b/man/pvremove.8_pregen
@@ -103,8 +103,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/pvresize.8_pregen b/man/pvresize.8_pregen
index 87d87c8ce..9ce57e325 100644
--- a/man/pvresize.8_pregen
+++ b/man/pvresize.8_pregen
@@ -98,8 +98,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/pvs.8_pregen b/man/pvs.8_pregen
index 32c28e4d1..955b3f887 100644
--- a/man/pvs.8_pregen
+++ b/man/pvs.8_pregen
@@ -169,8 +169,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/pvscan.8_pregen b/man/pvscan.8_pregen
index 1c96d5aab..1e1cc11ab 100644
--- a/man/pvscan.8_pregen
+++ b/man/pvscan.8_pregen
@@ -369,8 +369,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgcfgbackup.8_pregen b/man/vgcfgbackup.8_pregen
index 5e658093a..cf984b04b 100644
--- a/man/vgcfgbackup.8_pregen
+++ b/man/vgcfgbackup.8_pregen
@@ -123,8 +123,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgcfgrestore.8_pregen b/man/vgcfgrestore.8_pregen
index 695e05582..6165cd36e 100644
--- a/man/vgcfgrestore.8_pregen
+++ b/man/vgcfgrestore.8_pregen
@@ -208,8 +208,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgchange.8_pregen b/man/vgchange.8_pregen
index 05c67aead..7c7030c0d 100644
--- a/man/vgchange.8_pregen
+++ b/man/vgchange.8_pregen
@@ -556,8 +556,9 @@ See \fBlvm.conf\fP(5) for more information about profiles.
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgck.8_pregen b/man/vgck.8_pregen
index a8fa33f4b..cfb828ff9 100644
--- a/man/vgck.8_pregen
+++ b/man/vgck.8_pregen
@@ -114,8 +114,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgconvert.8_pregen b/man/vgconvert.8_pregen
index 4d54c2b27..b99de39b8 100644
--- a/man/vgconvert.8_pregen
+++ b/man/vgconvert.8_pregen
@@ -124,8 +124,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgcreate.8_pregen b/man/vgcreate.8_pregen
index 9bb8d3868..d5316aa1c 100644
--- a/man/vgcreate.8_pregen
+++ b/man/vgcreate.8_pregen
@@ -206,8 +206,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgdisplay.8_pregen b/man/vgdisplay.8_pregen
index 0a12b3c39..b6cd294d5 100644
--- a/man/vgdisplay.8_pregen
+++ b/man/vgdisplay.8_pregen
@@ -180,8 +180,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgexport.8_pregen b/man/vgexport.8_pregen
index a87058946..6af64b82a 100644
--- a/man/vgexport.8_pregen
+++ b/man/vgexport.8_pregen
@@ -139,8 +139,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgextend.8_pregen b/man/vgextend.8_pregen
index 2b2650527..e55e0a110 100644
--- a/man/vgextend.8_pregen
+++ b/man/vgextend.8_pregen
@@ -147,8 +147,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgimport.8_pregen b/man/vgimport.8_pregen
index 5cd8fab84..9f8614205 100644
--- a/man/vgimport.8_pregen
+++ b/man/vgimport.8_pregen
@@ -128,8 +128,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgimportclone.8_pregen b/man/vgimportclone.8_pregen
index bf0af5841..80da5454b 100644
--- a/man/vgimportclone.8_pregen
+++ b/man/vgimportclone.8_pregen
@@ -113,8 +113,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgimportdevices.8_pregen b/man/vgimportdevices.8_pregen
index 5897e29ad..44e5fc663 100644
--- a/man/vgimportdevices.8_pregen
+++ b/man/vgimportdevices.8_pregen
@@ -132,8 +132,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgmerge.8_pregen b/man/vgmerge.8_pregen
index a36e0c7bd..dfe8e2f0f 100644
--- a/man/vgmerge.8_pregen
+++ b/man/vgmerge.8_pregen
@@ -107,8 +107,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgmknodes.8_pregen b/man/vgmknodes.8_pregen
index 0a03e1582..d7cd722a4 100644
--- a/man/vgmknodes.8_pregen
+++ b/man/vgmknodes.8_pregen
@@ -108,8 +108,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgreduce.8_pregen b/man/vgreduce.8_pregen
index f3178a618..63b0a20f3 100644
--- a/man/vgreduce.8_pregen
+++ b/man/vgreduce.8_pregen
@@ -199,8 +199,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgremove.8_pregen b/man/vgremove.8_pregen
index 779c0f13e..661ada673 100644
--- a/man/vgremove.8_pregen
+++ b/man/vgremove.8_pregen
@@ -109,8 +109,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgrename.8_pregen b/man/vgrename.8_pregen
index d3e776ca4..2b849d180 100644
--- a/man/vgrename.8_pregen
+++ b/man/vgrename.8_pregen
@@ -133,8 +133,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgs.8_pregen b/man/vgs.8_pregen
index ee5083a93..2ca98b0b0 100644
--- a/man/vgs.8_pregen
+++ b/man/vgs.8_pregen
@@ -166,8 +166,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgscan.8_pregen b/man/vgscan.8_pregen
index 824e7f673..a8da70d99 100644
--- a/man/vgscan.8_pregen
+++ b/man/vgscan.8_pregen
@@ -101,8 +101,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
diff --git a/man/vgsplit.8_pregen b/man/vgsplit.8_pregen
index 065c8b52a..99938a4e3 100644
--- a/man/vgsplit.8_pregen
+++ b/man/vgsplit.8_pregen
@@ -175,8 +175,9 @@ messages sent to the log file and/or syslog (if configured).
.HP
\fB--devices\fP \fIPV\fP
.br
-Devices that the command can use. This option can be repeated
-or accepts a comma separated list of devices. This overrides
+Restricts the devices that are visible and accessible to the command.
+Devices not listed will appear to be missing. This option can be
+repeated, or accepts a comma separated list of devices. This overrides
the devices file.
.
.HP
1 year, 3 months
rhel-8.8.0 - thin: fix message processing on thin-pool extension
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7db3a53d8a3aa740133...
Commit: 7db3a53d8a3aa7401337fb9aaf00f19cf4407e70
Parent: 0b9d9963b8f15a6f12a0149a62809fa9b846c5c5
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 30 14:16:11 2022 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Tue Nov 29 14:09:25 2022 +0100
thin: fix message processing on thin-pool extension
When thin-pool had queued some delete message on extension operation
such message has been 'lost' and thin-pool kernel metadata has been
left with a thin volume that no longer existed for lvm2 metadata.
(cherry picked from commit 09371131469f7398c597a5fb30dc565859253cc2)
---
WHATS_NEW | 4 ++
lib/metadata/lv_manip.c | 2 +-
test/shell/lvextend-thin-adddel.sh | 78 ++++++++++++++++++++++++++++++++++++++
3 files changed, 83 insertions(+), 1 deletion(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index e626802ec..bffd24648 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -2,6 +2,10 @@ Version 2.03.17 -
===============================
Fix lvconvert --test --type vdo-pool execution.
+Version 2.03.16 -
+====================================
+ Fix lossing of delete message on thin-pool extension.
+
Version 2.03.14 - 20th October 2021
===================================
Device scanning is skipping directories on different filesystems.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 003748d6f..9523e3e66 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6179,7 +6179,7 @@ int lv_resize(struct logical_volume *lv,
if (lv_is_thin_pool(lock_lv)) {
/* Update lvm pool metadata (drop messages). */
- if (!update_pool_lv(lock_lv, 0))
+ if (!update_pool_lv(lock_lv, 1))
goto_bad;
}
diff --git a/test/shell/lvextend-thin-adddel.sh b/test/shell/lvextend-thin-adddel.sh
new file mode 100644
index 000000000..59b1bfa41
--- /dev/null
+++ b/test/shell/lvextend-thin-adddel.sh
@@ -0,0 +1,78 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2022 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+#
+# Play with thin-pool and thin removal and creation in corner cases
+#
+
+SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
+
+export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
+
+. lib/inittest
+
+aux have_thin 1 0 0 || skip
+
+test -n "$LVM_TEST_THIN_RESTORE_CMD" || LVM_TEST_THIN_RESTORE_CMD=$(which thin_restore) || skip
+"$LVM_TEST_THIN_RESTORE_CMD" -V || skip
+
+aux have_thin 1 10 0 || skip
+
+aux prepare_vg 2
+
+lvcreate -V10 -n $lv1 -L10 -T $vg/pool
+lvcreate -V10 -n $lv2 $vg/pool
+
+# Forcibly 'error' _tmeta thin-pool metadata device
+not dmsetup remove -f $vg-pool_tmeta
+
+# Now try to schedule removal of thin volume id 1
+# that will fail with errored meta device
+not lvremove -y $vg/$lv1
+
+# Check we have queued 'message'
+vgcfgbackup -f out0 $vg
+grep "message1" out0
+
+vgchange -an $vg || true
+
+not dmsetup table ${vg}-pool-tpool
+
+# Reactivate thin-pool
+vgchange -ay $vg
+
+# Check message is still queued there
+vgcfgbackup -f out1 $vg
+grep "message1" out1
+
+lvchange -an $vg
+
+lvextend -L+10 $vg/pool
+
+# Messages should be now processed and gone
+vgcfgbackup -f out2 $vg
+not grep "message1" out2
+
+lvchange -an $vg
+
+lvchange -y -ay $vg/pool_tmeta
+
+# Kernel metadata must not see dev_id 1 either
+thin_dump $DM_DEV_DIR/$vg/pool_tmeta | tee meta
+not grep 'dev_id="1"' meta
+
+lvremove -ff $vg
+
+lvs -a $vg
+
+vgremove -ff $vg
1 year, 3 months
rhel-8.8.0 - vdo: fix --vdosettings parser
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b56e8fc94d4d2b6d384...
Commit: b56e8fc94d4d2b6d384148e3f74c54f4e1d816e6
Parent: 7db3a53d8a3aa7401337fb9aaf00f19cf4407e70
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Aug 15 13:14:03 2022 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Thu Dec 8 12:34:22 2022 +0100
vdo: fix --vdosettings parser
Parser was incorrectly parsing vdo_use_features - move the skip
of 'use_' prefix into internal loop which handles skipping of '_'.
(cherry picked from commit bba96e8680ef7fa567d6361c269c0bfc05ce3d2c)
---
tools/toollib.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 210b3dca5..d9a1a92ec 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1198,13 +1198,11 @@ out:
*/
static int _compare_vdo_option(const char *b1, const char *b2)
{
+ int use_skipped = 0;
+
if (strncasecmp(b1, "vdo", 3) == 0) // skip vdo prefix
b1 += 3;
- if ((tolower(*b1) != tolower(*b2)) &&
- (strncmp(b2, "use_", 4) == 0))
- b2 += 4; // try again with skipped prefix 'use_'
-
while (*b1 && *b2) {
if (tolower(*b1) == tolower(*b2)) {
++b1;
@@ -1216,8 +1214,14 @@ static int _compare_vdo_option(const char *b1, const char *b2)
++b1; // skip to next char
else if (*b2 == '_')
++b2; // skip to next char
- else
+ else {
+ if (!use_skipped++ && (strncmp(b2, "use_", 4) == 0)) {
+ b2 += 4; // try again with skipped prefix 'use_'
+ continue;
+ }
+
break; // mismatch
+ }
}
return (*b1 || *b2) ? 0 : 1;
1 year, 3 months
rhel-8.8.0 - vgimportdevices: change result when devices are not added
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f1d8c01dff3f8839355...
Commit: f1d8c01dff3f8839355004e5fd77e9cd521e26cb
Parent: 0aa45120e92fe8b0f379d00f3a031e3c53feca43
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Aug 29 15:17:36 2022 -0500
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Mon Nov 28 17:11:21 2022 +0100
vgimportdevices: change result when devices are not added
When using --all, if one VG is skipped, continue adding
other VGs, and do not return an error from the command
if some VGs are added. (A VG is skipped if it's missing PVs.)
If the command fails during devices file setup or device
scanning, then remove the devices file if it has been
newly created by the command, and exit with an error.
If devices from a named VG are not imported (e.g. the
VG is missing devices), then remove the devices file if
it has been newly created by the command, and exit with
an error.
If --all VGs are being imported, and no devices are found
to include in the devices file, then remove the devices
file if it has been newly created by the command, and
exit with an error.
---
test/shell/vgimportdevices.sh | 308 ++++++++++++++++++++++++++++++++++++++++++
tools/vgimportdevices.c | 41 ++++--
2 files changed, 336 insertions(+), 13 deletions(-)
diff --git a/test/shell/vgimportdevices.sh b/test/shell/vgimportdevices.sh
new file mode 100644
index 000000000..47363cec3
--- /dev/null
+++ b/test/shell/vgimportdevices.sh
@@ -0,0 +1,308 @@
+
+#!/usr/bin/env bash
+
+# Copyright (C) 2020 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+test_description='vgimportdevices'
+
+. lib/inittest
+
+aux prepare_devs 5
+
+DFDIR="$LVM_SYSTEM_DIR/devices"
+mkdir "$DFDIR" || true
+DF="$DFDIR/system.devices"
+
+aux lvmconf 'devices/use_devicesfile = 1'
+
+not ls "$DF"
+pvcreate "$dev1"
+ls "$DF"
+grep "$dev1" "$DF"
+rm -f "$DF"
+dd if=/dev/zero of="$dev1" bs=1M count=1
+
+#
+# vgimportdevices -a with no prev df
+#
+
+# no devs found
+not vgimportdevices -a
+not ls "$DF"
+
+# one orphan pv, no vgs
+pvcreate "$dev1"
+rm -f "$DF"
+not vgimportdevices -a
+not ls "$DF"
+
+# one complete vg
+vgcreate $vg1 "$dev1"
+rm -f "$DF"
+vgimportdevices -a
+ls "$DF"
+grep "$dev1" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+rm -f "$DF"
+
+# two complete vgs
+vgcreate $vg1 "$dev1"
+vgcreate $vg2 "$dev2"
+rm -f "$DF"
+vgimportdevices -a
+ls "$DF"
+grep "$dev1" "$DF"
+grep "$dev2" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+rm -f "$DF"
+
+# one incomplete vg
+vgcreate $vg1 "$dev1" "$dev2"
+lvcreate -l1 -an $vg1
+rm -f "$DF"
+dd if=/dev/zero of="$dev1" bs=1M count=1
+not vgimportdevices -a
+not ls "$DF"
+vgs $vg1
+pvs "$dev2"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+rm -f "$DF"
+
+# three complete, one incomplete vg
+vgcreate $vg1 "$dev1"
+vgcreate $vg2 "$dev2"
+vgcreate $vg3 "$dev3"
+vgcreate $vg4 "$dev4" "$dev5"
+rm -f "$DF"
+dd if=/dev/zero of="$dev5" bs=1M count=1
+vgimportdevices -a
+ls "$DF"
+grep "$dev1" "$DF"
+grep "$dev2" "$DF"
+grep "$dev3" "$DF"
+not grep "$dev4" "$DF"
+not grep "$dev5" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+dd if=/dev/zero of="$dev3" bs=1M count=1
+dd if=/dev/zero of="$dev4" bs=1M count=1
+rm -f "$DF"
+
+
+#
+# vgimportdevices -a with existing df
+#
+
+# no devs found
+vgcreate $vg1 "$dev1"
+grep "$dev1" "$DF"
+dd if=/dev/zero of="$dev1" bs=1M count=1
+not vgimportdevices -a
+ls "$DF"
+
+# one complete vg
+vgcreate $vg1 "$dev1"
+vgimportdevices -a
+grep "$dev1" "$DF"
+vgcreate --devicesfile "" $vg2 "$dev2"
+not grep "$dev2" "$DF"
+vgimportdevices -a
+grep "$dev1" "$DF"
+grep "$dev2" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+rm -f "$DF"
+
+# two complete vgs
+vgcreate --devicesfile "" $vg1 "$dev1"
+vgcreate --devicesfile "" $vg2 "$dev2"
+rm -f "$DF"
+vgimportdevices -a
+ls "$DF"
+grep "$dev1" "$DF"
+grep "$dev2" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+rm -f "$DF"
+
+# one incomplete vg
+vgcreate $vg1 "$dev1"
+vgimportdevices -a
+grep "$dev1" "$DF"
+dd if=/dev/zero of="$dev1" bs=1M count=1
+vgcreate --devicesfile "" $vg2 "$dev2" "$dev3"
+not grep "$dev2" "$DF"
+not grep "$dev3" "$DF"
+dd if=/dev/zero of="$dev2" bs=1M count=1
+not vgimportdevices -a
+ls "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+dd if=/dev/zero of="$dev3" bs=1M count=1
+rm -f "$DF"
+
+# import the same vg again
+vgcreate --devicesfile "" $vg1 "$dev1"
+not ls "$DF"
+vgimportdevices -a
+ls "$DF"
+grep "$dev1" "$DF"
+vgimportdevices -a
+ls "$DF"
+grep "$dev1" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+rm -f "$DF"
+
+# import a series of vgs
+vgcreate --devicesfile "" $vg1 "$dev1"
+vgimportdevices -a
+grep "$dev1" "$DF"
+vgcreate --devicesfile "" $vg2 "$dev2"
+vgimportdevices -a
+grep "$dev1" "$DF"
+grep "$dev2" "$DF"
+vgcreate --devicesfile "" $vg3 "$dev3"
+vgimportdevices -a
+grep "$dev1" "$DF"
+grep "$dev2" "$DF"
+grep "$dev3" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+dd if=/dev/zero of="$dev3" bs=1M count=1
+rm -f "$DF"
+
+#
+# vgimportdevices vg with no prev df
+#
+
+# no devs found
+not vgimportdevices $vg1
+not ls "$DF"
+
+# one complete vg
+vgcreate $vg1 "$dev1"
+rm -f "$DF"
+vgimportdevices $vg1
+ls "$DF"
+grep "$dev1" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+rm -f "$DF"
+
+# two complete vgs
+vgcreate $vg1 "$dev1"
+vgcreate $vg2 "$dev2"
+rm -f "$DF"
+vgimportdevices $vg1
+ls "$DF"
+grep "$dev1" "$DF"
+vgimportdevices $vg2
+ls "$DF"
+grep "$dev2" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+rm -f "$DF"
+
+# one incomplete vg
+vgcreate $vg1 "$dev1" "$dev2"
+lvcreate -l1 -an $vg1
+rm -f "$DF"
+dd if=/dev/zero of="$dev1" bs=1M count=1
+not vgimportdevices $vg1
+not ls "$DF"
+vgs $vg1
+pvs "$dev2"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+rm -f "$DF"
+
+# three complete, one incomplete vg
+vgcreate $vg1 "$dev1"
+vgcreate $vg2 "$dev2"
+vgcreate $vg3 "$dev3"
+vgcreate $vg4 "$dev4" "$dev5"
+rm -f "$DF"
+dd if=/dev/zero of="$dev5" bs=1M count=1
+not vgimportdevices $vg4
+not ls "$DF"
+vgimportdevices $vg3
+ls "$DF"
+grep "$dev3" "$DF"
+not grep "$dev1" "$DF"
+not grep "$dev2" "$DF"
+not grep "$dev4" "$DF"
+not grep "$dev5" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+dd if=/dev/zero of="$dev3" bs=1M count=1
+dd if=/dev/zero of="$dev4" bs=1M count=1
+rm -f "$DF"
+
+#
+# vgimportdevices vg with existing df
+#
+
+# vg not found
+vgcreate $vg1 "$dev1"
+vgimportdevices -a
+grep "$dev1" "$DF"
+not vgimportdevices $vg2
+grep "$dev1" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+rm -f "$DF"
+
+# vg incomplete
+vgcreate $vg1 "$dev1"
+vgimportdevices -a
+grep "$dev1" "$DF"
+vgcreate --devicesfile "" $vg2 "$dev2" "$dev3"
+dd if=/dev/zero of="$dev2" bs=1M count=1
+not vgimportdevices $vg2
+grep "$dev1" "$DF"
+not grep "$dev2" "$DF"
+not grep "$dev3" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+dd if=/dev/zero of="$dev3" bs=1M count=1
+dd if=/dev/zero of="$dev4" bs=1M count=1
+rm -f "$DF"
+
diff --git a/tools/vgimportdevices.c b/tools/vgimportdevices.c
index ea205d941..9ade1b9e4 100644
--- a/tools/vgimportdevices.c
+++ b/tools/vgimportdevices.c
@@ -36,9 +36,9 @@ static int _vgimportdevices_single(struct cmd_context *cmd,
dm_list_iterate_items(pvl, &vg->pvs) {
if (is_missing_pv(pvl->pv) || !pvl->pv->dev) {
memcpy(pvid, &pvl->pv->id.uuid, ID_LEN);
- log_error("Not importing devices for VG %s with missing PV %s.",
- vg->name, pvid);
- goto bad;
+ log_print("Not importing devices for VG %s with missing PV %s.",
+ vg->name, pvid);
+ return ECMD_PROCESSED;
}
}
@@ -71,14 +71,17 @@ static int _vgimportdevices_single(struct cmd_context *cmd,
updated_pvs++;
}
+ /*
+ * Writes the device_id of each PV into the vg metadata.
+ * This is not a critial step and should not influence
+ * the result of the command.
+ */
if (updated_pvs) {
if (!vg_write(vg) || !vg_commit(vg))
- goto_bad;
+ log_print("Failed to write device ids in VG metadata.");
}
return ECMD_PROCESSED;
-bad:
- return ECMD_FAILED;
}
/*
@@ -114,6 +117,7 @@ int vgimportdevices(struct cmd_context *cmd, int argc, char **argv)
{
struct vgimportdevices_params vp = { 0 };
struct processing_handle *handle;
+ int created_file = 0;
int ret = ECMD_FAILED;
if (arg_is_set(cmd, foreign_ARG))
@@ -139,9 +143,12 @@ int vgimportdevices(struct cmd_context *cmd, int argc, char **argv)
log_error("Devices file not enabled.");
return ECMD_FAILED;
}
- if (!devices_file_exists(cmd) && !devices_file_touch(cmd)) {
- log_error("Failed to create devices file.");
- return ECMD_FAILED;
+ if (!devices_file_exists(cmd)) {
+ if (!devices_file_touch(cmd)) {
+ log_error("Failed to create devices file.");
+ return ECMD_FAILED;
+ }
+ created_file = 1;
}
/*
@@ -195,22 +202,30 @@ int vgimportdevices(struct cmd_context *cmd, int argc, char **argv)
*/
ret = process_each_vg(cmd, argc, argv, NULL, NULL, READ_FOR_UPDATE,
0, handle, _vgimportdevices_single);
- if (ret == ECMD_FAILED)
- goto out;
+ if (ret == ECMD_FAILED) {
+ /*
+ * Error from setting up devices file or label_scan,
+ * _vgimportdevices_single does not return an error.
+ */
+ goto_out;
+ }
if (!vp.added_devices) {
- log_print("No devices to add.");
+ log_error("No devices to add.");
+ ret = ECMD_FAILED;
goto out;
}
if (!device_ids_write(cmd)) {
- log_print("Failed to update devices file.");
+ log_error("Failed to write the devices file.");
ret = ECMD_FAILED;
goto out;
}
log_print("Added %u devices to devices file.", vp.added_devices);
out:
+ if ((ret == ECMD_FAILED) && created_file)
+ unlink(cmd->devices_file_path);
destroy_processing_handle(cmd, handle);
return ret;
}
1 year, 3 months
rhel-8.8.0 - vgimportdevices: fix locking when creating devices file
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0b9d9963b8f15a6f12a...
Commit: 0b9d9963b8f15a6f12a0149a62809fa9b846c5c5
Parent: f1d8c01dff3f8839355004e5fd77e9cd521e26cb
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Aug 30 14:40:48 2022 -0500
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Mon Nov 28 17:11:21 2022 +0100
vgimportdevices: fix locking when creating devices file
Take the devices file lock before creating a new devices file.
(Was missed by the change to preemptively create the devices
file prior to setup_devices(), which was done to improve the
error path.)
---
lib/device/dev-cache.c | 7 +++----
lib/device/device_id.c | 1 +
tools/vgimportdevices.c | 10 ++++++++--
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 65e1cb138..0c9aaf785 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -1956,10 +1956,9 @@ static int _setup_devices(struct cmd_context *cmd, int no_file_match)
if (!file_exists) {
/*
- * pvcreate/vgcreate/vgimportdevices/lvmdevices-add create
- * a new devices file here if it doesn't exist.
- * They have the create_edit_devices_file flag set.
- * First they create/lock-ex the devices file lockfile.
+ * pvcreate/vgcreate create a new devices file here if it
+ * doesn't exist. They have create_edit_devices_file=1.
+ * First create/lock-ex the devices file lockfile.
* Other commands will not use a devices file if none exists.
*/
lock_mode = LOCK_EX;
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index c3816a66c..780e08404 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -2429,6 +2429,7 @@ static int _lock_devices_file(struct cmd_context *cmd, int mode, int nonblock, i
if (_devices_file_locked == mode) {
/* can happen when a command holds an ex lock and does an update in device_ids_validate */
+ /* can happen when vgimportdevices calls this directly, followed later by setup_devices */
if (held)
*held = 1;
return 1;
diff --git a/tools/vgimportdevices.c b/tools/vgimportdevices.c
index 9ade1b9e4..23c2718ff 100644
--- a/tools/vgimportdevices.c
+++ b/tools/vgimportdevices.c
@@ -132,8 +132,10 @@ int vgimportdevices(struct cmd_context *cmd, int argc, char **argv)
return ECMD_FAILED;
/*
- * Prepare devices file preemptively because the error path for this
- * case from process_each is not as clean.
+ * Prepare/create devices file preemptively because the error path for
+ * this case from process_each/setup_devices is not as clean.
+ * This means that when setup_devices is called, it the devices
+ * file steps will be redundant, and need to handle being repeated.
*/
if (!setup_devices_file(cmd)) {
log_error("Failed to set up devices file.");
@@ -143,6 +145,10 @@ int vgimportdevices(struct cmd_context *cmd, int argc, char **argv)
log_error("Devices file not enabled.");
return ECMD_FAILED;
}
+ if (!lock_devices_file(cmd, LOCK_EX)) {
+ log_error("Failed to lock the devices file.");
+ return ECMD_FAILED;
+ }
if (!devices_file_exists(cmd)) {
if (!devices_file_touch(cmd)) {
log_error("Failed to create devices file.");
1 year, 3 months
main - device_id: fix segfault verifying serial for non-pv
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6613a61d3b5ce4d12a6...
Commit: 6613a61d3b5ce4d12a6fef79195eac34f30ef4da
Parent: a74468116ea51542e409e4bc393c63dc7ddb20b6
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Dec 2 11:59:09 2022 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Dec 2 12:25:10 2022 -0600
device_id: fix segfault verifying serial for non-pv
The recent change that verifies sys_serial system.devices entries
using the PVID did not exclude non-PV devices from being checked.
The verification code would attempt to use du->pvid which was null
for the non-PVs causing a segfault.
---
lib/device/device_id.c | 6 ++-
test/shell/devicesfile-serial.sh | 79 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 83 insertions(+), 2 deletions(-)
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index 1f2ab5ad4..1be6b0787 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -2239,8 +2239,8 @@ void device_ids_validate(struct cmd_context *cmd, struct dm_list *scanned_devs,
* number is correct, since serial numbers may not be unique.
* Search for the PVID on other devs in device_ids_check_serial.
*/
- if ((du->idtype == DEV_ID_TYPE_SYS_SERIAL) &&
- (!du->pvid || memcmp(dev->pvid, du->pvid, ID_LEN))) {
+ if ((du->idtype == DEV_ID_TYPE_SYS_SERIAL) && du->pvid &&
+ memcmp(dev->pvid, du->pvid, ID_LEN)) {
log_debug("suspect device id serial %s for %s", du->idname, dev_name(dev));
str_list_add(cmd->mem, &cmd->device_ids_check_serial, dm_pool_strdup(cmd->mem, du->idname));
*device_ids_invalid = 1;
@@ -2573,6 +2573,8 @@ void device_ids_check_serial(struct cmd_context *cmd, struct dm_list *scan_devs,
dm_list_iterate_items(dul, &dus_check) {
if (!dul->du->dev)
continue;
+ if (!dul->du->pvid)
+ continue;
/* save previously matched devs so they can be dropped from
lvmcache at the end if they are no longer used */
if (!(dil = dm_pool_zalloc(cmd->mem, sizeof(*dil))))
diff --git a/test/shell/devicesfile-serial.sh b/test/shell/devicesfile-serial.sh
index b7bfce29e..a88c1906a 100644
--- a/test/shell/devicesfile-serial.sh
+++ b/test/shell/devicesfile-serial.sh
@@ -772,6 +772,85 @@ grep $SERIAL1 out2
grep $dev3 out3
grep $SERIAL3 out3
+# non-PV devices
+
+aux wipefs_a $dev1
+aux wipefs_a $dev2
+aux wipefs_a $dev3
+aux wipefs_a $dev4
+
+echo $SERIAL1 > $SYS_DIR/dev/block/$MAJOR1:$MINOR1/device/serial
+echo $SERIAL2 > $SYS_DIR/dev/block/$MAJOR2:$MINOR2/device/serial
+echo $SERIAL2 > $SYS_DIR/dev/block/$MAJOR3:$MINOR3/device/serial
+echo $SERIAL4 > $SYS_DIR/dev/block/$MAJOR4:$MINOR4/device/serial
+
+rm $DF
+touch $DF
+vgcreate $vg4 $dev4
+lvmdevices --adddev "$dev1"
+lvmdevices --adddev "$dev2"
+lvmdevices --adddev "$dev3"
+cat $DF
+
+grep $dev1 $DF |tee out1
+grep $dev2 $DF |tee out2
+grep $dev3 $DF |tee out3
+grep $dev4 $DF |tee out4
+
+grep $SERIAL1 out1
+grep $SERIAL2 out2
+grep $SERIAL2 out3
+grep $SERIAL4 out4
+
+pvs |tee out
+grep $dev4 out
+not grep $dev1 out
+not grep $dev2 out
+not grep $dev3 out
+
+pvcreate $dev1
+pvs |tee out
+grep $dev1 out
+grep $dev4 out
+not grep $dev2 out
+not grep $dev3 out
+
+pvcreate $dev2
+pvs |tee out
+grep $dev1 out
+grep $dev4 out
+grep $dev2 out
+not grep $dev3 out
+
+pvcreate $dev3
+pvs |tee out
+grep $dev1 out
+grep $dev4 out
+grep $dev2 out
+grep $dev3 out
+
+PVID1=`pvs "$dev1" --noheading -o uuid | tr -d - | awk '{print $1}'`
+PVID2=`pvs "$dev2" --noheading -o uuid | tr -d - | awk '{print $1}'`
+PVID3=`pvs "$dev3" --noheading -o uuid | tr -d - | awk '{print $1}'`
+PVID4=`pvs "$dev4" --noheading -o uuid | tr -d - | awk '{print $1}'`
+OPVID1=`pvs "$dev1" --noheading -o uuid | awk '{print $1}'`
+OPVID2=`pvs "$dev2" --noheading -o uuid | awk '{print $1}'`
+OPVID3=`pvs "$dev3" --noheading -o uuid | awk '{print $1}'`
+OPVID4=`pvs "$dev4" --noheading -o uuid | awk '{print $1}'`
+
+grep $dev1 $DF |tee out1
+grep $dev2 $DF |tee out2
+grep $dev3 $DF |tee out3
+grep $dev4 $DF |tee out4
+
+grep $PVID1 out1
+grep $PVID2 out2
+grep $PVID3 out3
+grep $PVID4 out4
+
+vgcreate $vg2 $dev2 $dev3
+vgs | grep $vg2
+
remove_base
rmmod brd
1 year, 3 months