stable-2.02 - tests: a bit bigger mirrors
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e05c882ab5a2ef55ff8...
Commit: e05c882ab5a2ef55ff86fc326f845220c34504b0
Parent: d76b5f43083cd0667c3f55b5dd72edd134144a3d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Sep 23 14:06:19 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 18:09:55 2020 +0200
tests: a bit bigger mirrors
Seems even with throttling we occasinally need slightly more.
---
test/shell/lvconvert-mirror.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvconvert-mirror.sh b/test/shell/lvconvert-mirror.sh
index 87993dab1..0456f62f8 100644
--- a/test/shell/lvconvert-mirror.sh
+++ b/test/shell/lvconvert-mirror.sh
@@ -324,7 +324,7 @@ SHOULD=
aux throttle_dm_mirror || SHOULD=should
# Use large enough mirror that takes time to sychronize with small regionsize
-lvcreate -aey -L20 -Zn -Wn --type mirror --regionsize 16k -m2 -n $lv1 $vg "$dev1" "$dev2" "$dev4" "$dev3:$DEVRANGE"
+lvcreate -aey -L30 -Zn -Wn --type mirror --regionsize 16k -m2 -n $lv1 $vg "$dev1" "$dev2" "$dev4" "$dev3:$DEVRANGE"
$SHOULD not lvconvert -m-1 $vg/$lv1 "$dev1" 2>&1 | tee out
aux restore_dm_mirror
grep "not in-sync" out
@@ -342,7 +342,7 @@ lvremove -ff $vg
aux throttle_dm_mirror || :
# No parallel lvconverts on a single LV please
# Use big enough mirror size and small regionsize to run on all test machines succesfully
-lvcreate -aey -Zn -Wn -L20 --type mirror --regionsize 16k -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:0-8"
+lvcreate -aey -Zn -Wn -L30 --type mirror --regionsize 16k -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:0-8"
check mirror $vg $lv1
check mirror_legs $vg $lv1 2
3 years, 6 months
stable-2.02 - tests: use aux wrapper and add more notes
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d76b5f43083cd0667c3...
Commit: d76b5f43083cd0667c3f55b5dd72edd134144a3d
Parent: de1b894337759c574f5e1cf11dcd40ef765d6ad2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 22 16:27:21 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 18:09:55 2020 +0200
tests: use aux wrapper and add more notes
This test seems to be hitting some corner case in handling
out-of-metadata space condintion in thin-pool.
Add few more aid notes and functionality.
Also add missing '|| true' with now direct-IO dd command.
---
test/shell/thin-flags.sh | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/test/shell/thin-flags.sh b/test/shell/thin-flags.sh
index df139b211..78a4b2cd7 100644
--- a/test/shell/thin-flags.sh
+++ b/test/shell/thin-flags.sh
@@ -47,7 +47,7 @@ lvchange -an $vg
# Overfill data area
lvchange -ay $vg
-dd if=/dev/zero of="$DM_DEV_DIR/mapper/$vg-$lv2" bs=1M count=2 oflag=direct
+dd if=/dev/zero of="$DM_DEV_DIR/mapper/$vg-$lv2" bs=1M count=2 oflag=direct || true
check lv_attr_bit health $vg/pool "D"
# TODO use spaces ??
check lv_field $vg/pool lv_health_status "out_of_data"
@@ -67,8 +67,15 @@ lvchange -an $vg
aux lvmconf 'global/thin_check_executable = ""'
# Prepare some fake metadata prefilled to ~100%
-lvcreate -L2 -n $lv1 $vg # tmp for metadata
-aux prepare_thin_metadata 490 1 | tee data
+lvcreate -L2 -n $lv1 $vg "$dev2" # tmp for metadata
+
+VOLS=490
+aux thin_restore_needs_more_volumes || VOLS=445
+aux prepare_thin_metadata $VOLS 1 | tee data
+
+# Note: we like want to test BOTH sizes (445 & 490) as ATM it gives
+# different errors (5.9-rc5 kernel does not handle it as expected by this test)
+
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
# Swap volume with restored fake metadata
@@ -78,13 +85,18 @@ lvchange -ay $vg
lvchange -ay $vg/$lv2
# Provisiong and last free bits in metadata
-dd if=/dev/zero of="$DM_DEV_DIR/mapper/$vg-$lv2" bs=32K count=1 oflag=direct
+dd if=/dev/zero of="$DM_DEV_DIR/mapper/$vg-$lv2" bs=1M count=1 oflag=direct || true
check lv_attr_bit health $vg/pool "M"
# TODO - use spaces ??
check lv_field $vg/pool lv_health_status "metadata_read_only"
check lv_attr_bit health $vg/$lv2 "-"
+not lvcreate -s $vg/$lv2
+not lvcreate -V10 -n $lv3 $vg/pool
+
+lvs -ao+seg_pe_ranges $vg
+
# needs_check needs newer version
if aux have_thin 1 16 0 ; then
check lv_attr_bit state $vg/pool "c"
3 years, 6 months
stable-2.02 - tests: move function to aux for reuse
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=de1b894337759c574f5...
Commit: de1b894337759c574f5e1cf11dcd40ef765d6ad2
Parent: c68380746ab82a5c2517c71435daf830fa158a6f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 22 23:37:50 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 18:09:55 2020 +0200
tests: move function to aux for reuse
---
test/lib/aux.sh | 8 ++++++++
test/shell/lvextend-thin-metadata-dmeventd.sh | 5 +----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 8758dc01d..1a66df16e 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1504,6 +1504,14 @@ thin_pool_error_works_32() {
esac
}
+thin_restore_needs_more_volumes() {
+ case $("$LVM_TEST_THIN_RESTORE_CMD" -V) in
+ # With older version of thin-tool we got slightly more compact metadata
+ 0.[0-6]*|0.7.0*) return 0 ;;
+ esac
+ return 1
+}
+
udev_wait() {
pgrep udev >/dev/null || return 0
which udevadm &>/dev/null || return 0
diff --git a/test/shell/lvextend-thin-metadata-dmeventd.sh b/test/shell/lvextend-thin-metadata-dmeventd.sh
index 5f6db994a..3193cc29c 100644
--- a/test/shell/lvextend-thin-metadata-dmeventd.sh
+++ b/test/shell/lvextend-thin-metadata-dmeventd.sh
@@ -61,10 +61,7 @@ test -n "$LVM_TEST_THIN_RESTORE_CMD" || LVM_TEST_THIN_RESTORE_CMD=$(which thin_r
aux have_thin 1 10 0 || skip
BIG_DATA=""
-case $("$LVM_TEST_THIN_RESTORE_CMD" -V) in
- # With older version of thin-tool we got slightly more compact metadata
- 0.[0-6]*|0.7.0*) BIG_DATA="generate_more_metadata" ;;
-esac
+aux thin_restore_needs_more_volumes && BIG_DATA="generate_more_metadata"
aux prepare_dmeventd
3 years, 6 months
stable-2.02 - debug: no backtrace
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c68380746ab82a5c251...
Commit: c68380746ab82a5c2517c71435daf830fa158a6f
Parent: b97440290c952c33e32f86f7d4b0e47ed6e30d4d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 2 11:14:18 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 18:09:55 2020 +0200
debug: no backtrace
As the path already printed verbose message drop backtrace.
---
lib/label/label.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/label/label.c b/lib/label/label.c
index 7cebbdcf9..019fd09ca 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -412,7 +412,7 @@ static int _process_block(struct cmd_context *cmd, struct dev_filter *f,
lvmcache_del_dev(dev); /* FIXME: if this is needed, fix it. */
*is_lvm_device = 0;
- goto_out;
+ goto out;
}
*is_lvm_device = 1;
3 years, 6 months
stable-2.02 - debug: show actually reason for taking this code path
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b97440290c952c33e32...
Commit: b97440290c952c33e32f86f7d4b0e47ed6e30d4d
Parent: 03bddd7d41bc644dfe6498c3b2d0d412190f2e5e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 2 11:12:49 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 18:09:55 2020 +0200
debug: show actually reason for taking this code path
Instead of not so useful backtrace, report what was the reason.
---
lib/format_text/format-text.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 225d6424c..20eeb0854 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -2075,8 +2075,10 @@ static int _create_vg_text_instance(struct format_instance *fid,
}
if (type & FMT_INSTANCE_MDAS) {
- if (!(vginfo = lvmcache_vginfo_from_vgname(vg_name, vg_id)))
- goto_out;
+ if (!(vginfo = lvmcache_vginfo_from_vgname(vg_name, vg_id))) {
+ log_debug("No cached vginfo for VG %s and ID %s.", vg_name, vg_id);
+ goto out;
+ }
if (!lvmcache_fid_add_mdas_vg(vginfo, fid))
goto_out;
}
3 years, 6 months
stable-2.02 - debug: remove stacktrace on regular path
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=03bddd7d41bc644dfe6...
Commit: 03bddd7d41bc644dfe6498c3b2d0d412190f2e5e
Parent: e8df5038853b927fefc83e4ae75a38411cc2d865
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Sep 26 14:52:27 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 18:09:55 2020 +0200
debug: remove stacktrace on regular path
Here _insert is expected to also fail, so just regular 'return 0'.
---
lib/device/dev-cache.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 3e8105be7..de4ec65aa 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -1193,13 +1193,13 @@ static int _insert(const char *path, const struct stat *info,
}
if (rec && !_insert_dir(path))
- return_0;
+ return 0;
} else { /* add a device */
if (!S_ISBLK(info->st_mode))
return 1;
if (!_insert_dev(path, info->st_rdev))
- return_0;
+ return 0;
}
return 1;
3 years, 6 months
stable-2.02 - bcache: use flexible arrays
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e8df5038853b927fefc...
Commit: e8df5038853b927fefc83e4ae75a38411cc2d865
Parent: 479f0822ad1074cab4bcb1b5404257618cce14b3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Sep 30 23:28:44 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 18:09:55 2020 +0200
bcache: use flexible arrays
Cleanup, allocate whole struct with a single malloc call.
---
lib/device/bcache.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/lib/device/bcache.c b/lib/device/bcache.c
index f68576a55..28fb42133 100644
--- a/lib/device/bcache.c
+++ b/lib/device/bcache.c
@@ -61,23 +61,17 @@ struct control_block {
struct cb_set {
struct dm_list free;
struct dm_list allocated;
- struct control_block *vec;
+ struct control_block vec[];
} control_block_set;
static struct cb_set *_cb_set_create(unsigned nr)
{
unsigned i;
- struct cb_set *cbs = malloc(sizeof(*cbs));
+ struct cb_set *cbs = malloc(sizeof(*cbs) + nr * sizeof(*cbs->vec));
- if (!cbs)
+ if (!cbs->vec)
return NULL;
- cbs->vec = malloc(nr * sizeof(*cbs->vec));
- if (!cbs->vec) {
- free(cbs);
- return NULL;
- }
-
dm_list_init(&cbs->free);
dm_list_init(&cbs->allocated);
@@ -97,7 +91,6 @@ static void _cb_set_destroy(struct cb_set *cbs)
return;
}
- free(cbs->vec);
free(cbs);
}
3 years, 6 months
stable-2.02 - bcache: support interrupts when waiting on IO
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=479f0822ad1074cab4b...
Commit: 479f0822ad1074cab4bcb1b5404257618cce14b3
Parent: 5e64aa222b106ef3bd091346ebba807e10dc449e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 2 17:16:14 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 18:09:55 2020 +0200
bcache: support interrupts when waiting on IO
Since lvm2 normally block signals during protected
phase where it does not want to be interrupted.
Support interruptible processing when allowed
in section between sigint_allow() ... sigint_restore())
and let the 'io_getenvents()' finish with EINTR.
---
WHATS_NEW | 1 +
lib/device/bcache.c | 4 +---
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 2cfb79ba0..dfaec8c53 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.188 -
==================================
+ Support interruption for bcache waiting.
Fix bcache when device has too many failing writes.
Fix bcache waiting for IO completion with failing disks.
Configure use own python path name order to prefer using python3.
diff --git a/lib/device/bcache.c b/lib/device/bcache.c
index e173129fe..f68576a55 100644
--- a/lib/device/bcache.c
+++ b/lib/device/bcache.c
@@ -318,9 +318,7 @@ static bool _async_wait(struct io_engine *ioe, io_complete_fn fn)
struct async_engine *e = _to_async(ioe);
memset(&event, 0, sizeof(event));
- do {
- r = io_getevents(e->aio_context, 1, MAX_EVENT, event, NULL);
- } while (r == -EINTR);
+ r = io_getevents(e->aio_context, 1, MAX_EVENT, event, NULL);
if (r < 0) {
log_sys_warn("io_getevents");
3 years, 6 months
stable-2.02 - bcache: fix busy loop with too many errors
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5e64aa222b106ef3bd0...
Commit: 5e64aa222b106ef3bd091346ebba807e10dc449e
Parent: d32ee355c75d1adcc01e4d14c06c4ddcfab16fc6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 2 17:42:50 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 18:09:55 2020 +0200
bcache: fix busy loop with too many errors
When bcache tries to write data to a faulty device,
it may get out of caching blocks and then just busy-loops
on a CPU - so this check protects this by checking
if there is already max_io (~64) errored blocks.
---
WHATS_NEW | 1 +
lib/device/bcache.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/WHATS_NEW b/WHATS_NEW
index 7dae2ec5e..2cfb79ba0 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.188 -
==================================
+ Fix bcache when device has too many failing writes.
Fix bcache waiting for IO completion with failing disks.
Configure use own python path name order to prefer using python3.
Enhance reporting and error handling when creating thin volumes.
diff --git a/lib/device/bcache.c b/lib/device/bcache.c
index 9d4ef90a9..e173129fe 100644
--- a/lib/device/bcache.c
+++ b/lib/device/bcache.c
@@ -957,6 +957,11 @@ static struct block *_new_block(struct bcache *cache, int fd, block_address i, b
if (dm_list_empty(&cache->io_pending))
_writeback(cache, 16); // FIXME: magic number
_wait_all(cache);
+ if (dm_list_size(&cache->errored) >= cache->max_io) {
+ log_debug("bcache no new blocks for di %d index %u with >%d errors.",
+ fd, (uint32_t) i, cache->max_io);
+ return NULL;
+ }
} else {
log_error("bcache no new blocks for fd %d index %u",
fd, (uint32_t) i);
3 years, 6 months
stable-2.02 - bcache: fix waiting problem for completed IO
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d32ee355c75d1adcc01...
Commit: d32ee355c75d1adcc01e4d14c06c4ddcfab16fc6
Parent: 1ed9cfad0954cb2e7c4445fd7ff2105aa044ccf1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 2 17:18:12 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 16 18:09:55 2020 +0200
bcache: fix waiting problem for completed IO
Call _wait_all() which does check whether there is still
some pending IO before sleep. Otherwise it may happen
our submitted IO operations have been already dispatched
and this call then endlessly waits for IO which are all done.
This can be reproduced when device returns quickly errors
on write requests.
---
WHATS_NEW | 1 +
lib/device/bcache.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 3112105d7..7dae2ec5e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.188 -
==================================
+ Fix bcache waiting for IO completion with failing disks.
Configure use own python path name order to prefer using python3.
Enhance reporting and error handling when creating thin volumes.
Use revert_lv() on reload error path after vg_revert().
diff --git a/lib/device/bcache.c b/lib/device/bcache.c
index e4e72b6fb..9d4ef90a9 100644
--- a/lib/device/bcache.c
+++ b/lib/device/bcache.c
@@ -956,7 +956,7 @@ static struct block *_new_block(struct bcache *cache, int fd, block_address i, b
if (can_wait) {
if (dm_list_empty(&cache->io_pending))
_writeback(cache, 16); // FIXME: magic number
- _wait_io(cache);
+ _wait_all(cache);
} else {
log_error("bcache no new blocks for fd %d index %u",
fd, (uint32_t) i);
3 years, 6 months