master - tests: update raid sync
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e09ee21fd46287...
Commit: e09ee21fd46287ed245ea086ddcf06140a83431a
Parent: 47d50a8f2735a8c4496082eab5b312a596e2c2d4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 31 00:37:35 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 31 00:37:35 2014 +0100
tests: update raid sync
---
test/shell/lvconvert-cache-raid.sh | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvconvert-cache-raid.sh b/test/shell/lvconvert-cache-raid.sh
index 174b0ec..1fcd0fe 100644
--- a/test/shell/lvconvert-cache-raid.sh
+++ b/test/shell/lvconvert-cache-raid.sh
@@ -46,11 +46,11 @@ lvremove -f $vg
lvcreate -n cpool_meta -m 1 --type raid1 -l 10 $vg
lvcreate -n cpool -m 1 --type raid1 -l 10 $vg
+aux wait_for_sync $vg cpool
lvs -a -o+seg_pe_ranges $vg
lvconvert --yes --type cache-pool --poolmetadata $vg/cpool_meta $vg/cpool
lvcreate -n corigin --type cache --cachepool $vg/cpool -l 10
-aux wait_for_sync $vg cpool
lvchange --syncaction repair $vg/cpool_cmeta
lvchange --syncaction repair $vg/cpool_cdata
@@ -62,7 +62,6 @@ not lvconvert --splitmirrors 1 --name split_cmeta $vg/cpool_cmeta "$dev1"
not lvconvert --splitmirrors 1 --name split_cdata $vg/cpool_cdata "$dev1"
# but allow manipulating existing LVs with reserved names
-aux wait_for_sync $vg cpool
lvconvert --splitmirrors 1 --name split_meta $vg/cpool_cmeta "$dev1"
lvconvert --splitmirrors 1 --name split_data $vg/cpool_cdata "$dev1"
8 years, 7 months
master - tests: wait for raid sync
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=47d50a8f2735a8...
Commit: 47d50a8f2735a8c4496082eab5b312a596e2c2d4
Parent: e7c130430a2b232bdf062f8fb3064899b176986b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 31 00:31:54 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 31 00:31:54 2014 +0100
tests: wait for raid sync
---
test/shell/lvconvert-cache-raid.sh | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-cache-raid.sh b/test/shell/lvconvert-cache-raid.sh
index 16dd38e..174b0ec 100644
--- a/test/shell/lvconvert-cache-raid.sh
+++ b/test/shell/lvconvert-cache-raid.sh
@@ -50,6 +50,7 @@ lvs -a -o+seg_pe_ranges $vg
lvconvert --yes --type cache-pool --poolmetadata $vg/cpool_meta $vg/cpool
lvcreate -n corigin --type cache --cachepool $vg/cpool -l 10
+aux wait_for_sync $vg cpool
lvchange --syncaction repair $vg/cpool_cmeta
lvchange --syncaction repair $vg/cpool_cdata
@@ -61,6 +62,7 @@ not lvconvert --splitmirrors 1 --name split_cmeta $vg/cpool_cmeta "$dev1"
not lvconvert --splitmirrors 1 --name split_cdata $vg/cpool_cdata "$dev1"
# but allow manipulating existing LVs with reserved names
+aux wait_for_sync $vg cpool
lvconvert --splitmirrors 1 --name split_meta $vg/cpool_cmeta "$dev1"
lvconvert --splitmirrors 1 --name split_data $vg/cpool_cdata "$dev1"
8 years, 7 months
master - tests: explicitely use old snapshots
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e7c130430a2b23...
Commit: e7c130430a2b232bdf062f8fb3064899b176986b
Parent: 8926230f6e7ac46c5bbed70d3e8efbc43e5b444d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 31 00:28:25 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 31 00:28:25 2014 +0100
tests: explicitely use old snapshots
---
test/shell/snapshot-usage.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh
index c29d310..a3dd7a6 100644
--- a/test/shell/snapshot-usage.sh
+++ b/test/shell/snapshot-usage.sh
@@ -111,7 +111,7 @@ lvs -a $vg1
lvremove -f $vg1
# Test virtual snapshot over /dev/zero
-lvcreate -V50 -L10 -n $lv1 -s $vg1
+lvcreate --type snapshot -V50 -L10 -n $lv1 -s $vg1
CHECK_ACTIVE="active"
test ! -e LOCAL_CLVMD || CHECK_ACTIVE="local exclusive"
check lv_field $vg1/$lv1 lv_active "$CHECK_ACTIVE"
@@ -228,7 +228,7 @@ lvcreate -s -l100%FREE -n $lv2 $vg1/$lv1
check lv_field $vg1/$lv2 size "7.50p"
lvremove -ff $vg1
-lvcreate -V15E -l1 -n $lv1 -s $vg1
+lvcreate --type snapshot -V15E -l1 -n $lv1 -s $vg1
check lv_field $vg1/$lv1 origin_size "15.00e"
vgremove -ff $vg1
8 years, 7 months
master - tests: lvcreate snapshot usage update
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8926230f6e7ac4...
Commit: 8926230f6e7ac46c5bbed70d3e8efbc43e5b444d
Parent: b58a0f5cd31669e789d6944ced5b42ce7c6f4f74
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 30 23:16:03 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 30 23:58:49 2014 +0100
tests: lvcreate snapshot usage update
---
test/shell/lvcreate-usage.sh | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvcreate-usage.sh b/test/shell/lvcreate-usage.sh
index 05f2515..5d37d9c 100644
--- a/test/shell/lvcreate-usage.sh
+++ b/test/shell/lvcreate-usage.sh
@@ -130,8 +130,16 @@ grep "Redundant" err
check lv_field $vg/$lv1 segtype "linear"
lvremove -ff $vg
-# Snapshot with virtual origin works
+# Old --type snapshot works with -s
+lvcreate --type snapshot -s -V64 -L32 -n $lv1 $vg
+check lv_field $vg/$lv1 segtype "linear"
+lvcreate --type snapshot -V64 -L32 -n $lv2 $vg
+check lv_field $vg/$lv2 segtype "linear"
+lvremove -ff $vg
+
+# --virtualoriginsize always makes old snapshot
lvcreate -s --virtualoriginsize 64m -L 32m -n $lv1 $vg
+check lv_field $vg/$lv1 segtype "linear"
lvrename $vg/$lv1 $vg/$lv2
lvcreate -s --virtualoriginsize 64m -L 32m -n $lv1 $vg
lvchange -a n $vg/$lv1
8 years, 7 months
master - tests: use aux func to disable device
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b58a0f5cd31669...
Commit: b58a0f5cd31669e789d6944ced5b42ce7c6f4f74
Parent: da61e6355e35ba7961b2073812c6a5639d9d541d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Oct 26 20:41:49 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 30 23:58:49 2014 +0100
tests: use aux func to disable device
---
test/shell/lvcreate-missing.sh | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/test/shell/lvcreate-missing.sh b/test/shell/lvcreate-missing.sh
index 2b74052..4553e98 100644
--- a/test/shell/lvcreate-missing.sh
+++ b/test/shell/lvcreate-missing.sh
@@ -12,10 +12,11 @@
. lib/inittest
aux prepare_vg 2
-init_udev_transaction
-dmsetup remove -f "$dev1" || true
-finish_udev_transaction
+
+aux disable_dev "$dev1"
not lvcreate -n "foo" $vg -l 1
+aux enable_dev "$dev1"
+
vgremove -ff $vg
8 years, 7 months
master - tests: raid syncaction test
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=da61e6355e35ba...
Commit: da61e6355e35ba7961b2073812c6a5639d9d541d
Parent: fe245d78ff603dd798b719854ee8d900f858779d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Oct 25 16:03:44 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 30 23:58:49 2014 +0100
tests: raid syncaction test
Add sync wait for syncaction of raid1 test.
--syncaction requires raid to be in sync first.
---
test/shell/lvchange-syncaction-raid.sh | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvchange-syncaction-raid.sh b/test/shell/lvchange-syncaction-raid.sh
index 9a42894..7ef4e01 100644
--- a/test/shell/lvchange-syncaction-raid.sh
+++ b/test/shell/lvchange-syncaction-raid.sh
@@ -21,12 +21,15 @@ aux prepare_vg 3
lvcreate -n $lv1 $vg -l1 --type raid1
+aux wait_for_sync $vg $lv1
+
START=$(get pv_field "$dev2" pe_start --units 1k)
METASIZE=$(get lv_field $vg/${lv1}_rmeta_1 size -a --units 1k)
SEEK=$((${START%\.00k} + ${METASIZE%\.00k}))
# Overwrite some portion of _rimage_1
dd if=/dev/urandom of="$dev2" bs=1K count=1 seek=$SEEK oflag=direct
+aux wait_for_sync $vg $lv1
lvchange --syncaction check $vg/$lv1
check lv_field $vg/$lv1 raid_mismatch_count "128"
@@ -34,7 +37,7 @@ check lv_field $vg/$lv1 raid_mismatch_count "128"
lvchange -an $vg/$lv1
# Slow down write by 100ms
-aux delay_dev "$dev2" 0 100
+aux delay_dev "$dev2" 0 50
lvchange -ay $vg/$lv1
# noone has it open and target is read & running
dmsetup info -c | grep $vg
@@ -49,9 +52,12 @@ dmsetup info -c | grep $vg
# For now it fails with:
# device-mapper: message ioctl on failed: Device or resource busy
#
+# As solution for now - user needs to run --synaction on synchronous raid array
+#
+aux wait_for_sync $vg $lv1
should lvchange --syncaction check $vg/$lv1
aux enable_dev "$dev2"
-lvs -o+raid_mismatch_count -a $vg
+check lv_field $vg/$lv1 raid_mismatch_count "0"
vgremove -ff $vg
8 years, 7 months
master - cleanup: shorter code
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fe245d78ff603d...
Commit: fe245d78ff603dd798b719854ee8d900f858779d
Parent: 888b21e9bd10d70154fb361359a2342aa56af27a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 30 13:04:41 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 30 23:58:49 2014 +0100
cleanup: shorter code
---
lib/metadata/pool_manip.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/lib/metadata/pool_manip.c b/lib/metadata/pool_manip.c
index d1b4497..c7c07e5 100644
--- a/lib/metadata/pool_manip.c
+++ b/lib/metadata/pool_manip.c
@@ -533,12 +533,11 @@ struct logical_volume *alloc_pool_metadata(struct logical_volume *pool_lv,
.read_ahead = read_ahead,
.stripe_size = stripe_size,
.stripes = stripes,
- .zero = 1,
+ .tags = DM_LIST_HEAD_INIT(lvc.tags),
.temporary = 1,
+ .zero = 1,
};
- dm_list_init(&lvc.tags);
-
if (!(lvc.extents = extents_from_size(pool_lv->vg->cmd, size,
pool_lv->vg->extent_size)))
return_0;
@@ -574,12 +573,11 @@ static struct logical_volume *_alloc_pool_metadata_spare(struct volume_group *vg
.pvh = pvh ? : &vg->pvs,
.read_ahead = DM_READ_AHEAD_AUTO,
.stripes = 1,
- .zero = 1,
+ .tags = DM_LIST_HEAD_INIT(lp.tags),
.temporary = 1,
+ .zero = 1,
};
- dm_list_init(&lp.tags);
-
if (!(lp.segtype = get_segtype_from_string(vg->cmd, "striped")))
return_0;
8 years, 7 months
master - cleanup: extents_from_size is 32bit value
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=888b21e9bd10d7...
Commit: 888b21e9bd10d70154fb361359a2342aa56af27a
Parent: 9a6cf3d9f4b43e0d47ac686d8acc5f280d4bfd70
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 30 11:38:49 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 30 23:58:49 2014 +0100
cleanup: extents_from_size is 32bit value
Current lvm2 does support only 32bit extents count.
---
lib/metadata/metadata-exported.h | 2 +-
lib/metadata/metadata.c | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 890e808..013da16 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -731,7 +731,7 @@ int lv_rename_update(struct cmd_context *cmd, struct logical_volume *lv,
int lv_update_and_reload(struct logical_volume *lv);
int lv_update_and_reload_origin(struct logical_volume *lv);
-uint64_t extents_from_size(struct cmd_context *cmd, uint64_t size,
+uint32_t extents_from_size(struct cmd_context *cmd, uint64_t size,
uint32_t extent_size);
uint32_t extents_from_percent_size(struct volume_group *vg, const struct dm_list *pvh,
uint32_t extents, int roundup,
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 2038f06..df2d6a3 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -1075,7 +1075,8 @@ bad:
return NULL;
}
-uint64_t extents_from_size(struct cmd_context *cmd, uint64_t size,
+/* Rounds up by default */
+uint32_t extents_from_size(struct cmd_context *cmd, uint64_t size,
uint32_t extent_size)
{
if (size % extent_size) {
@@ -1094,7 +1095,7 @@ uint64_t extents_from_size(struct cmd_context *cmd, uint64_t size,
return 0;
}
- return size / extent_size;
+ return (uint32_t) (size / extent_size);
}
/*
8 years, 7 months
master - cleanup: prints and stacks
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9a6cf3d9f4b43e...
Commit: 9a6cf3d9f4b43e0d47ac686d8acc5f280d4bfd70
Parent: 0da749c9a4c488bd336b2c6b3df7d781a812cb47
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 30 11:38:03 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 30 23:58:49 2014 +0100
cleanup: prints and stacks
---
lib/metadata/lv_manip.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 49d2300..e5b36df 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4600,21 +4600,21 @@ static int _lvresize_adjust_extents(struct cmd_context *cmd, struct logical_volu
/* If reducing, find stripes, stripesize & size of last segment */
if (reducing) {
if (lp->stripes || lp->stripe_size || lp->mirrors)
- log_error("Ignoring stripes, stripesize and mirrors "
- "arguments when reducing");
+ log_print_unless_silent("Ignoring stripes, stripesize and mirrors "
+ "arguments when reducing.");
if (lp->sign == SIGN_MINUS)
if (lp->extents_are_pes) {
if (lp->extents >= existing_physical_extents) {
log_error("Unable to reduce %s below 1 extent.", lp->lv_name);
- return_0;
+ return 0;
}
new_extents = existing_physical_extents - lp->extents;
} else {
new_extents = existing_logical_extents - lp->extents;
if (lp->extents >= existing_logical_extents) {
log_error("Unable to reduce %s below 1 extent.", lp->lv_name);
- return_0;
+ return 0;
}
}
else
@@ -4843,7 +4843,7 @@ static struct logical_volume *_lvresize_volume(struct cmd_context *cmd,
if (lv_is_thin_pool(lv)) {
if (lp->resizefs) {
- log_warn("Thin pool volumes do not have filesystem.");
+ log_print_unless_silent("Ignoring --resizefs as thin pool volumes do not have filesystem.");
lp->resizefs = 0;
}
lock_lv = lv;
@@ -4854,7 +4854,7 @@ static struct logical_volume *_lvresize_volume(struct cmd_context *cmd,
alloc = lp->ac_alloc ?: lv->alloc;
if ((lp->resize == LV_REDUCE) && lp->argc)
- log_warn("Ignoring PVs on command line when reducing");
+ log_print_unless_silent("Ignoring PVs on command line when reducing.");
/* Request confirmation before operations that are often mistakes. */
if ((lp->resizefs || (lp->resize == LV_REDUCE)) &&
8 years, 7 months
master - cleanup: remove unneeded assign
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0da749c9a4c488...
Commit: 0da749c9a4c488bd336b2c6b3df7d781a812cb47
Parent: 8bf4cd464f499403aacde52b1c1867ebb31714da
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 28 20:09:08 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 30 23:58:49 2014 +0100
cleanup: remove unneeded assign
---
lib/metadata/lv_manip.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 36bc2d8..49d2300 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -5081,7 +5081,6 @@ struct logical_volume *alloc_lv(struct dm_pool *mem)
return NULL;
}
- lv->snapshot = NULL;
dm_list_init(&lv->snapshot_segs);
dm_list_init(&lv->segments);
dm_list_init(&lv->tags);
8 years, 7 months