main - git: update .gitignore
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=81d3639955f0553d691...
Commit: 81d3639955f0553d691e304dcc0b2eaaf6f24bb6
Parent: d3d28b1b64ff6b89ac5150787f694e1db1794a1f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 18 23:14:24 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 19 23:21:18 2021 +0100
git: update .gitignore
Hide some files from older builds.
---
.gitignore | 1 +
include/.gitignore | 2 ++
scripts/.gitignore | 5 +++--
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore
index 97a2a9b4b..8c1672bd2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,6 +32,7 @@ make.tmpl
/configure.scan
/cscope.*
/html/
+/python/
/reports/
/tags
/tmp/
diff --git a/include/.gitignore b/include/.gitignore
index 424c745c1..110b82abb 100644
--- a/include/.gitignore
+++ b/include/.gitignore
@@ -1 +1,3 @@
*.h
+.symlinks
+.symlinks_created
diff --git a/scripts/.gitignore b/scripts/.gitignore
index eb97db088..9cbadef58 100644
--- a/scripts/.gitignore
+++ b/scripts/.gitignore
@@ -1,11 +1,12 @@
+blkdeactivate.sh
blk_availability_init_red_hat
blk_availability_systemd_red_hat.service
-blkdeactivate.sh
clvmd_init_red_hat
cmirrord_init_red_hat
com.redhat.lvmdbus1.service
dm_event_systemd_red_hat.service
dm_event_systemd_red_hat.socket
+lvm2-pvscan.service
lvm2_activation_generator_systemd_red_hat
lvm2_cluster_activation_red_hat.sh
lvm2_cluster_activation_systemd_red_hat.service
@@ -16,6 +17,7 @@ lvm2_lvmetad_init_red_hat
lvm2_lvmetad_systemd_red_hat.service
lvm2_lvmetad_systemd_red_hat.socket
lvm2_lvmlockd_systemd_red_hat.service
+lvm2_lvmlocking_systemd_red_hat.service
lvm2_lvmpolld_init_red_hat
lvm2_lvmpolld_systemd_red_hat.service
lvm2_lvmpolld_systemd_red_hat.socket
@@ -24,6 +26,5 @@ lvm2_monitoring_systemd_red_hat.service
lvm2_pvscan_systemd_red_hat@.service
lvm2_tmpfiles_red_hat.conf
lvmdump.sh
-lvm2-pvscan.service
lvmlockd.service
lvmlocks.service
3 years, 1 month
main - cleanup: reduce code dupliction
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d3d28b1b64ff6b89ac5...
Commit: d3d28b1b64ff6b89ac5150787f694e1db1794a1f
Parent: d37b19aaaab0c28f4d1e4ae0690c73c0031a027b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 19 10:45:26 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 19 23:21:18 2021 +0100
cleanup: reduce code dupliction
---
lib/raid/raid.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/raid/raid.c b/lib/raid/raid.c
index 941ba8dc8..2f1eb6cf8 100644
--- a/lib/raid/raid.c
+++ b/lib/raid/raid.c
@@ -441,12 +441,10 @@ static int _raid_target_percent(void **target_state,
*total_numerator += sr->insync_regions;
*total_denominator += sr->total_regions;
+ *percent = dm_make_percent(sr->insync_regions, sr->total_regions);
if (seg)
- seg->extents_copied = (uint64_t) seg->area_len
- * dm_make_percent(sr->insync_regions , sr->total_regions) / DM_PERCENT_100;
-
- *percent = dm_make_percent(sr->insync_regions, sr->total_regions);
+ seg->extents_copied = (uint64_t) seg->area_len * *percent / DM_PERCENT_100;
dm_pool_free(mem, sr);
3 years, 1 month
main - gcc: ensure buffer ends with 0
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d37b19aaaab0c28f4d1...
Commit: d37b19aaaab0c28f4d1e4ae0690c73c0031a027b
Parent: 79d8d06217b6e0ac2ef8d0303ce84f748faebb9b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 18 23:08:08 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 19 23:21:18 2021 +0100
gcc: ensure buffer ends with 0
---
lib/commands/toolcontext.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 92008a641..75634caff 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -230,7 +230,7 @@ static void _get_sysfs_dir(struct cmd_context *cmd, char *buf, size_t buf_size)
return;
}
- strncpy(buf, sys_mnt, buf_size);
+ (void) dm_strncpy(buf, sys_mnt, buf_size);
}
static uint32_t _parse_debug_fields(struct cmd_context *cmd, int cfg, const char *cfgname)
3 years, 1 month
main - raid: move non dm functions from DEVMAPPER ifdef
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=79d8d06217b6e0ac2ef...
Commit: 79d8d06217b6e0ac2ef8d0303ce84f748faebb9b
Parent: cc140f68a505aad117a6e8222f65a5ea13139083
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 19 11:02:21 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 19 23:20:23 2021 +0100
raid: move non dm functions from DEVMAPPER ifdef
When lvm is compiled without device-mapper - this functions
do not need this kernel support so move them from ifdef DEVMAPPER
sections.
---
lib/activate/activate.c | 36 ++++++++-------
lib/raid/raid.c | 114 ++++++++++++++++++++++++------------------------
2 files changed, 77 insertions(+), 73 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 8151293c3..71db98191 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -178,6 +178,22 @@ int lv_passes_auto_activation_filter(struct cmd_context *cmd, struct logical_vol
return _lv_passes_volumes_filter(cmd, lv, cn, activation_auto_activation_volume_list_CFG);
}
+static int _passes_readonly_filter(struct cmd_context *cmd,
+ const struct logical_volume *lv)
+{
+ const struct dm_config_node *cn;
+
+ if (!(cn = find_config_tree_array(cmd, activation_read_only_volume_list_CFG, NULL)))
+ return 0;
+
+ return _lv_passes_volumes_filter(cmd, lv, cn, activation_read_only_volume_list_CFG);
+}
+
+int lv_passes_readonly_filter(const struct logical_volume *lv)
+{
+ return _passes_readonly_filter(lv->vg->cmd, lv);
+}
+
#ifndef DEVMAPPER_SUPPORT
void set_activation(int act, int silent)
{
@@ -275,6 +291,10 @@ int lv_raid_message(const struct logical_volume *lv, const char *msg)
{
return 0;
}
+int lv_raid_status(const struct logical_volume *lv, struct lv_status_raid **status)
+{
+ return 0;
+}
int lv_writecache_message(const struct logical_volume *lv, const char *msg)
{
return 0;
@@ -456,22 +476,6 @@ static int _passes_activation_filter(struct cmd_context *cmd,
return _lv_passes_volumes_filter(cmd, lv, cn, activation_volume_list_CFG);
}
-static int _passes_readonly_filter(struct cmd_context *cmd,
- const struct logical_volume *lv)
-{
- const struct dm_config_node *cn;
-
- if (!(cn = find_config_tree_array(cmd, activation_read_only_volume_list_CFG, NULL)))
- return 0;
-
- return _lv_passes_volumes_filter(cmd, lv, cn, activation_read_only_volume_list_CFG);
-}
-
-int lv_passes_readonly_filter(const struct logical_volume *lv)
-{
- return _passes_readonly_filter(lv->vg->cmd, lv);
-}
-
int library_version(char *version, size_t size)
{
if (!activation())
diff --git a/lib/raid/raid.c b/lib/raid/raid.c
index 4bb21d758..941ba8dc8 100644
--- a/lib/raid/raid.c
+++ b/lib/raid/raid.c
@@ -247,6 +247,63 @@ static void _raid_destroy(struct segment_type *segtype)
free(segtype);
}
+/* Check availability of raid10 taking data copies into consideration. */
+static bool _raid10_is_available(const struct logical_volume *lv)
+{
+ uint32_t i, rebuilds_per_group = 0, s;
+ const uint32_t copies = 2; /* FIXME: we only support 2-way mirrors (i.e. 2 data copies) in RAID10 for now. */
+ struct lv_segment *seg = first_seg(lv); /* We only have one segment in RaidLVs for now. */
+
+ for (i = 0; i < seg->area_count * copies; ++i) {
+ s = i % seg->area_count;
+
+ if (!(i % copies))
+ rebuilds_per_group = 0;
+
+ if (seg_type(seg, s) == AREA_LV &&
+ (lv_is_partial(seg_lv(seg, s)) ||
+ lv_is_virtual(seg_lv(seg, s))))
+ rebuilds_per_group++;
+
+ if (rebuilds_per_group >= copies)
+ return false;
+ }
+
+ return true;
+}
+
+/*
+ * Return true in case RaidLV with specific RAID level is available.
+ *
+ * - raid0: all legs have to be live
+ * - raid1 : minimum of 1 leg live
+ * - raid4/5: maximum of 1 leg unavailable
+ * - raid6: maximum of 2 legs unavailable
+ * - raid10: minimum of 1 leg per mirror group available
+ *
+ */
+bool raid_is_available(const struct logical_volume *lv)
+{
+ uint32_t s, missing_legs = 0;
+ struct lv_segment *seg = first_seg(lv); /* We only have one segment in RaidLVs for now. */
+
+ /* Be cautious about bogus calls. */
+ if (!seg || !seg_is_raid(seg))
+ return false;
+
+ if (seg_is_any_raid10(seg))
+ return _raid10_is_available(lv);
+
+ /* Count missing RAID legs */
+ for (s = 0; s < seg->area_count; ++s)
+ if (seg_type(seg, s) == AREA_LV &&
+ lv_is_partial(seg_lv(seg, s)))
+ missing_legs++;
+
+ /* Degradation: segtype raid1 may miss legs-1, raid0/4/5/6 may loose parity devices. */
+ return missing_legs <= (seg_is_raid1(seg) ? seg->area_count - 1 : seg->segtype->parity_devs);
+}
+
#ifdef DEVMAPPER_SUPPORT
static int _raid_target_present(struct cmd_context *cmd,
const struct lv_segment *seg __attribute__((unused)),
@@ -468,63 +525,6 @@ static int _check_feature(const struct raid_feature *feature, uint32_t maj, uint
(maj == feature->maj && min == feature->min && patchlevel >= feature->patchlevel);
}
-/* Check availability of raid10 taking data copies into consideration. */
-static bool _raid10_is_available(const struct logical_volume *lv)
-{
- uint32_t i, rebuilds_per_group = 0, s;
- const uint32_t copies = 2; /* FIXME: we only support 2-way mirrors (i.e. 2 data copies) in RAID10 for now. */
- struct lv_segment *seg = first_seg(lv); /* We only have one segment in RaidLVs for now. */
-
- for (i = 0; i < seg->area_count * copies; ++i) {
- s = i % seg->area_count;
-
- if (!(i % copies))
- rebuilds_per_group = 0;
-
- if (seg_type(seg, s) == AREA_LV &&
- (lv_is_partial(seg_lv(seg, s)) ||
- lv_is_virtual(seg_lv(seg, s))))
- rebuilds_per_group++;
-
- if (rebuilds_per_group >= copies)
- return false;
- }
-
- return true;
-}
-
-/*
- * Return true in case RaidLV with specific RAID level is available.
- *
- * - raid0: all legs have to be live
- * - raid1 : minimum of 1 leg live
- * - raid4/5: maximum of 1 leg unavailable
- * - raid6: maximum of 2 legs unavailable
- * - raid10: minimum of 1 leg per mirror group available
- *
- */
-bool raid_is_available(const struct logical_volume *lv)
-{
- uint32_t s, missing_legs = 0;
- struct lv_segment *seg = first_seg(lv); /* We only have one segment in RaidLVs for now. */
-
- /* Be cautious about bogus calls. */
- if (!seg || !seg_is_raid(seg))
- return false;
-
- if (seg_is_any_raid10(seg))
- return _raid10_is_available(lv);
-
- /* Count missing RAID legs */
- for (s = 0; s < seg->area_count; ++s)
- if (seg_type(seg, s) == AREA_LV &&
- lv_is_partial(seg_lv(seg, s)))
- missing_legs++;
-
- /* Degradation: segtype raid1 may miss legs-1, raid0/4/5/6 may loose parity devices. */
- return missing_legs <= (seg_is_raid1(seg) ? seg->area_count - 1 : seg->segtype->parity_devs);
-}
-
static int _raid_target_present(struct cmd_context *cmd,
const struct lv_segment *seg __attribute__((unused)),
unsigned *attributes)
3 years, 1 month
main - raid: resync cannot lose primary leg
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=cc140f68a505aad117a...
Commit: cc140f68a505aad117a6e8222f65a5ea13139083
Parent: 076e1556978dfb216176d319d2498ec571fcc908
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 19 01:54:06 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 19 23:19:31 2021 +0100
raid: resync cannot lose primary leg
Prohibity droping primary leg while resyncing.
---
lib/metadata/raid_manip.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index dc3bce201..33fd017cb 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -2945,11 +2945,16 @@ static int _raid_allow_extraction(struct logical_volume *lv,
!lv_raid_dev_health(lv, &dev_health))
return_0;
- if (!strcmp("resync", sync_action))
- return 1;
+ if (!strcmp("resync", sync_action)) {
+ if (!lv_is_on_pvs(seg_lv(seg, 0), target_pvs) &&
+ !lv_is_on_pvs(seg_metalv(seg, 0), target_pvs))
+ return 1;
+ log_error("Unable to remove primary RAID image while array resyncing.");
+ return 0;
+ }
/* If anything other than "recover", rebuild or "idle" */
- /* Targets reports for a while 'idle' state, before recover starts */
+ /* Targets reports for a while 'idle' state, before recover starts */
if (strcmp("recover", sync_action) &&
strcmp("rebuild", sync_action) &&
strcmp("idle", sync_action)) {
3 years, 1 month
main - raid: interruptible usleep when waiting for sync
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=076e1556978dfb21617...
Commit: 076e1556978dfb216176d319d2498ec571fcc908
Parent: b4ab2a10511cba2f7679cf12929438b6d2d6232d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 18 23:00:23 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 19 23:17:03 2021 +0100
raid: interruptible usleep when waiting for sync
Whiel waiting for raid to return consistent status,
use interruptible sleep - so command can break quickly.
Use lv_raid_status() to get percentage easily from status.
---
lib/metadata/raid_manip.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index a43e36141..dc3bce201 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -22,6 +22,7 @@
#include "lib/metadata/lv_alloc.h"
#include "lib/misc/lvm-string.h"
#include "lib/locking/lvmlockd.h"
+#include "lib/misc/lvm-signal.h"
typedef int (*fn_on_lv_t)(struct logical_volume *lv, void *data);
static int _eliminate_extracted_lvs_optional_write_vg(struct volume_group *vg,
@@ -392,6 +393,7 @@ static int _raid_in_sync(const struct logical_volume *lv)
{
int retries = _RAID_IN_SYNC_RETRIES;
dm_percent_t sync_percent;
+ struct lv_status_raid *raid_status;
if (seg_is_striped(first_seg(lv)))
return 1;
@@ -403,17 +405,21 @@ static int _raid_in_sync(const struct logical_volume *lv)
* the array is 100% in sync.
* https://bugzilla.redhat.com/1210637
*/
- if (!lv_raid_percent(lv, &sync_percent)) {
+ if (!lv_raid_status(lv, &raid_status)) {
log_error("Unable to determine sync status of %s.",
display_lvname(lv));
return 0;
}
+ sync_percent = raid_status->in_sync;
+ dm_pool_destroy(raid_status->mem);
+
if (sync_percent > DM_PERCENT_0)
break;
if (retries == _RAID_IN_SYNC_RETRIES)
log_warn("WARNING: Sync status for %s is inconsistent.",
display_lvname(lv));
- usleep(500000);
+ if (interruptible_usleep(500000))
+ return_0;
} while (--retries);
return (sync_percent == DM_PERCENT_100) ? 1 : 0;
3 years, 1 month
main - WHATS_NEW: updates
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b4ab2a10511cba2f767...
Commit: b4ab2a10511cba2f7679cf12929438b6d2d6232d
Parent: 26fb6b5e8d61e3d3097fccf4fca5bd9582fbbb4f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 18 16:55:20 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 19:12:35 2021 +0100
WHATS_NEW: updates
---
WHATS_NEW | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/WHATS_NEW b/WHATS_NEW
index e4ccd1b0d..5d018ef36 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,11 @@
Version 2.03.12 -
===================================
+ Support lvconvert -Zn with thin-pool conversion.
+ Support error and zero segtype for thin-pool data for testing.
+ Support mixed extension for striped, error and zero segtypes.
+ Support resize also for stacked virtual volumes.
+ Skip dm-zero devices just like with dm-error target.
+ Reduce ioctl() calls when checking target status.
Merge polling does not fail, when LV is found to be already merged.
Poll volumes with at least 100ms delays.
Do not flush dm cache when cached LV is going to be removed.
3 years, 1 month
main - tests: check for raid sync in progress
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=26fb6b5e8d61e3d3097...
Commit: 26fb6b5e8d61e3d3097fccf4fca5bd9582fbbb4f
Parent: accf324ccba681ad06cd8bcb27ead17ec191a471
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 17 11:22:16 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 19:12:00 2021 +0100
tests: check for raid sync in progress
TODO: this needs to be built-in in lvm command itself.
---
test/shell/lvconvert-raid.sh | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/test/shell/lvconvert-raid.sh b/test/shell/lvconvert-raid.sh
index 87eb7b53c..1ab2d4fd3 100644
--- a/test/shell/lvconvert-raid.sh
+++ b/test/shell/lvconvert-raid.sh
@@ -232,10 +232,11 @@ lvcreate -aey -l 2 -n $lv1 $vg "$dev1"
lvconvert -y -m 1 $vg/$lv1 \
--config 'global { mirror_segtype_default = "raid1" }' "$dev2"
lvs --noheadings -o attr $vg/$lv1 | grep '^[[:space:]]*r'
+# FIXME: lvconvert/lvcreate should trace state of target
for i in {1..10}; do
- check raid_leg_status $vg $lv1 "Aa" && break
- check raid_leg_status $vg $lv1 "aa" || die "Cannot wait for Aa on $vg/$lv1"
- sleep .1
+ dmsetup status | grep $vg-$lv1: | tee out
+ grep -E "recover|rebuild" out && break
+ sleep .05
done
not lvconvert --yes -m 0 $vg/$lv1 "$dev1"
lvconvert --yes -m 0 $vg/$lv1 "$dev2"
3 years, 1 month
main - tests: add check for lvconvert without zeroing
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=accf324ccba681ad06c...
Commit: accf324ccba681ad06cd8bcb27ead17ec191a471
Parent: c06325263f6e8bbba3b240295ba766a7769735a7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 18 18:19:16 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 18:57:45 2021 +0100
tests: add check for lvconvert without zeroing
Check lvconvert -Zn does not zero thin-pool metadata.
Also check --type zero is usable for thin-pool data.
---
test/shell/thin-foreign-repair.sh | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/test/shell/thin-foreign-repair.sh b/test/shell/thin-foreign-repair.sh
index 55e9f62c6..7cfa865f0 100644
--- a/test/shell/thin-foreign-repair.sh
+++ b/test/shell/thin-foreign-repair.sh
@@ -77,4 +77,22 @@ dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/mapper/$POOL 0"
fsck -n "$DM_DEV_DIR/mapper/$THIN"
+clean_thin_
+
+lvchange -an $vg
+
+# Take a copy of metadata
+lvchange -y -ay $vg/pool_tmeta
+
+lvcreate -L2 -n $lv1 $vg
+dd if="$DM_DEV_DIR/$vg/pool_tmeta" of="$DM_DEV_DIR/$vg/$lv1" bs=1M count=1
+
+# Use zero backend for data device
+lvcreate --type zero -L2 -n $lv2 $vg
+
+lvconvert --thinpool $vg/$lv2 --poolmetadata $vg/$lv1 -Zn -y
+
+# Metadata should NOT be zeroed and device should be available
+dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/$vg/$lv2 0"
+
# exit calls cleanup_mounted_and_teardown
3 years, 1 month
main - tests: check mixing striped with error and zero
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c06325263f6e8bbba3b...
Commit: c06325263f6e8bbba3b240295ba766a7769735a7
Parent: 1880b573f3b69deb561251dea003b5be7ff59ab3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 18 16:00:01 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 18:57:45 2021 +0100
tests: check mixing striped with error and zero
---
test/shell/error-usage.sh | 11 +++++++++++
test/shell/zero-usage.sh | 9 +++++++++
2 files changed, 20 insertions(+)
diff --git a/test/shell/error-usage.sh b/test/shell/error-usage.sh
index 59502480c..f8a561a37 100644
--- a/test/shell/error-usage.sh
+++ b/test/shell/error-usage.sh
@@ -32,4 +32,15 @@ check lv_field $vg/$lv1 seg_size_pe "4" # 4 * 512 => 2M
# FIXME should we print info we are ignoring stripping?
lvextend -L+1 -I64 -i2 $vg/$lv1
+# We support mixing error with zero & linear targets
+lvextend -L+1 --type zero $vg/$lv1
+lvextend -L+1 --type linear $vg/$lv1
+lvextend -L+1 --type striped $vg/$lv1
+lvextend -L+1 --type error $vg/$lv1
+
+# 4 segments: error 3m, zero 1m, linear 2m, error 1m
+lvs -o+segtype,seg_size $vg
+check lv_field $vg/$lv1 seg_count "4"
+check lv_field $vg/$lv1 size "7.00m"
+
vgremove -ff $vg
diff --git a/test/shell/zero-usage.sh b/test/shell/zero-usage.sh
index 53ffbe499..063f01818 100644
--- a/test/shell/zero-usage.sh
+++ b/test/shell/zero-usage.sh
@@ -34,4 +34,13 @@ check lv_field $vg/$lv1 segtype "zero"
check lv_field $vg/$lv1 seg_count "1"
check lv_field $vg/$lv1 seg_size_pe "4" # 4 * 512
+lvextend -L+1 --type error $vg/$lv1
+lvextend -L+1 --type linear $vg/$lv1
+lvextend -L+1 --type striped $vg/$lv1
+lvextend -L+1 --type zero $vg/$lv1
+
+lvs -o+segtype,seg_size $vg
+check lv_field $vg/$lv1 seg_count "4"
+check lv_field $vg/$lv1 size "6.00m"
+
vgremove -ff $vg
3 years, 1 month