main - pool: avoid using artificial name internally
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e84b00964fd6374c5af...
Commit: e84b00964fd6374c5afcfd86d3f61a7fda58b29d
Parent: 3596558861e62ca0c6f37bfba6a4e80e46dcca47
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 29 13:53:43 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 13:55:27 2023 +0200
pool: avoid using artificial name internally
---
lib/metadata/metadata-exported.h | 2 +-
lib/metadata/pool_manip.c | 5 +----
tools/lvconvert.c | 3 +--
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index ded0389b1..9f8c4d876 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -916,7 +916,7 @@ struct lv_status_thin {
const char *get_pool_discards_name(thin_discards_t discards);
int set_pool_discards(thin_discards_t *discards, const char *str);
struct logical_volume *alloc_pool_metadata(struct logical_volume *pool_lv,
- const char *name, uint32_t read_ahead,
+ uint32_t read_ahead,
uint32_t stripes, uint32_t stripe_size,
uint32_t extents, alloc_policy_t alloc,
struct dm_list *pvh);
diff --git a/lib/metadata/pool_manip.c b/lib/metadata/pool_manip.c
index 559b07ba8..8a908a58d 100644
--- a/lib/metadata/pool_manip.c
+++ b/lib/metadata/pool_manip.c
@@ -607,7 +607,7 @@ bad:
}
struct logical_volume *alloc_pool_metadata(struct logical_volume *pool_lv,
- const char *name, uint32_t read_ahead,
+ uint32_t read_ahead,
uint32_t stripes, uint32_t stripe_size,
uint32_t extents, alloc_policy_t alloc,
struct dm_list *pvh)
@@ -639,9 +639,6 @@ struct logical_volume *alloc_pool_metadata(struct logical_volume *pool_lv,
if (!(metadata_lv = lv_create_single(pool_lv->vg, &lvc)))
return_0;
- if (!lv_rename_update(pool_lv->vg->cmd, metadata_lv, name, 0))
- return_0;
-
return metadata_lv;
}
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 0e928d39c..84659d3f4 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3269,7 +3269,6 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
meta_alloc = (alloc_policy_t) arg_uint_value(cmd, alloc_ARG, ALLOC_INHERIT);
if (!(metadata_lv = alloc_pool_metadata(lv,
- meta_name,
meta_readahead,
meta_stripes,
meta_stripe_size,
@@ -3426,7 +3425,7 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
* Rename deactivated metadata LV to have _tmeta suffix.
* Implicit checks if metadata_lv is visible.
*/
- if (pool_metadata_name &&
+ if ((strcmp(metadata_lv->name, meta_name) != 0) &&
!lv_rename_update(cmd, metadata_lv, meta_name, 0))
goto_bad;
3 months
main - lv: more details about monitoring lvs
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3596558861e62ca0c6f...
Commit: 3596558861e62ca0c6f37bfba6a4e80e46dcca47
Parent: 8a07f57ba478c16ca5d5eacf778ee2708109aa65
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 28 11:51:35 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 13:10:42 2023 +0200
lv: more details about monitoring lvs
Show "not supported" when LV does not support dmeventd monitoring.
Show "disabled" for LV with disabled dmeventd monitoring.
(lvdisplay -m)
---
lib/metadata/lv.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index 21aa3b422..1e3fc02d4 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -311,10 +311,11 @@ char *lvseg_monitor_dup(struct dm_pool *mem, const struct lv_segment *seg)
segm = first_seg(seg->lv->snapshot->lv);
// log_debug("Query LV:%s mon:%s segm:%s tgtm:%p segmon:%d statusm:%d", seg->lv->name, segm->lv->name, segm->segtype->name, segm->segtype->ops->target_monitored, seg_monitored(segm), (int)(segm->status & PVMOVE));
- if ((dmeventd_monitor_mode() != 1) ||
- !segm->segtype->ops ||
+ if (!segm->segtype->ops ||
!segm->segtype->ops->target_monitored)
- /* Nothing to do, monitoring not supported */;
+ s = "disabled";
+ else if (dmeventd_monitor_mode() != 1)
+ s = "not enabled";
else if (lv_is_cow_covering_origin(seg->lv))
/* Nothing to do, snapshot already covers origin */;
else if (!seg_monitored(segm) || (segm->status & PVMOVE))
3 months
main - lvm_import_vdo: spelling fixes
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8a07f57ba478c16ca5d...
Commit: 8a07f57ba478c16ca5d5eacf778ee2708109aa65
Parent: 8b75bbe47d2a2961b0fb029ad7a01dc37ee6a8e5
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 29 13:05:55 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 13:10:42 2023 +0200
lvm_import_vdo: spelling fixes
---
scripts/lvm_import_vdo.sh | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/scripts/lvm_import_vdo.sh b/scripts/lvm_import_vdo.sh
index 319bcb33d..b5e1a9e16 100755
--- a/scripts/lvm_import_vdo.sh
+++ b/scripts/lvm_import_vdo.sh
@@ -52,7 +52,7 @@ DM_DEV_DIR="${DM_DEV_DIR:-/dev}"
DM_UUID_PREFIX="${DM_UUID_PREFIX:-}"
DM_VG_NAME=
DM_LV_NAME=
-VDO_CONFIG=${VDO_CONFIG:-} # can be overriden with --vdo-config
+VDO_CONFIG=${VDO_CONFIG:-} # can be overridden with --vdo-config
VDOCONF=
test -n "$VDO_CONFIG" && VDOCONF="-f $VDO_CONFIG"
@@ -150,7 +150,7 @@ snapshot_create_() {
snapshot_merge_() {
local status
- local inital_status
+ local initial_status
initial_status=( $("$DMSETUP" status "$VDO_DM_SNAPSHOT_NAME") )
"$DMSETUP" reload "$VDO_DM_SNAPSHOT_NAME" --table "$(snapshot_target_line_ "$1" "$VDO_SNAPSHOT_LOOP" -merge)"
@@ -165,7 +165,7 @@ snapshot_merge_() {
#du -h "$TEMPDIR/$VDO_DM_SNAPSHOT_NAME"
# Loop for a while, till the snapshot is merged.
- # Should be nearly instantenious.
+ # Should be nearly instantaneous.
# FIXME: Recovery when something prevents merging is hard
for i in $(seq 1 20) ; do
status=( $("$DMSETUP" status "$VDO_DM_SNAPSHOT_NAME") )
@@ -231,7 +231,7 @@ get_largest_extent_size_() {
}
# detect LV on the given device
-# dereference device name if it is symbolic link
+# deference device name if it is symbolic link
detect_lv_() {
local DEVICE=$1
local SYSVOLUME
@@ -315,7 +315,7 @@ parse_yaml_() {
# Currently this enforces a user to reduce the VG extent size to the smaller size (up to 4KiB).
#
# TODO: We may eventually relax this condition just like we are doing rounding for convert_non_lv_()
-# Let's if there would be any singly user requiring this feauture.
+# Let's if there would be any singly user requiring this feature.
# It may allow to better use larger VDO volume size (in TiB ranges).
#
convert_lv_() {
@@ -351,7 +351,7 @@ convert_lv_() {
# Convert VDO volume on a device to VG with VDOPool LV
#
# Convert device with the use of snapshot on top of original VDO volume (can be optionally disabled)
-# Once the whole conversion is finished, snapshot is merged (During the short periof time of merging
+# Once the whole conversion is finished, snapshot is merged (During the short period time of merging
# user must ensure there will be no power-off!)
#
# For best use the latest version of vdoprepareforlvm tool is required.
@@ -373,12 +373,12 @@ convert_non_lv_() {
output=$(dry "$VDO" convert $VDOCONF $VERB --force --name "$VDONAME")
if [ "$ABORT_AFTER_VDO_CONVERT" != "0" ] ; then
- verbose "Aborting VDO coversion after moving VDO, volume is useless!"
+ verbose "Aborting VDO conversion after moving VDO header, volume is useless!"
cleanup 0
fi
# Parse result from VDO preparation/conversion tool
- # New version of the tool provides output with alingment and offset
+ # New version of the tool provides output with alignment and offset
local vdo_length=0
local vdo_aligned=0
local vdo_offset=0
@@ -432,7 +432,7 @@ convert_non_lv_() {
verbose "Converting to VDO pool."
dry "$LVM" lvconvert $YES $VERB $FORCE --devices "$devices" --config "$VDO_ALLOCATION_PARAMS" -Zn -V "${vdo_logicalSizeRounded}k" -n "$LVNAME" --type vdo-pool "$VGNAME/${LVNAME}_vpool"
if [ "$vdo_logicalSizeRounded" -lt "$vdo_logicalSize" ] ; then
- # need to extend virtal size to be covering all the converted area
+ # need to extend virtual size to be covering all the converted area
# let lvm2 to round to the proper virtual size of VDO LV
dry "$LVM" lvextend $YES $VERB --fs ignore --devices "$devices" -L "$vdo_logicalSize"k "$VGNAME/$LVNAME"
fi
@@ -512,7 +512,7 @@ convert2lvm_() {
"$MKDIR" -p -m 0000 "$TEMPDIR" || error "Failed to create $TEMPDIR."
- # TODO: might use directly /etc/vdoconf.yml (avoding need of 'vdo' manager)
+ # TODO: might use directly /etc/vdoconf.yml (avoiding need of 'vdo' manager)
verbose "Getting YAML VDO configuration."
"$VDO" printConfigFile $VDOCONF >"$TEMPDIR/vdoconf.yml"
test -s "$TEMPDIR/vdoconf.yml" || error "Cannot work without VDO configuration"
3 months
main - vdo: lvm_import_vdo correct parsing output
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8b75bbe47d2a2961b0f...
Commit: 8b75bbe47d2a2961b0fb029ad7a01dc37ee6a8e5
Parent: e48c9826e3069b06a5aa31e1e59200dce4915983
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 29 13:06:18 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 13:10:42 2023 +0200
vdo: lvm_import_vdo correct parsing output
Output from vdo manager may actually indent output with spaces,
so trim leading and ending space.
Also add support for verbosity flag for vdo conversion tool.
---
scripts/lvm_import_vdo.sh | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/lvm_import_vdo.sh b/scripts/lvm_import_vdo.sh
index 307233429..319bcb33d 100755
--- a/scripts/lvm_import_vdo.sh
+++ b/scripts/lvm_import_vdo.sh
@@ -370,7 +370,7 @@ convert_non_lv_() {
fi
verbose "Moving VDO header."
- output=$(dry "$VDO" convert $VDOCONF --force --name "$VDONAME")
+ output=$(dry "$VDO" convert $VDOCONF $VERB --force --name "$VDONAME")
if [ "$ABORT_AFTER_VDO_CONVERT" != "0" ] ; then
verbose "Aborting VDO coversion after moving VDO, volume is useless!"
@@ -384,7 +384,8 @@ convert_non_lv_() {
local vdo_offset=0
local vdo_non_converted=0
while IFS= read -r line ; do
- case "$line" in
+ # trim leading spaces
+ case "$(echo $line)" in
"Non converted"*) vdo_non_converted=1 ;;
"Length"*) vdo_length=${line##* = } ;;
"Conversion completed"*)
@@ -579,7 +580,7 @@ EOF
verbose "VDO conversion parameters: $VDO_ALLOCATION_PARAMS"
verbose "Stopping VDO volume."
- dry "$VDO" stop $VDOCONF --name "$VDONAME"
+ dry "$VDO" stop $VDOCONF --name "$VDONAME" $VERB
# If user has not provided '--yes', prompt before conversion
if [ -z "$YES" ] && [ "$USE_VDO_DM_SNAPSHOT" != "1" ]; then
3 months
main - vdo: indent for lvdisplay
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e48c9826e3069b06a5a...
Commit: e48c9826e3069b06a5aa31e1e59200dce4915983
Parent: 6ff65e675582265a673136f1edd5358b26c9e481
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 28 11:53:29 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 13:10:42 2023 +0200
vdo: indent for lvdisplay
---
lib/vdo/vdo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/vdo/vdo.c b/lib/vdo/vdo.c
index 133678ae7..6d3b67421 100644
--- a/lib/vdo/vdo.c
+++ b/lib/vdo/vdo.c
@@ -173,7 +173,7 @@ static void _vdo_pool_display(const struct lv_segment *seg)
display_size(cmd, vtp->minimum_io_size));
log_print(" Block map cache sz\t%s",
display_size(cmd, vtp->block_map_cache_size_mb * UINT64_C(2 * 1024)));
- log_print(" Block map era length\t%u", vtp->block_map_era_length);
+ log_print(" Block map era length %u", vtp->block_map_era_length);
_print_yes_no("Sparse index", vtp->use_sparse_index);
@@ -190,7 +190,7 @@ static void _vdo_pool_display(const struct lv_segment *seg)
log_print(" # Hash zone threads\t%u", (unsigned) vtp->hash_zone_threads);
log_print(" # Logical threads\t%u", (unsigned) vtp->logical_threads);
log_print(" # Physical threads\t%u", (unsigned) vtp->physical_threads);
- log_print(" Max discard\t%u", (unsigned) vtp->max_discard);
+ log_print(" Max discard\t\t%u", (unsigned) vtp->max_discard);
log_print(" Write policy\t%s", get_vdo_write_policy_name(vtp->write_policy));
}
3 months
main - vdo: check_point_frequence is unused option
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6ff65e675582265a673...
Commit: 6ff65e675582265a673136f1edd5358b26c9e481
Parent: fa434a18373e42108aed319d3257c935f510f2c3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 28 11:55:20 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 29 13:10:42 2023 +0200
vdo: check_point_frequence is unused option
This vdo parameter existed in the early stage of integration of vdo into lvm2,
but later it's been removed from vdoformat tool - so actually if
there would be any non-zero value it would cause error on lvcreate.
Option was not stored on disk in lvm2 metadata.
Remove this vdo parameter from lvm2 sources.
(Although this vdo parameter will be still accepted on cmdline through
--vdosettings option, but it will be ignored.)
---
conf/example.conf.in | 5 -----
conf/vdo-small.profile | 1 -
device_mapper/vdo/target.h | 1 -
lib/config/config_settings.h | 4 ++--
lib/metadata/merge.c | 1 -
lib/metadata/vdo_manip.c | 10 ----------
man/lvmvdo.7_main | 1 -
scripts/lvm_import_vdo.sh | 1 -
tools/toollib.c | 6 +++++-
9 files changed, 7 insertions(+), 23 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index 35837c013..1ed1f854b 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -650,11 +650,6 @@ allocation {
# This configuration option has an automatic default value.
# vdo_block_map_period = 16380
- # Configuration option allocation/vdo_check_point_frequency.
- # The default check point frequency for VDO volume.
- # This configuration option has an automatic default value.
- # vdo_check_point_frequency = 0
-
# Configuration option allocation/vdo_use_sparse_index.
# Enables sparse indexing for VDO volume.
# This configuration option has an automatic default value.
diff --git a/conf/vdo-small.profile b/conf/vdo-small.profile
index 2044fc27f..97b5b37dd 100644
--- a/conf/vdo-small.profile
+++ b/conf/vdo-small.profile
@@ -8,7 +8,6 @@ allocation {
vdo_minimum_io_size=4096
vdo_block_map_cache_size_mb=128
vdo_block_map_period=16380
- vdo_check_point_frequency=0
vdo_use_sparse_index=0
vdo_index_memory_size_mb=256
vdo_slab_size_mb=2048
diff --git a/device_mapper/vdo/target.h b/device_mapper/vdo/target.h
index bd21bb5d7..353320f9e 100644
--- a/device_mapper/vdo/target.h
+++ b/device_mapper/vdo/target.h
@@ -81,7 +81,6 @@ struct dm_vdo_target_params {
uint32_t block_map_era_length; // format period
uint32_t block_map_period; // supported alias
};
- uint32_t check_point_frequency;
uint32_t index_memory_size_mb; // format
uint32_t slab_size_mb; // format
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 51e11857e..fd56993ba 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -732,8 +732,8 @@ cfg(allocation_vdo_block_map_era_length_CFG, "vdo_block_map_period", allocation_
"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")
+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, vsn(2, 3, 22), NULL,
+ "Deprecated option to set default check point frequency for VDO volume.\n")
// vdo format
cfg(allocation_vdo_use_sparse_index_CFG, "vdo_use_sparse_index", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_USE_SPARSE_INDEX, VDO_1ST_VSN, NULL, 0, NULL,
diff --git a/lib/metadata/merge.c b/lib/metadata/merge.c
index 5209f51b5..25b2bc33a 100644
--- a/lib/metadata/merge.c
+++ b/lib/metadata/merge.c
@@ -555,7 +555,6 @@ static void _check_lv_segment(struct logical_volume *lv, struct lv_segment *seg,
if (seg->vdo_params.minimum_io_size |
seg->vdo_params.block_map_cache_size_mb |
seg->vdo_params.block_map_era_length |
- seg->vdo_params.check_point_frequency |
seg->vdo_params.index_memory_size_mb |
seg->vdo_params.slab_size_mb |
seg->vdo_params.max_discard |
diff --git a/lib/metadata/vdo_manip.c b/lib/metadata/vdo_manip.c
index 19291c9d6..f24182cca 100644
--- a/lib/metadata/vdo_manip.c
+++ b/lib/metadata/vdo_manip.c
@@ -283,14 +283,6 @@ static int _format_vdo_pool_data_lv(struct logical_volume *data_lv,
argv[args] = buf_args[args];
args++;
- if (vtp->check_point_frequency) {
- if (dm_snprintf(buf_args[args], sizeof(buf_args[0]), "--uds-checkpoint-frequency=%u",
- vtp->check_point_frequency) < 0)
- return_0;
- argv[args] = buf_args[args];
- args++;
- }
-
/* Convert size to GiB units or one of these strings: 0.25, 0.50, 0.75 */
if (vtp->index_memory_size_mb >= 1024) {
if (dm_snprintf(buf_args[args], sizeof(buf_args[0]), "--uds-memory-size=%u",
@@ -516,8 +508,6 @@ int fill_vdo_target_params(struct cmd_context *cmd,
find_config_tree_int64(cmd, allocation_vdo_block_map_cache_size_mb_CFG, profile);
vtp->block_map_era_length =
find_config_tree_int(cmd, allocation_vdo_block_map_era_length_CFG, profile);
- vtp->check_point_frequency =
- find_config_tree_int(cmd, allocation_vdo_check_point_frequency_CFG, profile);
vtp->use_sparse_index =
find_config_tree_int(cmd, allocation_vdo_use_sparse_index_CFG, profile);
vtp->index_memory_size_mb =
diff --git a/man/lvmvdo.7_main b/man/lvmvdo.7_main
index 8c3e3eeaa..a31e5dd4d 100644
--- a/man/lvmvdo.7_main
+++ b/man/lvmvdo.7_main
@@ -165,7 +165,6 @@ vdo_use_metadata_hints=1
vdo_minimum_io_size=4096
vdo_block_map_cache_size_mb=128
vdo_block_map_period=16380
-vdo_check_point_frequency=0
vdo_use_sparse_index=0
vdo_index_memory_size_mb=256
vdo_slab_size_mb=2048
diff --git a/scripts/lvm_import_vdo.sh b/scripts/lvm_import_vdo.sh
index 13197c6fb..307233429 100755
--- a/scripts/lvm_import_vdo.sh
+++ b/scripts/lvm_import_vdo.sh
@@ -560,7 +560,6 @@ allocation {
vdo_minimum_io_size = $vdo_logicalBlockSize
vdo_block_map_cache_size_mb = $(( $(get_kb_size_with_unit_ "$vdo_blockMapCacheSize") / 1024 ))
vdo_block_map_period = $vdo_blockMapPeriod
- 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_slabSize") / 1024 ))
diff --git a/tools/toollib.c b/tools/toollib.c
index 2f4756b6b..696f541c4 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1319,7 +1319,6 @@ int get_vdo_settings(struct cmd_context *cmd,
// Settings bellow cannot be changed with lvchange command
is_lvchange = checked_lvchange;
- DO_OFFLINE(check_point_frequency);
DO_OFFLINE(index_memory_size_mb);
DO_OFFLINE(minimum_io_size);
DO_OFFLINE(slab_size_mb);
@@ -1336,6 +1335,11 @@ int get_vdo_settings(struct cmd_context *cmd,
continue;
}
+ if (_compare_vdo_option(cn->key, "check_point_frequency")) {
+ log_verbose("Ignoring deprecated --vdosettings option \"%s\" and its value.", cn->key);
+ continue; /* Accept & ignore deprecated option */
+ }
+
log_error("Unknown VDO setting \"%s\".", cn->key);
goto out;
}
3 months
main - tests: simplify
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fa434a18373e42108ae...
Commit: fa434a18373e42108aed319d3257c935f510f2c3
Parent: b8db2c0a4a4bbfc39338141cd7eee67c05b2b31d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Jun 25 12:58:27 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Jun 25 13:02:36 2023 +0200
tests: simplify
---
test/shell/vgsplit-cache.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/test/shell/vgsplit-cache.sh b/test/shell/vgsplit-cache.sh
index 202e4b562..65a711f75 100644
--- a/test/shell/vgsplit-cache.sh
+++ b/test/shell/vgsplit-cache.sh
@@ -20,6 +20,7 @@ SKIP_WITH_LVMPOLLD=1
aux have_cache 1 3 0 || skip
aux prepare_vg 7
+vgcfgbackup -f vgb $vg
lvcreate -L5 -n $lv2 $vg "$dev2"
lvcreate -L5 -n $lv3 $vg "$dev3"
@@ -78,7 +79,7 @@ vgremove -ff $vg1
#
# Check we handle pmspare for splitted VGs
#
-aux prepare_vg 7
+vgcfgrestore -f vgb $vg
# Create cache-pool and pmspare on single PV1
lvcreate -L10 --type cache-pool $vg/cpool "$dev1"
@@ -100,7 +101,7 @@ vgremove $vg
vgremove -f $vg1
-aux prepare_vg 7
+vgcfgrestore -f vgb $vg
# Again - now with handling _pmspare by vgsplit
lvcreate -L10 --type cache-pool $vg/cpool "$dev1"
3 months
main - tests: require raid target
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b8db2c0a4a4bbfc3933...
Commit: b8db2c0a4a4bbfc39338141cd7eee67c05b2b31d
Parent: 04860b63240c19065f79453bdffbb7637f2f01eb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Jun 24 22:37:12 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Jun 25 13:02:36 2023 +0200
tests: require raid target
---
test/shell/snapshot-raid.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/shell/snapshot-raid.sh b/test/shell/snapshot-raid.sh
index 7b045d79e..98314ddb0 100644
--- a/test/shell/snapshot-raid.sh
+++ b/test/shell/snapshot-raid.sh
@@ -16,6 +16,7 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
+aux have_raid 1 3 0 || skip
which mkfs.ext4 || skip
mount_dir="mnt"
3 months
main - tests: correct checked devices
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=04860b63240c19065f7...
Commit: 04860b63240c19065f79453bdffbb7637f2f01eb
Parent: 5848f75278250835dd718fbcacc167133af66b35
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Jun 25 11:52:47 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Jun 25 13:02:36 2023 +0200
tests: correct checked devices
Fix the testing logic.
With raid5 device the layout of files on a filesystem does not define
which leg will actually contain the block we try to damage.
So test will now figure out which device has damaged block.
Use 'check' functionality and also drop unneeded random write as we
now can identify easily in other way.
---
test/shell/integrity-syncaction.sh | 59 ++++++++++++++++----------------------
1 file changed, 25 insertions(+), 34 deletions(-)
diff --git a/test/shell/integrity-syncaction.sh b/test/shell/integrity-syncaction.sh
index 0f8ce17d2..2714aede1 100644
--- a/test/shell/integrity-syncaction.sh
+++ b/test/shell/integrity-syncaction.sh
@@ -43,12 +43,6 @@ _test1() {
mount "$DM_DEV_DIR/$vg/$lv1" $mnt
- # we don't want fileA to be located too early in the fs,
- # otherwise activating the LV will trigger the corruption
- # to be found and corrected, leaving nothing for syncaction
- # to find and correct.
- dd if=/dev/urandom of=$mnt/rand16M bs=1M count=16
-
cp fileA $mnt
cp fileB $mnt
cp fileC $mnt
@@ -56,19 +50,30 @@ _test1() {
umount $mnt
lvchange -an $vg/$lv1
- aux corrupt_dev "$dev1" BBBBBBBBBBBBBBBBB BBBBBBBBCBBBBBBBB
+ # Corrupting raid1 is simple - 1 leg needs to be modifed
+ # For raid5 corrupted block can be places on any of its leg.
+ for i in "$@" ; do
+ aux corrupt_dev "$i" BBBBBBBBBBBBBBBBB BBBBBBBBCBBBBBBBB
+ done
lvchange -ay $vg/$lv1
- lvs -o integritymismatches $vg/${lv1}_rimage_0 |tee mismatch
- grep 0 mismatch
+ # so without synchecking the array - integrity doesn't know yet about failure
+ check lv_field $vg/${lv1}_rimage_0 integritymismatches "0"
+ check lv_field $vg/${lv1}_rimage_1 integritymismatches "0"
+ [ $# -gt 2 ] && check lv_field $vg/${lv1}_rimage_2 integritymismatches "0"
lvchange --syncaction check $vg/$lv1
aux wait_recalc $vg/$lv1
- lvs -o integritymismatches $vg/${lv1}_rimage_0 |tee mismatch
- not grep 0 mismatch
+ # after synaction check - integrity should recognize faulty devices
+ baddev=0
+ for i in 0 1 2 ; do
+ [ "$i" -gt 1 ] && [ $# -lt 3 ] && continue # only raid5 has rimage_2
+ [ "$(get lv_field $vg/${lv1}_rimage_${i} integritymismatches)" = "0" ] || baddev=$(( baddev + 1 ))
+ done
+ [ "$baddev" -eq 1 ] || die "Unexpected number of integritymismatched devices ($baddev)!"
mount "$DM_DEV_DIR/$vg/$lv1" $mnt
cmp -b $mnt/fileA fileA
@@ -82,12 +87,6 @@ _test2() {
mount "$DM_DEV_DIR/$vg/$lv1" $mnt
- # we don't want fileA to be located too early in the fs,
- # otherwise activating the LV will trigger the corruption
- # to be found and corrected, leaving nothing for syncaction
- # to find and correct.
- dd if=/dev/urandom of=$mnt/rand16M bs=1M count=16
-
cp fileA $mnt
cp fileB $mnt
cp fileC $mnt
@@ -104,19 +103,15 @@ _test2() {
lvchange -ay $vg/$lv1
- lvs -o integritymismatches $vg/${lv1}_rimage_0 |tee mismatch
- grep 0 mismatch
- lvs -o integritymismatches $vg/${lv1}_rimage_1 |tee mismatch
- grep 0 mismatch
+ check lv_field $vg/${lv1}_rimage_0 integritymismatches "0"
+ check lv_field $vg/${lv1}_rimage_1 integritymismatches "0"
lvchange --syncaction check $vg/$lv1
aux wait_recalc $vg/$lv1
- lvs -o integritymismatches $vg/${lv1}_rimage_0 |tee mismatch
- not grep 0 mismatch
- lvs -o integritymismatches $vg/${lv1}_rimage_1 |tee mismatch
- not grep 0 mismatch
+ not check lv_field $vg/${lv1}_rimage_0 integritymismatches "0"
+ not check lv_field $vg/${lv1}_rimage_1 integritymismatches "0"
mount "$DM_DEV_DIR/$vg/$lv1" $mnt
cmp -b $mnt/fileA fileA
@@ -130,9 +125,8 @@ lvcreate --type raid1 -m1 --raidintegrity y -n $lv1 -l 6 $vg "$dev1" "$dev2"
aux wait_recalc $vg/${lv1}_rimage_0
aux wait_recalc $vg/${lv1}_rimage_1
aux wait_recalc $vg/$lv1
-_test1
-lvs -o integritymismatches $vg/$lv1 |tee mismatch
-not grep 0 mismatch
+_test1 "$dev1"
+not check $vg/$lv1 integritymismatches "0"
lvchange -an $vg/$lv1
lvconvert --raidintegrity n $vg/$lv1
lvremove $vg/$lv1
@@ -144,8 +138,7 @@ aux wait_recalc $vg/${lv1}_rimage_0
aux wait_recalc $vg/${lv1}_rimage_1
aux wait_recalc $vg/$lv1
_test2
-lvs -o integritymismatches $vg/$lv1 |tee mismatch
-not grep 0 mismatch
+not check $vg/$lv1 integritymismatches "0"
lvchange -an $vg/$lv1
lvconvert --raidintegrity n $vg/$lv1
lvremove $vg/$lv1
@@ -157,11 +150,9 @@ aux wait_recalc $vg/${lv1}_rimage_0
aux wait_recalc $vg/${lv1}_rimage_1
aux wait_recalc $vg/${lv1}_rimage_2
aux wait_recalc $vg/$lv1
-_test1
-lvs -o integritymismatches $vg/$lv1 |tee mismatch
-not grep 0 mismatch
+_test1 "$dev1" "$dev2" "$dev3"
+not check $vg/$lv1 integritymismatches "0"
lvchange -an $vg/$lv1
lvconvert --raidintegrity n $vg/$lv1
lvremove $vg/$lv1
vgremove -ff $vg
-
3 months
main - tests: correct generated metadata
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5848f75278250835dd7...
Commit: 5848f75278250835dd718fbcacc167133af66b35
Parent: 0a5712ada4753cd034d862389e6e91af387c406f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Jun 24 22:34:38 2023 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Jun 25 12:00:57 2023 +0200
tests: correct generated metadata
Newer thin_check actually rejects such restored data.
---
test/shell/lvextend-thin-metadata-dmeventd.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/test/shell/lvextend-thin-metadata-dmeventd.sh b/test/shell/lvextend-thin-metadata-dmeventd.sh
index 3193cc29c..732f67023 100644
--- a/test/shell/lvextend-thin-metadata-dmeventd.sh
+++ b/test/shell/lvextend-thin-metadata-dmeventd.sh
@@ -48,7 +48,7 @@ fake_metadata_() {
for i in $(seq 10 $1)
do
echo ' <device dev_id="'$i'" mapped_blocks="30" transaction="0" creation_time="0" snap_time="0">'
- echo ' <range_mapping origin_begin="0" data_begin="0" length="29" time="0"/>'
+ echo ' <range_mapping origin_begin="0" data_begin="0" length="30" time="0"/>'
echo ' </device>'
set +x
done
@@ -98,6 +98,10 @@ DATA=7200 # Newer version of thin-pool have hidden reserve, so use lower value
test -z "$BIG_DATA" || DATA=7400
fake_metadata_ "$DATA" 2 >data
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv2"
+
+# Check tha restored metadata are OK for thin_check
+"$LVM_TEST_THIN_CHECK_CMD" "$DM_DEV_DIR/mapper/$vg-$lv2"
+
# Swap volume with restored fake metadata
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv2
lvchange -ay $vg/pool
3 months