main - WHATS_NEW: updates
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f7d9542aed2615c2a37...
Commit: f7d9542aed2615c2a3737ec055a15b79877ac7fc
Parent: 5d820b02012bbadb07990ee20034145ab8e2fb0e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Feb 23 15:00:17 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 23 15:01:05 2021 +0100
WHATS_NEW: updates
---
WHATS_NEW | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 21684992d..ff4120a47 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.03.12 -
===================================
+ Support extension of writecached volumes.
+ Fix problem with unbound variable usage within fsadm.
Check for presence of VDO target before starting any conversion.
Support metatadata profiles with volume VDO pool conversions.
Support -Zn for conversion of already formated VDO pools.
@@ -29,7 +31,7 @@ Version 2.03.11 - 08th January 2021
===================================
Fix pvck handling MDA at offset different from 4096.
Partial or degraded activation of writecache is not allowed.
- Enhance error handling for fsadm and hanled correct fsck result.
+ Enhance error handling for fsadm and handle correct fsck result.
Dmeventd lvm plugin ignores higher reserved_stack lvm.conf values.
Support using BLKZEROOUT for clearing devices.
Support interruption when wipping LVs.
3 years, 1 month
main - cleanup: comment typo
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5d820b02012bbadb079...
Commit: 5d820b02012bbadb07990ee20034145ab8e2fb0e
Parent: 0c842ee8adc4f5566e49b59abee5d43a15b85f0c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 20 23:50:25 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 23 14:56:48 2021 +0100
cleanup: comment typo
---
lib/metadata/cache_manip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c
index f29442358..3eac736dd 100644
--- a/lib/metadata/cache_manip.c
+++ b/lib/metadata/cache_manip.c
@@ -656,7 +656,7 @@ int lv_cache_remove(struct logical_volume *cache_lv)
if (!remove_layer_from_lv(cache_lv, corigin_lv))
return_0;
- /* Preserve currently imortant data from original cache segment.
+ /* Preserve currently important data from original cache segment.
* TODO: can it be done without this ? */
data_id = cache_seg->data_id;
data_len = cache_seg->data_len;
3 years, 1 month
main - cleanup: improving message
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0c842ee8adc4f5566e4...
Commit: 0c842ee8adc4f5566e49b59abee5d43a15b85f0c
Parent: 5237175cb6486c782589d7c9afb4f532ee5897b1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 20 23:23:00 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 23 14:56:48 2021 +0100
cleanup: improving message
lvconvert -Z can be used with snaps & pools.
---
tools/lvconvert.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index a67b4ee72..87539be49 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -255,7 +255,7 @@ static int _read_params(struct cmd_context *cmd, struct lvconvert_params *lp)
}
if (arg_is_set(cmd, zero_ARG)) {
- log_error("--zero is only available with snapshots or thin pools.");
+ log_error("--zero is only available with snapshots or pools.");
return 0;
}
3 years, 1 month
main - cleanup: simplify initilization
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5237175cb6486c78258...
Commit: 5237175cb6486c782589d7c9afb4f532ee5897b1
Parent: b5f906e984abea169209302b78bfa935869d6ea4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 20 22:44:06 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 23 14:56:48 2021 +0100
cleanup: simplify initilization
Simplier code and also drop duplicate check for active LV.
---
tools/lvconvert.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 4dee97ee0..a67b4ee72 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -6126,7 +6126,7 @@ int lvconvert_writecache_attach_single(struct cmd_context *cmd,
struct volume_group *vg = lv->vg;
struct logical_volume *lv_wcorig;
struct logical_volume *lv_fast;
- struct writecache_settings settings;
+ struct writecache_settings settings = { 0 };
const char *fast_name;
uint32_t block_size_sectors = 0;
char *lockd_fast_args = NULL;
@@ -6181,10 +6181,6 @@ int lvconvert_writecache_attach_single(struct cmd_context *cmd,
is_active = lv_is_active(lv);
- is_active = lv_is_active(lv);
-
- memset(&settings, 0, sizeof(settings));
-
if (!get_writecache_settings(cmd, &settings, &block_size_sectors)) {
log_error("Invalid writecache settings.");
goto bad;
3 years, 1 month
main - cleanup: simply code
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b5f906e984abea16920...
Commit: b5f906e984abea169209302b78bfa935869d6ea4
Parent: 5ecd65e6f2f5264b0ebe1177a714bc8d29e882fb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 20 22:11:30 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 23 14:56:48 2021 +0100
cleanup: simply code
---
tools/lvresize.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/lvresize.c b/tools/lvresize.c
index 0c72a81ff..a3c17a744 100644
--- a/tools/lvresize.c
+++ b/tools/lvresize.c
@@ -146,14 +146,6 @@ static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv,
lp->argc = --argc;
lp->argv = ++argv;
- lp->alloc = (alloc_policy_t) arg_uint_value(cmd, alloc_ARG, 0);
- lp->yes = arg_is_set(cmd, yes_ARG);
- lp->force = arg_is_set(cmd, force_ARG);
- lp->nofsck = arg_is_set(cmd, nofsck_ARG);
- lp->nosync = arg_is_set(cmd, nosync_ARG);
- lp->resizefs = arg_is_set(cmd, resizefs_ARG);
- lp->lockopt = arg_str_value(cmd, lockopt_ARG, NULL);
-
return 1;
}
@@ -186,7 +178,15 @@ out:
int lvresize(struct cmd_context *cmd, int argc, char **argv)
{
struct processing_handle *handle;
- struct lvresize_params lp = { 0 };
+ struct lvresize_params lp = {
+ .alloc = (alloc_policy_t) arg_uint_value(cmd, alloc_ARG, 0),
+ .yes = arg_is_set(cmd, yes_ARG),
+ .force = arg_is_set(cmd, force_ARG),
+ .nofsck = arg_is_set(cmd, nofsck_ARG),
+ .nosync = arg_is_set(cmd, nosync_ARG),
+ .resizefs = arg_is_set(cmd, resizefs_ARG),
+ .lockopt = arg_str_value(cmd, lockopt_ARG, NULL),
+ };
int ret;
if (!_lvresize_params(cmd, argc, argv, &lp)) {
3 years, 1 month
main - lvconvert: change errors to internal ones
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5ecd65e6f2f5264b0eb...
Commit: 5ecd65e6f2f5264b0ebe1177a714bc8d29e882fb
Parent: b140bba9fe69f3bd4c89f15998b3e197fe9bf428
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 20 23:01:25 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 23 14:56:47 2021 +0100
lvconvert: change errors to internal ones
Since these errors should never happen, change them to internal errors.
---
tools/lvconvert.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 83bdfd04b..4dee97ee0 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4693,12 +4693,12 @@ static int _lvconvert_to_thin_with_external_single(struct cmd_context *cmd,
}
if (!(thinpool_lv = find_lv(vg, thinpool_name))) {
- log_error("LV %s cannot be found.", display_lvname(thinpool_lv));
+ log_error(INTERNAL_ERROR "LV %s cannot be found.", thinpool_name);
goto out;
}
if (!lv_is_thin_pool(thinpool_lv)) {
- log_error("LV %s is not a thin pool.", display_lvname(thinpool_lv));
+ log_error(INTERNAL_ERROR "LV %s is not a thin pool.", display_lvname(thinpool_lv));
goto out;
}
}
3 years, 1 month
main - cache: fix warning test
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b140bba9fe69f3bd4c8...
Commit: b140bba9fe69f3bd4c89f15998b3e197fe9bf428
Parent: ac09fa08aa7a10cc3f807830de5d625d499ed1b1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 20 22:45:13 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 23 14:56:47 2021 +0100
cache: fix warning test
The cache here is not 'writethough' - so print proper state
(writeback or passthrough)
---
tools/lvconvert.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 8bd73bb53..83bdfd04b 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -2032,8 +2032,8 @@ static int _lvconvert_split_and_remove_cachepool(struct cmd_context *cmd,
display_lvname(lv));
return 0;
}
- log_warn("WARNING: Uncaching of partially missing writethrough cache volume %s might destroy your data.",
- display_lvname(lv));
+ log_warn("WARNING: Uncaching of partially missing %s cache volume %s might destroy your data.",
+ cache_mode_num_to_str(first_seg(seg->pool_lv)->cache_mode), display_lvname(lv));
}
if (!arg_count(cmd, yes_ARG) &&
3 years, 1 month
main - lvextend: enable resize of writecached LV
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ac09fa08aa7a10cc3f8...
Commit: ac09fa08aa7a10cc3f807830de5d625d499ed1b1
Parent: e43b5f1e3c8b445577b9aebea9afecbe0e9ab9c7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 20 22:22:51 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 23 14:56:47 2021 +0100
lvextend: enable resize of writecached LV
---
lib/metadata/lv_manip.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 5cad4e07a..9bcab7477 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -1465,7 +1465,8 @@ static struct logical_volume *_get_resizable_layer_lv(struct logical_volume *lv)
while (lv_is_cache(lv) || /* _corig */
lv_is_integrity(lv) ||
lv_is_thin_pool(lv) || /* _tdata */
- lv_is_vdo_pool(lv)) /* _vdata */
+ lv_is_vdo_pool(lv) || /* _vdata */
+ lv_is_writecache(lv)) /* _worigin */
lv = seg_lv(first_seg(lv), 0); /* component-level down */
return lv;
@@ -1479,7 +1480,8 @@ static int _is_layered_lv(struct logical_volume *lv)
return (lv_is_cache_origin(lv) ||
lv_is_integrity_origin(lv) ||
lv_is_thin_pool_data(lv) ||
- lv_is_vdo_pool_data(lv));
+ lv_is_vdo_pool_data(lv) ||
+ lv_is_writecache_origin(lv));
}
/* Find the topmost LV in the stack - usually such LV is visible. */
@@ -5173,11 +5175,6 @@ static int _lvresize_check(struct logical_volume *lv,
struct volume_group *vg = lv->vg;
struct lv_segment *seg = first_seg(lv);
- if (lv_is_writecache(lv)) {
- log_error("Resize not yet allowed on LVs with writecache attached.");
- return 0;
- }
-
if (lv_is_external_origin(lv)) {
/*
* Since external-origin can be activated read-only,
@@ -5803,6 +5800,11 @@ static int _lvresize_check_type(const struct logical_volume *lv,
display_lvname(lv));
return 0;
}
+ if (lv_is_writecache(lv)) {
+ /* TODO: detect kernel with support for reduction */
+ log_error("Reduce not yet allowed on LVs with writecache attached.");
+ return 0;
+ }
} else if (lp->resize == LV_EXTEND) {
if (lv_is_thin_pool_metadata(lv) &&
(!(seg = find_pool_seg(first_seg(lv))) ||
3 years, 1 month
main - tests: remove local setting of LVM_BINARY
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e43b5f1e3c8b445577b...
Commit: e43b5f1e3c8b445577b9aebea9afecbe0e9ab9c7
Parent: 646e3280ddf5e73040e12122b8a7a2fad52668a0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Feb 23 14:42:47 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 23 14:56:47 2021 +0100
tests: remove local setting of LVM_BINARY
To better test actually fsadm in test suite - avoid setting
LVM_BINARY locally - since test setup already modifies
PATH to find test's lvm binary as the 1st. in path.
---
test/shell/fsadm-crypt.sh | 3 ---
test/shell/fsadm-renamed.sh | 3 ---
test/shell/fsadm.sh | 3 ---
test/shell/lvresize-full.sh | 2 --
4 files changed, 11 deletions(-)
diff --git a/test/shell/fsadm-crypt.sh b/test/shell/fsadm-crypt.sh
index 4b8fc4e2d..2004db957 100644
--- a/test/shell/fsadm-crypt.sh
+++ b/test/shell/fsadm-crypt.sh
@@ -76,9 +76,6 @@ dev_vg_lv="$DM_DEV_DIR/$vg_lv"
dev_vg_lv2="$DM_DEV_DIR/$vg_lv2"
dev_vg_lv3="$DM_DEV_DIR/$vg_lv3"
mount_dir="mnt"
-# for recursive call
-LVM_BINARY=$(which lvm)
-export LVM_BINARY
test ! -d "$mount_dir" && mkdir "$mount_dir"
diff --git a/test/shell/fsadm-renamed.sh b/test/shell/fsadm-renamed.sh
index 321893925..50c6d3ee5 100644
--- a/test/shell/fsadm-renamed.sh
+++ b/test/shell/fsadm-renamed.sh
@@ -27,9 +27,6 @@ dev_vg_lv_ren="$DM_DEV_DIR/$vg_lv_ren"
mount_dir="mnt"
mount_space_dir="mnt space dir"
mount_dolar_dir="mnt \$SPACE dir"
-# for recursive call
-LVM_BINARY=$(which lvm)
-export LVM_BINARY
test ! -d "$mount_dir" && mkdir "$mount_dir"
test ! -d "$mount_space_dir" && mkdir "$mount_space_dir"
diff --git a/test/shell/fsadm.sh b/test/shell/fsadm.sh
index 67f9660e6..987b1a1a9 100644
--- a/test/shell/fsadm.sh
+++ b/test/shell/fsadm.sh
@@ -45,9 +45,6 @@ dev_vg_lv="$DM_DEV_DIR/$vg_lv"
dev_vg_lv2="$DM_DEV_DIR/$vg_lv2"
mount_dir="mnt"
mount_space_dir="mnt space dir"
-# for recursive call
-LVM_BINARY=$(which lvm)
-export LVM_BINARY
test ! -d "$mount_dir" && mkdir "$mount_dir"
test ! -d "$mount_space_dir" && mkdir "$mount_space_dir"
diff --git a/test/shell/lvresize-full.sh b/test/shell/lvresize-full.sh
index 3cab52275..dcf93a7b2 100644
--- a/test/shell/lvresize-full.sh
+++ b/test/shell/lvresize-full.sh
@@ -21,8 +21,6 @@ SKIP_WITH_LVMPOLLD=1
FSCK=${FSCK-fsck}
MKFS=${MKFS-mkfs.ext3}
RESIZEFS=${RESIZEFS-resize2fs}
-LVM_BINARY=$(which lvm)
-export LVM_BINARY
which $FSCK || skip
which $MKFS || skip
3 years, 1 month
main - fsadm: avoid access to unbound variable
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=646e3280ddf5e73040e...
Commit: 646e3280ddf5e73040e12122b8a7a2fad52668a0
Parent: 9e836c77a0663649468af613436c210e3ba324b2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Feb 23 14:14:16 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 23 14:56:47 2021 +0100
fsadm: avoid access to unbound variable
---
scripts/fsadm.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 2cb1fc75b..4f59cee13 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -163,7 +163,7 @@ cleanup() {
_FSADM_EXTOFF=$EXTOFF
export _FSADM_YES _FSADM_EXTOFF
unset FSADM_RUNNING
- test -n "$LVM_BINARY" && PATH=$_SAVEPATH
+ test -n "${LVM_BINARY-}" && PATH=$_SAVEPATH
dry exec "$LVM" lvresize $VERB $FORCE -r -L"${NEWSIZE_ORIG}b" "$VOLUME_ORIG"
fi
3 years, 1 month