master - Revert "pvck: dump headers_only to skip metadata text"
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d14a8040d4a2b264130...
Commit: d14a8040d4a2b264130cdb730cead935b0bf19f0
Parent: ae029fcced5f79af748df28f20f952d158804482
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri May 29 13:26:43 2020 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri May 29 13:26:43 2020 -0500
Revert "pvck: dump headers_only to skip metadata text"
This reverts commit 5410dd5441aa827b381ff64dfc6be6e4589d87a1.
Accidental push.
---
tools/lvmcmdline.c | 1 -
tools/pvck.c | 12 ++----------
tools/vals.h | 2 +-
3 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 608653827..d87a8f053 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1092,7 +1092,6 @@ int repairtype_arg(struct cmd_context *cmd, struct arg_values *av)
int dumptype_arg(struct cmd_context *cmd, struct arg_values *av)
{
if (!strcmp(av->value, "headers") ||
- !strcmp(av->value, "headers_only") ||
!strcmp(av->value, "metadata") ||
!strcmp(av->value, "metadata_all") ||
!strcmp(av->value, "metadata_search") ||
diff --git a/tools/pvck.c b/tools/pvck.c
index cd2c5b6d4..a0f567eeb 100644
--- a/tools/pvck.c
+++ b/tools/pvck.c
@@ -24,7 +24,6 @@
#define PRINT_CURRENT 1
#define PRINT_ALL 2
-#define PRINT_NONE 3
#define ID_STR_SIZE 40 /* uuid formatted with dashes is 38 chars */
@@ -1389,7 +1388,6 @@ static int _dump_headers(struct cmd_context *cmd, const char *dump, struct setti
{
uint64_t mda1_offset = 0, mda1_size = 0, mda2_offset = 0, mda2_size = 0; /* bytes */
uint32_t mda1_checksum, mda2_checksum;
- int print_metadata = 0;
int mda_count = 0;
int bad = 0;
@@ -1402,17 +1400,14 @@ static int _dump_headers(struct cmd_context *cmd, const char *dump, struct setti
return 1;
}
- if (!strcmp(dump, "headers_only"))
- print_metadata = PRINT_NONE;
-
/*
* The first mda is always 4096 bytes from the start of the device.
*/
- if (!_dump_mda_header(cmd, set, 1, print_metadata, 0, NULL, dev, def, 4096, mda1_size, &mda1_checksum, NULL))
+ if (!_dump_mda_header(cmd, set, 1, 0, 0, NULL, dev, def, 4096, mda1_size, &mda1_checksum, NULL))
bad++;
if (mda2_offset) {
- if (!_dump_mda_header(cmd, set, 1, print_metadata, 0, NULL, dev, def, mda2_offset, mda2_size, &mda2_checksum, NULL))
+ if (!_dump_mda_header(cmd, set, 1, 0, 0, NULL, dev, def, mda2_offset, mda2_size, &mda2_checksum, NULL))
bad++;
/* This probably indicates that one was committed and the other not. */
@@ -3088,9 +3083,6 @@ int pvck(struct cmd_context *cmd, int argc, char **argv)
else if (!strcmp(dump, "headers"))
ret = _dump_headers(cmd, dump, &set, labelsector, dev, def);
- else if (!strcmp(dump, "headers_only"))
- ret = _dump_headers(cmd, dump, &set, labelsector, dev, def);
-
else if (!strcmp(dump, "backup_to_raw")) {
ret = _dump_backup_to_raw(cmd, &set);
diff --git a/tools/vals.h b/tools/vals.h
index 623859e4d..70404436b 100644
--- a/tools/vals.h
+++ b/tools/vals.h
@@ -142,7 +142,7 @@ val(reportformat_VAL, reportformat_arg, "ReportFmt", "basic|json")
val(configreport_VAL, configreport_arg, "ConfigReport", "log|vg|lv|pv|pvseg|seg")
val(configtype_VAL, configtype_arg, "ConfigType", "current|default|diff|full|list|missing|new|profilable|profilable-command|profilable-metadata")
val(repairtype_VAL, repairtype_arg, "RepairType", "pv_header|metadata|label_header")
-val(dumptype_VAL, dumptype_arg, "DumpType", "headers|headers_only|metadata|metadata_all|metadata_search")
+val(dumptype_VAL, dumptype_arg, "DumpType", "headers|metadata|metadata_all|metadata_search")
/* this should always be last */
val(VAL_COUNT, NULL, NULL, NULL)
3 years, 3 months
master - integrity: skip calling add when removing images
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ae029fcced5f79af748...
Commit: ae029fcced5f79af748df28f20f952d158804482
Parent: 7b04ed07ba2e68f527ebb4f8d2b2bd092692f2d2
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri May 29 13:18:24 2020 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri May 29 13:18:24 2020 -0500
integrity: skip calling add when removing images
When lvconvert is used to remove raid images, we can
skip calling lv_add_integrity_to_raid(), which finds
nothing to do, but the the blocksize validation would
be called unnecessarily and trigger spurious errors.
---
tools/lvconvert.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 8652252d3..76e00f0a2 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1319,6 +1319,7 @@ static int _raid4_conversion_supported(struct logical_volume *lv, struct lvconve
static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *lp)
{
int image_count = 0;
+ int images_reduced = 0;
struct cmd_context *cmd = lv->vg->cmd;
struct lv_segment *seg = first_seg(lv);
@@ -1357,6 +1358,8 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
else
image_count = lp->mirrors + 1;
+ images_reduced = (image_count < lv_raid_image_count(lv));
+
if (image_count < 1) {
log_error("Unable to %s images by specified amount.",
lp->keep_mimages ? "split" : "reduce");
@@ -1400,7 +1403,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
lp->region_size : seg->region_size , lp->pvh))
return_0;
- if (lv_raid_has_integrity(lv)) {
+ if (lv_raid_has_integrity(lv) && !images_reduced) {
struct integrity_settings *isettings = NULL;
if (!lv_get_raid_integrity_settings(lv, &isettings))
return_0;
3 years, 3 months
master - tests: integrity wait for sync
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7b04ed07ba2e68f527e...
Commit: 7b04ed07ba2e68f527ebb4f8d2b2bd092692f2d2
Parent: 5410dd5441aa827b381ff64dfc6be6e4589d87a1
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri May 29 10:57:56 2020 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri May 29 10:57:56 2020 -0500
tests: integrity wait for sync
The test was using a raid+integrity LV without
first waiting for the integrity sync, which could
cause the test to fail (depending on init speed)
where it depends on integrity to work in uninitialized
areas.
Also use cmp instead of diff.
---
test/shell/integrity.sh | 46 +++++++++++++++++++++++++++++++++-------------
1 file changed, 33 insertions(+), 13 deletions(-)
diff --git a/test/shell/integrity.sh b/test/shell/integrity.sh
index 77e9430fe..0143129e6 100644
--- a/test/shell/integrity.sh
+++ b/test/shell/integrity.sh
@@ -78,14 +78,14 @@ _test_fs_with_error() {
dd if=$mnt/fileA of=tmp bs=1k
ls -l tmp
stat -c %s tmp
- diff fileA tmp
+ cmp -b fileA tmp
rm tmp
# read partial fileB which was corrupted
not dd if=$mnt/fileB of=tmp bs=1k
ls -l tmp
stat -c %s tmp | grep 12288
- not diff fileB tmp
+ not cmp -b fileB tmp
rm tmp
umount $mnt
@@ -118,14 +118,14 @@ _test_fs_with_raid() {
dd if=$mnt/fileA of=tmp bs=1k
ls -l tmp
stat -c %s tmp | grep 16384
- diff fileA tmp
+ cmp -b fileA tmp
rm tmp
# read complete fileB, corruption is corrected by raid
dd if=$mnt/fileB of=tmp bs=1k
ls -l tmp
stat -c %s tmp | grep 16384
- diff fileB tmp
+ cmp -b fileB tmp
rm tmp
umount $mnt
@@ -161,15 +161,15 @@ _add_more_data_to_mnt() {
}
_verify_data_on_mnt() {
- diff randA $mnt/randA
- diff randB $mnt/randB
- diff randC $mnt/randC
- diff fileA $mnt/1/fileA
- diff fileB $mnt/1/fileB
- diff fileC $mnt/1/fileC
- diff fileA $mnt/2/fileA
- diff fileB $mnt/2/fileB
- diff fileC $mnt/2/fileC
+ cmp -b randA $mnt/randA
+ cmp -b randB $mnt/randB
+ cmp -b randC $mnt/randC
+ cmp -b fileA $mnt/1/fileA
+ cmp -b fileB $mnt/1/fileB
+ cmp -b fileC $mnt/1/fileC
+ cmp -b fileA $mnt/2/fileA
+ cmp -b fileB $mnt/2/fileB
+ cmp -b fileC $mnt/2/fileC
}
_verify_data_on_lv() {
@@ -221,6 +221,8 @@ _wait_recalc() {
_prepare_vg
lvcreate --type raid1 -m1 --raidintegrity y -n $lv1 -l 8 $vg
+_wait_recalc $vg/${lv1}_rimage_0
+_wait_recalc $vg/${lv1}_rimage_1
_test_fs_with_raid
lvchange -an $vg/$lv1
lvconvert --raidintegrity n $vg/$lv1
@@ -229,6 +231,9 @@ vgremove -ff $vg
_prepare_vg
lvcreate --type raid1 -m2 --raidintegrity y -n $lv1 -l 8 $vg
+_wait_recalc $vg/${lv1}_rimage_0
+_wait_recalc $vg/${lv1}_rimage_1
+_wait_recalc $vg/${lv1}_rimage_2
_test_fs_with_raid
lvchange -an $vg/$lv1
lvconvert --raidintegrity n $vg/$lv1
@@ -237,6 +242,9 @@ vgremove -ff $vg
_prepare_vg
lvcreate --type raid4 --raidintegrity y -n $lv1 -l 8 $vg
+_wait_recalc $vg/${lv1}_rimage_0
+_wait_recalc $vg/${lv1}_rimage_1
+_wait_recalc $vg/${lv1}_rimage_2
_test_fs_with_raid
lvchange -an $vg/$lv1
lvconvert --raidintegrity n $vg/$lv1
@@ -245,6 +253,9 @@ vgremove -ff $vg
_prepare_vg
lvcreate --type raid5 --raidintegrity y -n $lv1 -l 8 $vg
+_wait_recalc $vg/${lv1}_rimage_0
+_wait_recalc $vg/${lv1}_rimage_1
+_wait_recalc $vg/${lv1}_rimage_2
_test_fs_with_raid
lvchange -an $vg/$lv1
lvconvert --raidintegrity n $vg/$lv1
@@ -253,6 +264,11 @@ vgremove -ff $vg
_prepare_vg
lvcreate --type raid6 --raidintegrity y -n $lv1 -l 8 $vg
+_wait_recalc $vg/${lv1}_rimage_0
+_wait_recalc $vg/${lv1}_rimage_1
+_wait_recalc $vg/${lv1}_rimage_2
+_wait_recalc $vg/${lv1}_rimage_3
+_wait_recalc $vg/${lv1}_rimage_4
_test_fs_with_raid
lvchange -an $vg/$lv1
lvconvert --raidintegrity n $vg/$lv1
@@ -261,6 +277,10 @@ vgremove -ff $vg
_prepare_vg
lvcreate --type raid10 --raidintegrity y -n $lv1 -l 8 $vg
+_wait_recalc $vg/${lv1}_rimage_0
+_wait_recalc $vg/${lv1}_rimage_1
+_wait_recalc $vg/${lv1}_rimage_2
+_wait_recalc $vg/${lv1}_rimage_3
_test_fs_with_raid
lvchange -an $vg/$lv1
lvconvert --raidintegrity n $vg/$lv1
3 years, 3 months
master - pvck: dump headers_only to skip metadata text
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5410dd5441aa827b381...
Commit: 5410dd5441aa827b381ff64dfc6be6e4589d87a1
Parent: be61bd6ff5c6c186f38cb36f8878e310df20eff0
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 28 15:51:59 2020 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 28 15:51:59 2020 -0500
pvck: dump headers_only to skip metadata text
pvck --dump headers reads the metadata text area
to compute the text metadata checksum to compare
with the mda_header checksum.
The new header_only will skip reading the metadata
text and not validate the mda_header checksum.
---
tools/lvmcmdline.c | 1 +
tools/pvck.c | 12 ++++++++++--
tools/vals.h | 2 +-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index d87a8f053..608653827 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1092,6 +1092,7 @@ int repairtype_arg(struct cmd_context *cmd, struct arg_values *av)
int dumptype_arg(struct cmd_context *cmd, struct arg_values *av)
{
if (!strcmp(av->value, "headers") ||
+ !strcmp(av->value, "headers_only") ||
!strcmp(av->value, "metadata") ||
!strcmp(av->value, "metadata_all") ||
!strcmp(av->value, "metadata_search") ||
diff --git a/tools/pvck.c b/tools/pvck.c
index a0f567eeb..cd2c5b6d4 100644
--- a/tools/pvck.c
+++ b/tools/pvck.c
@@ -24,6 +24,7 @@
#define PRINT_CURRENT 1
#define PRINT_ALL 2
+#define PRINT_NONE 3
#define ID_STR_SIZE 40 /* uuid formatted with dashes is 38 chars */
@@ -1388,6 +1389,7 @@ static int _dump_headers(struct cmd_context *cmd, const char *dump, struct setti
{
uint64_t mda1_offset = 0, mda1_size = 0, mda2_offset = 0, mda2_size = 0; /* bytes */
uint32_t mda1_checksum, mda2_checksum;
+ int print_metadata = 0;
int mda_count = 0;
int bad = 0;
@@ -1400,14 +1402,17 @@ static int _dump_headers(struct cmd_context *cmd, const char *dump, struct setti
return 1;
}
+ if (!strcmp(dump, "headers_only"))
+ print_metadata = PRINT_NONE;
+
/*
* The first mda is always 4096 bytes from the start of the device.
*/
- if (!_dump_mda_header(cmd, set, 1, 0, 0, NULL, dev, def, 4096, mda1_size, &mda1_checksum, NULL))
+ if (!_dump_mda_header(cmd, set, 1, print_metadata, 0, NULL, dev, def, 4096, mda1_size, &mda1_checksum, NULL))
bad++;
if (mda2_offset) {
- if (!_dump_mda_header(cmd, set, 1, 0, 0, NULL, dev, def, mda2_offset, mda2_size, &mda2_checksum, NULL))
+ if (!_dump_mda_header(cmd, set, 1, print_metadata, 0, NULL, dev, def, mda2_offset, mda2_size, &mda2_checksum, NULL))
bad++;
/* This probably indicates that one was committed and the other not. */
@@ -3083,6 +3088,9 @@ int pvck(struct cmd_context *cmd, int argc, char **argv)
else if (!strcmp(dump, "headers"))
ret = _dump_headers(cmd, dump, &set, labelsector, dev, def);
+ else if (!strcmp(dump, "headers_only"))
+ ret = _dump_headers(cmd, dump, &set, labelsector, dev, def);
+
else if (!strcmp(dump, "backup_to_raw")) {
ret = _dump_backup_to_raw(cmd, &set);
diff --git a/tools/vals.h b/tools/vals.h
index 70404436b..623859e4d 100644
--- a/tools/vals.h
+++ b/tools/vals.h
@@ -142,7 +142,7 @@ val(reportformat_VAL, reportformat_arg, "ReportFmt", "basic|json")
val(configreport_VAL, configreport_arg, "ConfigReport", "log|vg|lv|pv|pvseg|seg")
val(configtype_VAL, configtype_arg, "ConfigType", "current|default|diff|full|list|missing|new|profilable|profilable-command|profilable-metadata")
val(repairtype_VAL, repairtype_arg, "RepairType", "pv_header|metadata|label_header")
-val(dumptype_VAL, dumptype_arg, "DumpType", "headers|metadata|metadata_all|metadata_search")
+val(dumptype_VAL, dumptype_arg, "DumpType", "headers|headers_only|metadata|metadata_all|metadata_search")
/* this should always be last */
val(VAL_COUNT, NULL, NULL, NULL)
3 years, 3 months
master - test: Warn and exit on problematic integrity device behavior
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=be61bd6ff5c6c186f38...
Commit: be61bd6ff5c6c186f38cb36f8878e310df20eff0
Parent: 74a211cfd30e93d9388de5ac1ee22e630c840e94
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Thu May 28 17:04:35 2020 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Thu May 28 17:04:35 2020 +0200
test: Warn and exit on problematic integrity device behavior
The first leg of integrity enabled raid device sometimes does not get
recalculated.
---
test/shell/integrity-dmeventd.sh | 8 ++++++++
test/shell/integrity-large.sh | 8 ++++++++
test/shell/integrity-misc.sh | 8 ++++++++
test/shell/integrity.sh | 8 ++++++++
4 files changed, 32 insertions(+)
diff --git a/test/shell/integrity-dmeventd.sh b/test/shell/integrity-dmeventd.sh
index ed2436aca..296f55680 100644
--- a/test/shell/integrity-dmeventd.sh
+++ b/test/shell/integrity-dmeventd.sh
@@ -109,6 +109,14 @@ _wait_recalc() {
sleep 1
done
+ # TODO: There is some strange bug, first leg of RAID with integrity
+ # enabled never gets in sync. I saw this in BB, but not when executing
+ # the commands manually
+ if test -z "$sync"; then
+ echo "TEST WARNING: Resync of dm-integrity device '$checklv' failed"
+ dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
+ exit
+ fi
echo "timeout waiting for recalc"
return 1
}
diff --git a/test/shell/integrity-large.sh b/test/shell/integrity-large.sh
index 7a333c101..5aba80e6a 100644
--- a/test/shell/integrity-large.sh
+++ b/test/shell/integrity-large.sh
@@ -95,6 +95,14 @@ _wait_recalc() {
sleep 1
done
+ # TODO: There is some strange bug, first leg of RAID with integrity
+ # enabled never gets in sync. I saw this in BB, but not when executing
+ # the commands manually
+ if test -z "$sync"; then
+ echo "TEST WARNING: Resync of dm-integrity device '$checklv' failed"
+ dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
+ exit
+ fi
echo "timeout waiting for recalc"
return 1
}
diff --git a/test/shell/integrity-misc.sh b/test/shell/integrity-misc.sh
index a176f18e0..0d056890c 100644
--- a/test/shell/integrity-misc.sh
+++ b/test/shell/integrity-misc.sh
@@ -109,6 +109,14 @@ _wait_recalc() {
sleep 1
done
+ # TODO: There is some strange bug, first leg of RAID with integrity
+ # enabled never gets in sync. I saw this in BB, but not when executing
+ # the commands manually
+ if test -z "$sync"; then
+ echo "TEST WARNING: Resync of dm-integrity device '$checklv' failed"
+ dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
+ exit
+ fi
echo "timeout waiting for recalc"
return 1
}
diff --git a/test/shell/integrity.sh b/test/shell/integrity.sh
index 6baccf00c..77e9430fe 100644
--- a/test/shell/integrity.sh
+++ b/test/shell/integrity.sh
@@ -204,6 +204,14 @@ _wait_recalc() {
sleep 1
done
+ # TODO: There is some strange bug, first leg of RAID with integrity
+ # enabled never gets in sync. I saw this in BB, but not when executing
+ # the commands manually
+ if test -z "$sync"; then
+ echo "TEST WARNING: Resync of dm-integrity device '$checklv' failed"
+ dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
+ exit
+ fi
echo "timeout waiting for recalc"
return 1
}
3 years, 3 months
master - lvconvert: error when using existing cachevol
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=74a211cfd30e93d9388...
Commit: 74a211cfd30e93d9388de5ac1ee22e630c840e94
Parent: bb41ca86fa962dd5d90c2b5498e93bb8a3aa2f91
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri May 22 13:44:33 2020 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri May 22 14:12:34 2020 -0500
lvconvert: error when using existing cachevol
Check if LV is an existing cachevol before attempting
to use it again as a cachevol or cachepool.
---
test/shell/cache-single-usage.sh | 13 +++++++++++++
tools/lvconvert.c | 15 +++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/test/shell/cache-single-usage.sh b/test/shell/cache-single-usage.sh
index a885bf793..8936aa3f1 100644
--- a/test/shell/cache-single-usage.sh
+++ b/test/shell/cache-single-usage.sh
@@ -127,4 +127,17 @@ umount "$mount_dir"
lvchange -an $vg/$lv1
lvchange -an $vg/$lv2
+# misc tests
+
+lvremove $vg
+
+lvcreate -n $lv1 -l 2 -an $vg "$dev1"
+lvcreate -n $lv2 -l 2 -an $vg "$dev1"
+lvcreate -n $lv3 -l 2 -an $vg "$dev2"
+
+lvconvert -y --type writecache --cachevol $lv3 $vg/$lv1
+not lvconvert -y --type writecache --cachevol ${lv3}_cvol $vg/$lv2
+not lvconvert -y --type cache --cachevol ${lv3}_cvol $vg/$lv2
+not lvconvert -y --type cache --cachepool ${lv3}_cvol $vg/$lv2
+
vgremove -ff $vg
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index cf935385f..8652252d3 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4264,6 +4264,11 @@ static int _lvconvert_cachevol_attach_single(struct cmd_context *cmd,
goto out;
}
+ if (lv_is_cache_vol(cachevol_lv)) {
+ log_error("LV %s is already used as a cachevol.", display_lvname(cachevol_lv));
+ goto out;
+ }
+
/* Ensure the LV is not active elsewhere. */
if (!lockd_lv(cmd, lv, "ex", 0))
goto_out;
@@ -4347,6 +4352,11 @@ static int _lvconvert_cachepool_attach_single(struct cmd_context *cmd,
goto out;
}
+ if (lv_is_cache_vol(cachepool_lv)) {
+ log_error("LV %s is already used as a cachevol.", display_lvname(cachepool_lv));
+ goto out;
+ }
+
if (cachepool_lv == lv) {
log_error("Use a different LV for cache pool LV and cache LV %s.",
display_lvname(cachepool_lv));
@@ -5629,6 +5639,11 @@ static int _lvconvert_writecache_attach_single(struct cmd_context *cmd,
goto bad;
}
+ if (lv_is_cache_vol(lv_fast)) {
+ log_error("LV %s is already used as a cachevol.", display_lvname(lv_fast));
+ goto bad;
+ }
+
/*
* To permit this we need to check the block size of the fs using lv
* (recently in libblkid) so that we can use a matching writecache
3 years, 4 months
master - tests: also udev wait on clean-up path
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bb41ca86fa962dd5d90...
Commit: bb41ca86fa962dd5d90c2b5498e93bb8a3aa2f91
Parent: 53803821de166109131c4d4e5396116f89dbb082
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu May 21 15:19:31 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu May 21 16:03:41 2020 +0200
tests: also udev wait on clean-up path
---
test/shell/thin-foreign-repair.sh | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/test/shell/thin-foreign-repair.sh b/test/shell/thin-foreign-repair.sh
index 8b4018e4e..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,9 +62,7 @@ dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/mapper/$POOL 0"
mkfs.ext4 "$DM_DEV_DIR/mapper/$THIN"
-aux udev_wait
-
-dmsetup remove "$THIN" || { sleep .5 ; dmsetup remove "$THIN" }
+clean_thin_
lvchange -an $vg/pool
@@ -72,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
3 years, 4 months
master - test: Use printf to generate data
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=53803821de166109131...
Commit: 53803821de166109131c4d4e5396116f89dbb082
Parent: b5811b7c9cb27a76ef1a7e237067ef56bd7308a3
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Thu May 21 15:33:24 2020 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Thu May 21 15:33:24 2020 +0200
test: Use printf to generate data
...to avoid unnecessary dependency on python
---
test/shell/integrity-dmeventd.sh | 8 +++-----
test/shell/integrity-large.sh | 8 +++-----
test/shell/integrity-misc.sh | 8 +++-----
test/shell/integrity.sh | 8 +++-----
4 files changed, 12 insertions(+), 20 deletions(-)
diff --git a/test/shell/integrity-dmeventd.sh b/test/shell/integrity-dmeventd.sh
index a4be8c93c..ed2436aca 100644
--- a/test/shell/integrity-dmeventd.sh
+++ b/test/shell/integrity-dmeventd.sh
@@ -22,11 +22,9 @@ mkdir -p $mnt
aux prepare_devs 6 64
-PYTHON="$(which python3 python2 python 2>/dev/null | head -n 1)"
-test -n "$PYTHON" || skip
-$PYTHON -c "print 'A'*16384" >> fileA
-$PYTHON -c "print 'B'*16384" >> fileB
-$PYTHON -c "print 'C'*16384" >> fileC
+printf "%0.sA" {1..16384} >> fileA
+printf "%0.sB" {1..16384} >> fileB
+printf "%0.sC" {1..16384} >> fileC
# generate random data
dd if=/dev/urandom of=randA bs=512K count=2
diff --git a/test/shell/integrity-large.sh b/test/shell/integrity-large.sh
index 7d8e133df..7a333c101 100644
--- a/test/shell/integrity-large.sh
+++ b/test/shell/integrity-large.sh
@@ -25,11 +25,9 @@ mkdir -p $mnt
# raid1 LV needs to be extended to 512MB to test imeta being exended
aux prepare_devs 4 600
-PYTHON="$(which python3 python2 python 2>/dev/null | head -n 1)"
-test -n "$PYTHON" || skip
-$PYTHON -c "print 'A'*16384" >> fileA
-$PYTHON -c "print 'B'*16384" >> fileB
-$PYTHON -c "print 'C'*16384" >> fileC
+printf "%0.sA" {1..16384} >> fileA
+printf "%0.sB" {1..16384} >> fileB
+printf "%0.sC" {1..16384} >> fileC
# generate random data
dd if=/dev/urandom of=randA bs=512K count=2
diff --git a/test/shell/integrity-misc.sh b/test/shell/integrity-misc.sh
index 735e5bf86..a176f18e0 100644
--- a/test/shell/integrity-misc.sh
+++ b/test/shell/integrity-misc.sh
@@ -22,11 +22,9 @@ mkdir -p $mnt
aux prepare_devs 5 64
-PYTHON="$(which python3 python2 python 2>/dev/null | head -n 1)"
-test -n "$PYTHON" || skip
-$PYTHON -c "print 'A'*16384" >> fileA
-$PYTHON -c "print 'B'*16384" >> fileB
-$PYTHON -c "print 'C'*16384" >> fileC
+printf "%0.sA" {1..16384} >> fileA
+printf "%0.sB" {1..16384} >> fileB
+printf "%0.sC" {1..16384} >> fileC
# generate random data
dd if=/dev/urandom of=randA bs=512K count=2
diff --git a/test/shell/integrity.sh b/test/shell/integrity.sh
index b241c984d..6baccf00c 100644
--- a/test/shell/integrity.sh
+++ b/test/shell/integrity.sh
@@ -23,11 +23,9 @@ mkdir -p $mnt
aux prepare_devs 5 64
-PYTHON="$(which python3 python2 python 2>/dev/null | head -n 1)"
-test -n "$PYTHON" || skip
-$PYTHON -c "print 'A'*16384" >> fileA
-$PYTHON -c "print 'B'*16384" >> fileB
-$PYTHON -c "print 'C'*16384" >> fileC
+printf "%0.sA" {1..16384} >> fileA
+printf "%0.sB" {1..16384} >> fileB
+printf "%0.sC" {1..16384} >> fileC
# generate random data
dd if=/dev/urandom of=randA bs=512K count=2
3 years, 4 months
master - tests: also udev wait on clean-up path
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=761034921c447ca7e16...
Commit: 761034921c447ca7e167492454efce170593997a
Parent: b5811b7c9cb27a76ef1a7e237067ef56bd7308a3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu May 21 15:19:31 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu May 21 15:21:05 2020 +0200
tests: also udev wait on clean-up path
---
test/shell/thin-foreign-repair.sh | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/test/shell/thin-foreign-repair.sh b/test/shell/thin-foreign-repair.sh
index 8b4018e4e..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,9 +62,7 @@ dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/mapper/$POOL 0"
mkfs.ext4 "$DM_DEV_DIR/mapper/$THIN"
-aux udev_wait
-
-dmsetup remove "$THIN" || { sleep .5 ; dmsetup remove "$THIN" }
+clean_thin_
lvchange -an $vg/pool
@@ -72,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
3 years, 4 months
master - tests: Use python single liner to generate data
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b5811b7c9cb27a76ef1...
Commit: b5811b7c9cb27a76ef1a7e237067ef56bd7308a3
Parent: 70a45c44e89534b6d5f9adeb04620f43453c67bf
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Wed May 6 12:10:50 2020 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Thu May 21 15:11:22 2020 +0200
tests: Use python single liner to generate data
---
test/shell/integrity-dmeventd.sh | 8 +++++---
test/shell/integrity-large.sh | 8 +++++---
test/shell/integrity-misc.sh | 8 +++++---
test/shell/integrity.sh | 8 +++++---
4 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/test/shell/integrity-dmeventd.sh b/test/shell/integrity-dmeventd.sh
index 58899ca80..a4be8c93c 100644
--- a/test/shell/integrity-dmeventd.sh
+++ b/test/shell/integrity-dmeventd.sh
@@ -22,9 +22,11 @@ mkdir -p $mnt
aux prepare_devs 6 64
-for i in `seq 1 16384`; do echo -n "A" >> fileA; done
-for i in `seq 1 16384`; do echo -n "B" >> fileB; done
-for i in `seq 1 16384`; do echo -n "C" >> fileC; done
+PYTHON="$(which python3 python2 python 2>/dev/null | head -n 1)"
+test -n "$PYTHON" || skip
+$PYTHON -c "print 'A'*16384" >> fileA
+$PYTHON -c "print 'B'*16384" >> fileB
+$PYTHON -c "print 'C'*16384" >> fileC
# generate random data
dd if=/dev/urandom of=randA bs=512K count=2
diff --git a/test/shell/integrity-large.sh b/test/shell/integrity-large.sh
index 0c36e4d54..7d8e133df 100644
--- a/test/shell/integrity-large.sh
+++ b/test/shell/integrity-large.sh
@@ -25,9 +25,11 @@ mkdir -p $mnt
# raid1 LV needs to be extended to 512MB to test imeta being exended
aux prepare_devs 4 600
-for i in `seq 1 16384`; do echo -n "A" >> fileA; done
-for i in `seq 1 16384`; do echo -n "B" >> fileB; done
-for i in `seq 1 16384`; do echo -n "C" >> fileC; done
+PYTHON="$(which python3 python2 python 2>/dev/null | head -n 1)"
+test -n "$PYTHON" || skip
+$PYTHON -c "print 'A'*16384" >> fileA
+$PYTHON -c "print 'B'*16384" >> fileB
+$PYTHON -c "print 'C'*16384" >> fileC
# generate random data
dd if=/dev/urandom of=randA bs=512K count=2
diff --git a/test/shell/integrity-misc.sh b/test/shell/integrity-misc.sh
index 73b0a67d8..735e5bf86 100644
--- a/test/shell/integrity-misc.sh
+++ b/test/shell/integrity-misc.sh
@@ -22,9 +22,11 @@ mkdir -p $mnt
aux prepare_devs 5 64
-for i in `seq 1 16384`; do echo -n "A" >> fileA; done
-for i in `seq 1 16384`; do echo -n "B" >> fileB; done
-for i in `seq 1 16384`; do echo -n "C" >> fileC; done
+PYTHON="$(which python3 python2 python 2>/dev/null | head -n 1)"
+test -n "$PYTHON" || skip
+$PYTHON -c "print 'A'*16384" >> fileA
+$PYTHON -c "print 'B'*16384" >> fileB
+$PYTHON -c "print 'C'*16384" >> fileC
# generate random data
dd if=/dev/urandom of=randA bs=512K count=2
diff --git a/test/shell/integrity.sh b/test/shell/integrity.sh
index 7e4f2cb0b..b241c984d 100644
--- a/test/shell/integrity.sh
+++ b/test/shell/integrity.sh
@@ -23,9 +23,11 @@ mkdir -p $mnt
aux prepare_devs 5 64
-for i in `seq 1 16384`; do echo -n "A" >> fileA; done
-for i in `seq 1 16384`; do echo -n "B" >> fileB; done
-for i in `seq 1 16384`; do echo -n "C" >> fileC; done
+PYTHON="$(which python3 python2 python 2>/dev/null | head -n 1)"
+test -n "$PYTHON" || skip
+$PYTHON -c "print 'A'*16384" >> fileA
+$PYTHON -c "print 'B'*16384" >> fileB
+$PYTHON -c "print 'C'*16384" >> fileC
# generate random data
dd if=/dev/urandom of=randA bs=512K count=2
3 years, 4 months