stable-2.02 - raid: no wiping when zeroing raid metadata device
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c4202bf458751fcb646...
Commit: c4202bf458751fcb646aa411fa32cd0f91a72ce3
Parent: e397423c419ec5db4137dc671d366ba650be6dde
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jul 8 10:59:51 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 16:02:05 2020 +0200
raid: no wiping when zeroing raid metadata device
Currently lvm2 is not wiping signatures when creating 'metadata' volumes
and raid _rmeta was the only exception - so make the behavior consistent
with other metadata devices and drop wiping ATM.
Drop also some extra debug since they are now more explanatory in
wipe_lv() function.
Also note - although lvm2 now does not wipe signatures - the error
from such wipping used to be actually 'ignored' before wipe_lv()
started to return error (with recent commit) and raid creation
continued with 'unzeroed' metadata device.
TODO: Several issues to resolve:
1. We may want to flip to wipping with all LVs (in that case we need to
support passing --yet & --force).
2. Also we may want to clear whole metadata device - however current
function is also used for wipping i.e. snapshot COW device which
is likely not a good candidate for full device zeroing.
We may also need to think about better logic when extent size is
enforcing very large LVs, when only a small portion of LV is ever
being used.
3. Using TRIM instead of zeroing metadata device might be worth to
implement.
mm
---
lib/metadata/lv_manip.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 0b1fdce27..e7fd43945 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7304,12 +7304,10 @@ int activate_and_wipe_lvlist(struct dm_list *lv_list, int commit)
}
dm_list_iterate_items(lvl, lv_list) {
- log_verbose("Wiping metadata area %s.", display_lvname(lvl->lv));
/* Wipe any know signatures */
- if (!wipe_lv(lvl->lv, (struct wipe_params) { .do_wipe_signatures = 1, .do_zero = 1, .zero_sectors = 1 })) {
- log_error("Failed to wipe %s.", display_lvname(lvl->lv));
+ if (!wipe_lv(lvl->lv, (struct wipe_params) { .do_zero = 1 /* TODO: is_metadata = 1 */ })) {
r = 0;
- goto out;
+ goto_out;
}
}
out:
2 years, 5 months
stable-2.02 - bcache: support longer writes
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e397423c419ec5db413...
Commit: e397423c419ec5db4137dc671d366ba650be6dde
Parent: 3388779570924154e5e4f657889e121a4bd10e87
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 24 13:37:23 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 16:02:05 2020 +0200
bcache: support longer writes
When initiated larger write request, it may have happened, bcache
got out of free chunks - fix the loop, that is supposed to wait
until next free chunk becomes avain available.
---
WHATS_NEW | 1 +
lib/device/bcache.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 3db623d6c..7f5fad9ae 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.188 -
==================================
+ Fix running out of free buffers for async writing for larger writes.
Fix conversion to raid from striped lagging type.
Fix conversion to 'mirrored' mirror log with larger regionsize.
Fix support for lvconvert --repair used by foreign apps (i.e. Docker).
diff --git a/lib/device/bcache.c b/lib/device/bcache.c
index a74b6b315..03779a519 100644
--- a/lib/device/bcache.c
+++ b/lib/device/bcache.c
@@ -950,7 +950,7 @@ static struct block *_new_block(struct bcache *cache, int fd, block_address i, b
struct block *b;
b = _alloc_block(cache);
- while (!b && !dm_list_empty(&cache->clean)) {
+ while (!b) {
b = _find_unused_clean_block(cache);
if (!b) {
if (can_wait) {
2 years, 5 months
stable-2.02 - tests: add wait on udev processing
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3388779570924154e5e...
Commit: 3388779570924154e5e4f657889e121a4bd10e87
Parent: 3b995b8018435ebb51026b57ac536db2d535ec26
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 15 16:56:40 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 16:02:05 2020 +0200
tests: add wait on udev processing
Trying to avoid collision with udev watch rule preventing to
succeed 'dmsetup remove' because it keeps device open.
---
test/shell/thin-foreign-repair.sh | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/test/shell/thin-foreign-repair.sh b/test/shell/thin-foreign-repair.sh
index 147a9a073..55e9f62c6 100644
--- a/test/shell/thin-foreign-repair.sh
+++ b/test/shell/thin-foreign-repair.sh
@@ -17,9 +17,15 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
+clean_thin_()
+{
+ aux udev_wait
+ dmsetup remove "$THIN" || { sleep .5 ; dmsetup remove "$THIN" ; }
+}
+
cleanup_mounted_and_teardown()
{
- dmsetup remove $THIN || true
+ clean_thin_ || true
vgremove -ff $vg
aux teardown
}
@@ -56,7 +62,7 @@ dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/mapper/$POOL 0"
mkfs.ext4 "$DM_DEV_DIR/mapper/$THIN"
-dmsetup remove "$THIN"
+clean_thin_
lvchange -an $vg/pool
@@ -70,3 +76,5 @@ lvchange -ay $vg/pool
dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/mapper/$POOL 0"
fsck -n "$DM_DEV_DIR/mapper/$THIN"
+
+# exit calls cleanup_mounted_and_teardown
2 years, 5 months
stable-2.02 - cov: check strdup for NULL
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3b995b8018435ebb510...
Commit: 3b995b8018435ebb51026b57ac536db2d535ec26
Parent: 7e2ceba2fb6ea6769608858f7ce9a88e5ff3eb68
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 15 17:22:18 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 16:02:05 2020 +0200
cov: check strdup for NULL
---
tools/command.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/tools/command.c b/tools/command.c
index 523753250..2fef6a7a9 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -2298,7 +2298,8 @@ static void _print_val_man(struct command_name *cname, int opt_enum, int val_enu
}
if (strchr(str, '|')) {
- line = dm_strdup(str);
+ if (!(line = dm_strdup(str)))
+ return;
_split_line(line, &line_argc, line_argv, '|');
for (i = 0; i < line_argc; i++) {
if (i)
@@ -3550,9 +3551,12 @@ int main(int argc, char *argv[])
goto out_free;
}
- if (optind < argc)
- cmdname = strdup(argv[optind++]);
- else {
+ if (optind < argc) {
+ if (!(cmdname = strdup(argv[optind++]))) {
+ log_error("Out of memory.");
+ goto out_free;
+ }
+ } else {
log_error("Missing command name.");
goto out_free;
}
2 years, 5 months
master - make: generate
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b50134dc14296bf9bee...
Commit: b50134dc14296bf9bee96f3b4021ba5b123d54c9
Parent: 616e5b854c23a781372b2d05564959b4ba593069
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Thu Oct 15 11:16:54 2020 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Thu Oct 15 11:16:54 2020 +0200
make: generate
---
man/lvconvert.8_pregen | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/man/lvconvert.8_pregen b/man/lvconvert.8_pregen
index b3902a51c..9e22c85ff 100644
--- a/man/lvconvert.8_pregen
+++ b/man/lvconvert.8_pregen
@@ -929,6 +929,10 @@ Detach a cache from an LV.
\fBlvconvert\fP \fB--splitcache\fP \fILV\fP\fI_thinpool_cache_cachepool_vdopool_writecache\fP
.br
.RS 4
+.ad l
+[ \fB--cachesettings\fP \fIString\fP ]
+.ad b
+.br
[ COMMON_OPTIONS ]
.RE
.br
@@ -2004,6 +2008,10 @@ Detach and delete a cache from an LV.
\fBlvconvert\fP \fB--uncache\fP \fILV\fP\fI_thinpool_cache_vdopool_writecache\fP
.br
.RS 4
+.ad l
+[ \fB--cachesettings\fP \fIString\fP ]
+.ad b
+.br
[ COMMON_OPTIONS ]
.RE
.br
2 years, 5 months
master - gitignore: ignore gcov files
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=616e5b854c23a781372...
Commit: 616e5b854c23a781372b2d05564959b4ba593069
Parent: 53db14171c6b516058486b2a80eaa17af32a246b
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Thu Oct 15 11:13:13 2020 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Thu Oct 15 11:13:13 2020 +0200
gitignore: ignore gcov files
---
.gitignore | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.gitignore b/.gitignore
index cfd5bee1c..97a2a9b4b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,6 +38,10 @@ make.tmpl
coverity/coverity_model.xml
+# gcov files:
+*.gcda
+*.gcno
+
tools/man-generator
tools/man-generator.c
2 years, 5 months
master - Revert "tests: Adapt RAID test to changes"
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=53db14171c6b5160584...
Commit: 53db14171c6b516058486b2a80eaa17af32a246b
Parent: ee43ec5782c3fe23b99e84da86fa3f43d3eb1c56
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Tue Oct 13 13:15:16 2020 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Tue Oct 13 13:15:16 2020 +0200
Revert "tests: Adapt RAID test to changes"
The cpnversion of degraded RAID should still report a failure.
This reverts commit e12bdd591a1e60f055baee6cf5e9a144ea245a33.
---
test/shell/lvconvert-m-raid1-degraded.sh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/test/shell/lvconvert-m-raid1-degraded.sh b/test/shell/lvconvert-m-raid1-degraded.sh
index c3f70855e..05c3e893c 100644
--- a/test/shell/lvconvert-m-raid1-degraded.sh
+++ b/test/shell/lvconvert-m-raid1-degraded.sh
@@ -33,10 +33,8 @@ aux disable_dev "$dev1"
vgreduce --force --removemissing $vg
check raid_leg_status $vg $lv "DA"
-# Conversion to 2 legs does nothing on degraded 2-legged raid1 LV
-lvconvert -y -m1 $vg/$lv 2>&1 | tee out
-grep "already has 2 images" out
-# Check it remains degraded after the successful "conversion"
+# Conversion to 2 legs must fail on degraded 2-legged raid1 LV
+not lvconvert -y -m1 $vg/$lv
check raid_leg_status $vg $lv "DA"
# Repair has to succeed
2 years, 5 months
master - rpm: bare words are no longer supported
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ee43ec5782c3fe23b99...
Commit: ee43ec5782c3fe23b99e84da86fa3f43d3eb1c56
Parent: 99b6173f10fe7e2dbd54bb8734667ca8df69905e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 2 22:13:51 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 2 22:27:00 2020 +0200
rpm: bare words are no longer supported
Update for new rpm requirement and use "..." words.
---
spec/macros.inc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/spec/macros.inc b/spec/macros.inc
index 99ee9a06a..d4e99e6ae 100644
--- a/spec/macros.inc
+++ b/spec/macros.inc
@@ -58,11 +58,11 @@ fi \
%%if %%{enable_systemd} \
if [ $1 = 0 ]; then \
systemctl --no-reload disable lvm2-%%{-s*}.%%{-t*} > /dev/null 2>&1 || : \
- %%if %%{-t*} == socket \
+ %%if "%%{-t*}" == "socket" \
systemctl --no-reload disable lvm2-%%{-s*}.service > /dev/null 2>&1 || : \
%%endif \
systemctl stop lvm2-%%{-s*}.%%{-t*} > /dev/null 2>&1 || : \
- %%if %%{-t*} == socket \
+ %%if "%%{-t*}" == "socket" \
systemctl stop lvm2-%%{-s*}.service > /dev/null 2>&1 || : \
%%endif \
fi \
2 years, 5 months
master - tests: enable tests for lvmlockd
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=99b6173f10fe7e2dbd5...
Commit: 99b6173f10fe7e2dbd54bb8734667ca8df69905e
Parent: 5e26a2b74d14bebeeba20ec5b082fac752cc7236
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 2 21:35:44 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 2 22:27:00 2020 +0200
tests: enable tests for lvmlockd
---
test/shell/lvconvert-snapshot.sh | 3 +--
test/shell/lvconvert-thin.sh | 5 ++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/test/shell/lvconvert-snapshot.sh b/test/shell/lvconvert-snapshot.sh
index 9a32776e9..15299dff0 100644
--- a/test/shell/lvconvert-snapshot.sh
+++ b/test/shell/lvconvert-snapshot.sh
@@ -12,7 +12,6 @@
# Test various supported conversion of snapshot
-SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
. lib/inittest
@@ -20,7 +19,7 @@ SKIP_WITH_LVMPOLLD=1
aux prepare_pvs 2
get_devs
-vgcreate -s 4k "$vg" "${DEVICES[@]}"
+vgcreate $SHARED -s 4k "$vg" "${DEVICES[@]}"
lvcreate --type snapshot -V50 -L1 -n $lv1 -s $vg
diff --git a/test/shell/lvconvert-thin.sh b/test/shell/lvconvert-thin.sh
index 1f8d2edb9..131965508 100644
--- a/test/shell/lvconvert-thin.sh
+++ b/test/shell/lvconvert-thin.sh
@@ -10,7 +10,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-SKIP_WITH_LVMLOCKD=1
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
@@ -32,7 +31,7 @@ aux prepare_pvs 4 64
get_devs
# build one large PV
-vgcreate $vg1 "$dev1" "$dev2" "$dev3"
+vgcreate $SHARED $vg1 "$dev1" "$dev2" "$dev3"
# 32bit linux kernels are fragille with device size >= 16T
# maybe uname -m [ x86_64 | i686 ]
@@ -42,7 +41,7 @@ lvcreate --type snapshot -l 100%FREE -n $lv $vg1 --virtualsize $TSIZE
aux extend_filter_LVMTEST
pvcreate "$DM_DEV_DIR/$vg1/$lv"
-vgcreate $vg -s 64K "$dev4" "$DM_DEV_DIR/$vg1/$lv"
+vgcreate $SHARED -s 64K $vg "$dev4" "$DM_DEV_DIR/$vg1/$lv"
lvcreate -L1T -n $lv1 $vg
invalid lvconvert --yes -c 8M --type thin --poolmetadatasize 1G $vg/$lv1
2 years, 5 months
master - tests: aux hides zero and error device
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5e26a2b74d14bebeeba...
Commit: 5e26a2b74d14bebeeba20ec5b082fac752cc7236
Parent: 8d9b4c624f5738035ef9a7af19cb85b6960ca080
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 2 19:19:30 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 2 22:27:00 2020 +0200
tests: aux hides zero and error device
When ERR_DEV and ZERO_DEV are used, they are automatically
taken down when the last user no longer needs them,
so hide them from 'forgotten' device check.
---
test/lib/aux.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 02989c5cb..5dbb580be 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -516,14 +516,14 @@ teardown() {
echo -n "## teardown..."
unset LVM_LOG_FILE_EPOCH
- test ! -f ERR_DEV || should dmsetup remove $(cat ERR_DEV_NAME)
- test ! -f ZERO_DEV || should dmsetup remove $(cat ZERO_DEV_NAME)
-
if test -f TESTNAME ; then
if test ! -f SKIP_THIS_TEST ; then
# Evaluate left devices only for non-skipped tests
- TEST_LEAKED_DEVICES=$(dmsetup table | grep "$PREFIX" | grep -Ev "${PREFIX}(pv|[0-9])") || true
+ TEST_LEAKED_DEVICES=$(dmsetup table | grep "$PREFIX" | \
+ grep -Ev "${PREFIX}(pv|[0-9])" | \
+ grep -v "$(cat ERR_DEV_NAME 2>/dev/null)" | \
+ grep -v "$(cat ZERO_DEV_NAME 2>/dev/null)") || true
fi
kill_tagged_processes
2 years, 5 months