main - lvconvert: VDO kernel support before converting
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a7cb25c877ad70c48fa...
Commit: a7cb25c877ad70c48fa66258f8e3f2157e2e2be5
Parent: a915cd5a46dca80bb1ce981a2ee923b8e813d887
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Feb 17 11:13:19 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Feb 17 11:21:35 2021 +0100
lvconvert: VDO kernel support before converting
Early check for kernel support of VDO target before starting any
conversion work.
---
tools/lvconvert.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index ef31799fa..8bd73bb53 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -5472,6 +5472,14 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
if (!(lvc.segtype = get_segtype_from_string(cmd, SEG_TYPE_NAME_VDO)))
return_0;
+ if (activation() && lvc.segtype->ops->target_present) {
+ if (!lvc.segtype->ops->target_present(cmd, NULL, &lvc.target_attr)) {
+ log_error("%s: Required device-mapper target(s) not detected in your kernel.",
+ lvc.segtype->name);
+ return 0;
+ }
+ }
+
if (vg_is_shared(vg)) {
/* FIXME: need to swap locks betwen LVs? */
log_error("Unable to convert VDO pool in VG with lock_type %s", vg->lock_type);
2 years, 9 months
main - lvconvert: vdo may convert already formated vdo
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a915cd5a46dca80bb1c...
Commit: a915cd5a46dca80bb1ce981a2ee923b8e813d887
Parent: f87ff95e329fce701ec93888a9bea7e7da7151a1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Feb 16 21:26:35 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Feb 17 11:21:35 2021 +0100
lvconvert: vdo may convert already formated vdo
User use 'lvconvert -Zn --type vdo-pool' to convert an existing
vdo formated volume and skip lvm2 internal formating.
This however requires user is passing proper matching parameters.
For them user can use --profile|--metadataprofile option whos
support has been also enhanced.
TODO: add support to read values directly from formated volume.
---
lib/metadata/lv_manip.c | 5 ++++-
lib/metadata/metadata-exported.h | 3 ++-
lib/metadata/vdo_manip.c | 15 +++++++++++----
tools/command-lines.in | 10 +++++++---
tools/lvconvert.c | 33 +++++++++++++++++++++------------
tools/lvmcmdline.c | 1 +
6 files changed, 46 insertions(+), 21 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 5784e407d..5cad4e07a 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7469,6 +7469,9 @@ struct logical_volume *insert_layer_for_lv(struct cmd_context *cmd,
lv_where->le_count = layer_lv->le_count;
lv_where->size = (uint64_t) lv_where->le_count * lv_where->vg->extent_size;
+ if (lv_where->vg->fid->fmt->features & FMT_CONFIG_PROFILE)
+ lv_where->profile = lv_where->vg->cmd->profile_params->global_metadata_profile;
+
/*
* recuresively rename sub LVs
* currently supported only for thin data layer
@@ -8693,7 +8696,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
}
if (seg_is_vdo_pool(lp)) {
- if (!convert_vdo_pool_lv(lv, &lp->vdo_params, &lp->virtual_extents)) {
+ if (!convert_vdo_pool_lv(lv, &lp->vdo_params, &lp->virtual_extents, 1)) {
stack;
goto deactivate_and_revert_new_lv;
}
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index ac384497b..874088993 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -1355,7 +1355,8 @@ int parse_vdo_pool_status(struct dm_pool *mem, const struct logical_volume *vdo_
const char *params, struct lv_status_vdo *status);
struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
const struct dm_vdo_target_params *vtp,
- uint32_t *virtual_extents);
+ uint32_t *virtual_extents,
+ int format);
int set_vdo_write_policy(enum dm_vdo_write_policy *vwp, const char *policy);
int fill_vdo_target_params(struct cmd_context *cmd,
struct dm_vdo_target_params *vtp,
diff --git a/lib/metadata/vdo_manip.c b/lib/metadata/vdo_manip.c
index 30682449c..7d5a2cb5a 100644
--- a/lib/metadata/vdo_manip.c
+++ b/lib/metadata/vdo_manip.c
@@ -355,7 +355,8 @@ static int _format_vdo_pool_data_lv(struct logical_volume *data_lv,
*/
struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
const struct dm_vdo_target_params *vtp,
- uint32_t *virtual_extents)
+ uint32_t *virtual_extents,
+ int format)
{
const uint64_t header_size = DEFAULT_VDO_POOL_HEADER_SIZE;
const uint32_t extent_size = data_lv->vg->extent_size;
@@ -384,9 +385,15 @@ struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
return_0;
/* Format data LV as VDO volume */
- if (!_format_vdo_pool_data_lv(data_lv, vtp, &vdo_logical_size)) {
- log_error("Cannot format VDO pool volume %s.", display_lvname(data_lv));
- return NULL;
+ if (format) {
+ if (!_format_vdo_pool_data_lv(data_lv, vtp, &vdo_logical_size)) {
+ log_error("Cannot format VDO pool volume %s.", display_lvname(data_lv));
+ return NULL;
+ }
+ } else {
+ log_verbose("Skiping VDO formating %s.", display_lvname(data_lv));
+ /* TODO: parse existing VDO data and retrieve vdo_logical_size */
+ vdo_logical_size = data_lv->size;
}
if (!deactivate_lv(data_lv->vg->cmd, data_lv)) {
diff --git a/tools/command-lines.in b/tools/command-lines.in
index 7c7551405..2aadd5f40 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -324,6 +324,10 @@ OO_LVCONVERT_CACHE: --cachemetadataformat CacheMetadataFormat,
--cachemode CacheMode, --cachepolicy String,
--cachesettings String, --zero Bool
+OO_LVCONVERT_VDO: --metadataprofile String --readahead Readahead,
+--compression Bool, --deduplication Bool
+--zero Bool
+
OO_LVCONVERT: --alloc Alloc, --background, --force, --noudevsync
---
@@ -604,15 +608,15 @@ RULE: --poolmetadata not --readahead --stripesize --stripes_long
---
lvconvert --type vdo-pool LV_linear_striped_raid_cache
-OO: --name LV_new, --virtualsize SizeMB, --compression Bool, --deduplication Bool, OO_LVCONVERT
+OO: --name LV_new, --virtualsize SizeMB, OO_LVCONVERT_VDO, OO_LVCONVERT
ID: lvconvert_to_vdopool
DESC: Convert LV to type vdopool.
RULE: all and lv_is_visible
RULE: all not lv_is_locked lv_is_origin lv_is_merging_origin lv_is_external_origin lv_is_virtual lv_is_raid_with_integrity
lvconvert --vdopool LV_linear_striped_raid_cache
-OO: --type vdo-pool, OO_LVCONVERT,
---name LV_new, --virtualsize SizeMB, --compression Bool, --deduplication Bool
+OO: --type vdo-pool, OO_LVCONVERT_VDO, OO_LVCONVERT
+--name LV_new, --virtualsize SizeMB,
ID: lvconvert_to_vdopool_param
DESC: Convert LV to type vdopool.
RULE: all and lv_is_visible
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 8df30ff02..ef31799fa 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -5443,6 +5443,7 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
struct processing_handle *handle)
{
const char *vg_name = NULL;
+ unsigned int zero_vdopool;
struct volume_group *vg = lv->vg;
struct logical_volume *vdo_lv;
struct dm_vdo_target_params vdo_params; /* vdo */
@@ -5455,7 +5456,7 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
.permission = LVM_READ | LVM_WRITE,
.pool_name = lv->name,
.pvh = &vg->pvs,
- .read_ahead = DM_READ_AHEAD_AUTO,
+ .read_ahead = arg_uint_value(cmd, readahead_ARG, DM_READ_AHEAD_AUTO),
.stripes = 1,
.lv_name = arg_str_value(cmd, name_ARG, NULL),
};
@@ -5477,7 +5478,7 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
goto out;
}
- if (!fill_vdo_target_params(cmd, &vdo_params, NULL))
+ if (!fill_vdo_target_params(cmd, &vdo_params, vg->profile))
goto_out;
if (arg_is_set(cmd, compression_ARG))
@@ -5493,28 +5494,36 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
goto out;
}
- log_warn("WARNING: Converting logical volume %s to VDO pool volume.",
- lv->name);
- log_warn("THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)");
+ zero_vdopool = arg_int_value(cmd, zero_ARG, 1);
+
+ log_warn("WARNING: Converting logical volume %s to VDO pool volume %s formating.",
+ display_lvname(lv), zero_vdopool ? "with" : "WITHOUT");
+
+ if (zero_vdopool)
+ log_warn("THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)");
+ else
+ log_warn("WARNING: Using invalid VDO pool data MAY DESTROY YOUR DATA!");
if (!arg_count(cmd, yes_ARG) &&
yes_no_prompt("Do you really want to convert %s? [y/n]: ",
- lv->name) == 'n') {
+ display_lvname(lv)) == 'n') {
log_error("Conversion aborted.");
goto out;
}
- if (!wipe_lv(lv, (struct wipe_params) { .do_zero = 1, .do_wipe_signatures = 1,
- .yes = arg_count(cmd, yes_ARG),
- .force = arg_count(cmd, force_ARG)})) {
- log_error("Aborting. Failed to wipe VDO data store.");
- goto out;
+ if (zero_vdopool) {
+ if (!wipe_lv(lv, (struct wipe_params) { .do_zero = 1, .do_wipe_signatures = 1,
+ .yes = arg_count(cmd, yes_ARG),
+ .force = arg_count(cmd, force_ARG)})) {
+ log_error("Aborting. Failed to wipe VDO data store.");
+ goto out;
+ }
}
if (!archive(vg))
goto_out;
- if (!convert_vdo_pool_lv(lv, &vdo_params, &lvc.virtual_extents))
+ if (!convert_vdo_pool_lv(lv, &vdo_params, &lvc.virtual_extents, zero_vdopool))
goto_out;
dm_list_init(&lvc.tags);
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 5b7951f3b..560c78a77 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -2699,6 +2699,7 @@ static int _prepare_profiles(struct cmd_context *cmd)
* The --commandprofile is assumed otherwise.
*/
if (!strcmp(cmd->command->name, "lvcreate") ||
+ !strcmp(cmd->command->name, "lvconvert") ||
!strcmp(cmd->command->name, "vgcreate") ||
!strcmp(cmd->command->name, "lvchange") ||
!strcmp(cmd->command->name, "vgchange")) {
2 years, 9 months
main - lvchange: remove unneeded call
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f87ff95e329fce701ec...
Commit: f87ff95e329fce701ec93888a9bea7e7da7151a1
Parent: 096edeee718a4c5524e91fa613f015c9061d6a84
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Feb 14 17:27:45 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Feb 17 11:21:35 2021 +0100
lvchange: remove unneeded call
Sync is already happining in activate_and_wipe_lvlist().
---
tools/lvchange.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/tools/lvchange.c b/tools/lvchange.c
index f37b68381..31633987b 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -410,13 +410,6 @@ static int _lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
if (!activate_and_wipe_lvlist(&device_list, 0))
return 0;
- /* Wait until devices are away */
- if (!sync_local_dev_names(lv->vg->cmd)) {
- log_error("Failed to sync local devices after updating %s.",
- display_lvname(lv));
- return 0;
- }
-
/* Put metadata sub-LVs back in place */
if (!_attach_metadata_devices(seg, &device_list)) {
log_error("Failed to reattach %s device after clearing.",
2 years, 9 months
main - lv_manip: avoid removing LV when converting
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=096edeee718a4c5524e...
Commit: 096edeee718a4c5524e91fa613f015c9061d6a84
Parent: 3ef0861355ad70589959d1e92b53f91424197946
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Feb 17 11:09:41 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Feb 17 11:21:35 2021 +0100
lv_manip: avoid removing LV when converting
In some cases we use 'creation' also during conversion.
Here it can be actually unwanted side effect we may remove
not just newly created layers - but also original converted LV.
So until we make clear how to properly revert from some errors
in middle of conversion, disable removal for any 'lvconvert' commands.
---
lib/metadata/lv_manip.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 32bdc7990..5784e407d 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -8809,7 +8809,9 @@ revert_new_lv:
lockd_free_lv(vg->cmd, vg, lv->name, &lv->lvid.id[1], lv->lock_args);
/* FIXME Better to revert to backup of metadata? */
- if (!lv_remove(lv) || !vg_write(vg) || !vg_commit(vg))
+ /* Do not remove anything for create during conversion operation */
+ if (!strncmp(cmd->name, "lvconvert", 9) ||
+ !lv_remove(lv) || !vg_write(vg) || !vg_commit(vg))
log_error("Manual intervention may be required to remove "
"abandoned LV(s) before retrying.");
else
2 years, 9 months
main - tests: lvdisplay does not crash for merged thin
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3ef0861355ad7058995...
Commit: 3ef0861355ad70589959d1e92b53f91424197946
Parent: 14008ead2a42b4a5db0c81e444f9ea1a05c1a899
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 13 23:10:15 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Feb 17 11:21:35 2021 +0100
tests: lvdisplay does not crash for merged thin
---
test/shell/thin-merge.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/test/shell/thin-merge.sh b/test/shell/thin-merge.sh
index c0a022c57..34f5c7428 100644
--- a/test/shell/thin-merge.sh
+++ b/test/shell/thin-merge.sh
@@ -64,6 +64,9 @@ grep "Merging of thin snapshot $vg/snap will occur on next activation of $vg/${l
not lvconvert --merge $vg/snap1 &>out
grep "Cannot merge snapshot" out
+# Check lvdisplay is not crashing while merge needs to wait
+lvdisplay -a $vg
+
umount mnt
# Merge cannot happen
2 years, 9 months
main - lvdisplay: fix show of merged thin snapshot
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=14008ead2a42b4a5db0...
Commit: 14008ead2a42b4a5db0c81e444f9ea1a05c1a899
Parent: 3af61d8646765fea95a77618e9bfc7e1c35f7ea2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Feb 12 15:11:48 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Feb 17 11:21:35 2021 +0100
lvdisplay: fix show of merged thin snapshot
When lvdisplay was executed and thin snaphost has be merged to
thin origin and the operation has been postponed till devices
are closed, command crashed.
Check LV is COW before trying to check snapshot percentage.
---
lib/display/display.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/display/display.c b/lib/display/display.c
index a84695393..f0f03c0a5 100644
--- a/lib/display/display.c
+++ b/lib/display/display.c
@@ -475,7 +475,7 @@ int lvdisplay_full(struct cmd_context *cmd,
snap_active ? "active" : "INACTIVE");
}
snap_seg = NULL;
- } else if ((snap_seg = find_snapshot(lv))) {
+ } else if (lv_is_cow(lv) && (snap_seg = find_snapshot(lv))) {
if (inkernel &&
(snap_active = lv_snapshot_percent(snap_seg->cow,
&snap_percent)))
2 years, 9 months
main - tests: lvconvert thin profile conversion
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3af61d8646765fea95a...
Commit: 3af61d8646765fea95a77618e9bfc7e1c35f7ea2
Parent: 53666d6ee34260231b9589dddcdb28f77fdab506
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Feb 17 00:07:50 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Feb 17 11:21:35 2021 +0100
tests: lvconvert thin profile conversion
---
test/shell/profiles-thin.sh | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/test/shell/profiles-thin.sh b/test/shell/profiles-thin.sh
index 40059becc..c62a5f56f 100644
--- a/test/shell/profiles-thin.sh
+++ b/test/shell/profiles-thin.sh
@@ -59,6 +59,24 @@ check lv_field $vg/pool_performance profile "thin-performance"
$SHOULD check lv_field $vg/pool_performance chunk_size 1.00m
check lv_field $vg/pool_performance zero ""
+lvremove -f $vg
+
+#
+# Repeat same two creations via lvconvert
+#
+lvcreate -L8m --name pool_generic $vg
+lvconvert --yes --type thin-pool $vg/pool_generic
+check lv_field $vg/pool_generic chunk_size 64.00k
+check lv_field $vg/pool_generic zero "zero"
+
+
+lvcreate -L8m --name pool_performance $vg
+lvconvert --yes --type thin-pool --errorwhenfull y --profile thin-performance $vg/pool_performance
+check lv_field $vg/pool_performance profile "thin-performance"
+$SHOULD check lv_field $vg/pool_performance chunk_size 1.00m
+check lv_field $vg/pool_performance zero ""
+check lv_field $vg/pool_performance lv_when_full "error"
+
vgremove -ff $vg
if test -d "$DM_DEV_DIR/$vg" ; then
2 years, 9 months
main - lvconvert: thin errorwhenfull and recalculation
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=53666d6ee34260231b9...
Commit: 53666d6ee34260231b9589dddcdb28f77fdab506
Parent: 4486f08d51f4e6a6a47fa8cb484a70ca9a3ed541
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Feb 17 00:10:32 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Feb 17 11:21:35 2021 +0100
lvconvert: thin errorwhenfull and recalculation
When converting an existing LV to thin-pool,
user may now pass also '--errorwhenfull' option
like with 'lvcreate'.
Also recalculate chunksize when performace profile is
used with conversion (again matching lvcreate).
Adds missing flagging for uncropped metadata sizes.
---
tools/command-lines.in | 6 ++++--
tools/lvconvert.c | 13 +++++++++++++
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/tools/command-lines.in b/tools/command-lines.in
index c5c93abd3..7c7551405 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -318,6 +318,8 @@ OO_LVCONVERT_POOL: --poolmetadata LV, --poolmetadatasize SizeMB,
--poolmetadataspare Bool, --readahead Readahead, --chunksize SizeKB,
--zero Bool, --metadataprofile String
+OO_LVCONVERT_THIN: --discards Discards --errorwhenfull Bool
+
OO_LVCONVERT_CACHE: --cachemetadataformat CacheMetadataFormat,
--cachemode CacheMode, --cachepolicy String,
--cachesettings String, --zero Bool
@@ -514,7 +516,7 @@ RULE: all and lv_is_visible
lvconvert --type thin-pool LV_linear_striped_raid_cache
OO: --stripes_long Number, --stripesize SizeKB,
---discards Discards, OO_LVCONVERT_POOL, OO_LVCONVERT
+OO_LVCONVERT_THIN, OO_LVCONVERT_POOL, OO_LVCONVERT
OP: PV ...
ID: lvconvert_to_thinpool
DESC: Convert LV to type thin-pool.
@@ -546,7 +548,7 @@ RULE: --poolmetadata not --readahead --stripesize --stripes_long
lvconvert --thinpool LV_linear_striped_raid_cache_thinpool
OO: --type thin-pool, --stripes_long Number, --stripesize SizeKB,
---discards Discards, OO_LVCONVERT_POOL, OO_LVCONVERT
+OO_LVCONVERT_THIN, OO_LVCONVERT_POOL, OO_LVCONVERT
OP: PV ...
ID: lvconvert_to_thinpool_or_swap_metadata
DESC: Convert LV to type thin-pool (variant, use --type thin-pool).
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 77afaf487..8df30ff02 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3054,6 +3054,7 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
thin_crop_metadata_t crop_metadata;
thin_discards_t discards;
thin_zero_t zero_new_blocks;
+ int error_when_full;
int r = 0;
/* for handling lvmlockd cases */
@@ -3428,6 +3429,18 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
seg->chunk_size = chunk_size;
seg->discards = discards;
seg->zero_new_blocks = zero_new_blocks;
+ if (crop_metadata == THIN_CROP_METADATA_NO)
+ pool_lv->status |= LV_CROP_METADATA;
+ if (!recalculate_pool_chunk_size_with_dev_hints(pool_lv, chunk_calc))
+ goto_bad;
+
+ /* Error when full */
+ if (arg_is_set(cmd, errorwhenfull_ARG))
+ error_when_full = arg_uint_value(cmd, errorwhenfull_ARG, 0);
+ else
+ error_when_full = find_config_tree_bool(cmd, activation_error_when_full_CFG, vg->profile);
+ if (error_when_full)
+ pool_lv->status |= LV_ERROR_WHEN_FULL;
}
/*
2 years, 9 months
main - include lvm version in debug output
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4486f08d51f4e6a6a47...
Commit: 4486f08d51f4e6a6a47fa8cb484a70ca9a3ed541
Parent: c94d78f068653293e42f0fe815ddeef98406c666
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Feb 12 10:51:41 2021 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Feb 12 10:51:41 2021 -0600
include lvm version in debug output
---
tools/lvmcmdline.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 5e0edcade..5b7951f3b 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -3000,6 +3000,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
_get_current_output_settings_from_args(cmd);
_apply_current_output_settings(cmd);
+ log_debug("Version: %s", LVM_VERSION);
log_debug("Parsing: %s", cmd->cmd_line);
if (!(cmd->command = _find_command(cmd, cmd->name, &argc, argv)))
2 years, 9 months
main - scan: wipe filters when dropping scanned data
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c94d78f068653293e42...
Commit: c94d78f068653293e42f0fe815ddeef98406c666
Parent: f49bedc0295d4b038004adfda64fafcfa8b1d2c7
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Feb 10 14:06:58 2021 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Feb 10 15:34:45 2021 -0600
scan: wipe filters when dropping scanned data
Fix clearing persistent filter state when clearing all
the state from a label_scan.
label_scan reads devs and saves info in bcache, lvmcache,
and in the persistent filter. In some uncommon cases, an
lvm command wants to clear all info from a prior label_scan,
and repeat label_scan from scratch. In these cases, info
in lvmcache, bcache and the persistent filter all need to
be cleared before repeating label_scan.
By missing the persistent filter wiping, outdated persistent
filter info, from a prior label_scan, could cause lvm to
incorrectly filter devices that change between polling intervals.
(i.e. if the device changes in such a way that the filtering
results change.)
A case where lvm wants to do multiple label_scans is a
polling command (like lvconvert --merge), when lvmpolld
has been disabled, so that the command itself needs to
to do repeated polling checks.
---
lib/label/label.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/lib/label/label.c b/lib/label/label.c
index 030d2c578..0fc832c08 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -707,19 +707,6 @@ static int _scan_list(struct cmd_context *cmd, struct dev_filter *f,
if (!rem_prefetches)
break;
- /* FIXME: figure better solution to avoid opening DM we shouldn't open */
- if (dm_is_dm_major(MAJOR(devl->dev->dev)) &&
- !device_is_usable(devl->dev, (struct dev_usable_check_params) {
- .check_blocked = 1,
- .check_suspended = ignore_suspended_devices(),
- .check_reserved = 1,
- .check_error_target = 1,
- })) {
- log_debug_devs("Scan skips unusuable DM device %s.", dev_name(devl->dev));
- dm_list_del(&devl->list);
- continue;
- }
-
if (!_in_bcache(devl->dev)) {
if (!_scan_dev_open(devl->dev)) {
log_debug_devs("Scan failed to open %s.", dev_name(devl->dev));
@@ -1432,6 +1419,7 @@ void label_scan_drop(struct cmd_context *cmd)
return;
while ((dev = dev_iter_get(cmd, iter))) {
+ cmd->filter->wipe(cmd, cmd->filter, dev, NULL);
if (_in_bcache(dev))
_scan_dev_close(dev);
}
2 years, 9 months