master - tests: speedup
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=76c06c72523201...
Commit: 76c06c72523201bdb478bd1735b2fcfbe49d3d38
Parent: 309201a53bcbbd4967f380214e688c520b957fdf
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu May 15 10:25:25 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu May 15 12:08:35 2014 +0200
tests: speedup
Avoid some expencive raid/mirror synchronization when testing
just allocation sizes.
Use lv_attr_bit
---
test/shell/lvchange-raid.sh | 62 ++++++++++++++--------------
test/shell/lvconvert-mirror-basic.sh | 2 +-
test/shell/lvcreate-pvtags.sh | 4 +-
test/shell/lvcreate-raid.sh | 74 +++++++++++++++------------------
test/shell/lvcreate-raid10.sh | 16 +++-----
test/shell/snapshots-of-mirrors.sh | 4 +-
test/shell/vgsplit-operation.sh | 6 +-
7 files changed, 79 insertions(+), 89 deletions(-)
diff --git a/test/shell/lvchange-raid.sh b/test/shell/lvchange-raid.sh
index afa2431..8ef6c33 100644
--- a/test/shell/lvchange-raid.sh
+++ b/test/shell/lvchange-raid.sh
@@ -37,8 +37,8 @@ run_writemostly_check() {
$vg $lv $segtype
# No writemostly flag should be there yet.
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*-.$'
- get lv_field $vg/${lv}_rimage_1 lv_attr -a | grep '.*-.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "-"
+ check lv_attr_bit health $vg/${lv}_rimage_1 "-"
if [ "$segtype" != "raid1" ]; then
not lvchange --writemostly $d0 $vg/$lv
@@ -47,71 +47,71 @@ run_writemostly_check() {
# Set the flag
lvchange --writemostly $d0 $vg/$lv
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*w.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "w"
# Running again should leave it set (not toggle)
lvchange --writemostly $d0 $vg/$lv
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*w.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "w"
# Running again with ':y' should leave it set
lvchange --writemostly $d0:y $vg/$lv
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*w.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "w"
# ':n' should unset it
lvchange --writemostly $d0:n $vg/$lv
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*-.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "-"
# ':n' again should leave it unset
lvchange --writemostly $d0:n $vg/$lv
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*-.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "-"
# ':t' toggle to set
lvchange --writemostly $d0:t $vg/$lv
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*w.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "w"
# ':t' toggle to unset
lvchange --writemostly $d0:t $vg/$lv
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*-.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "-"
# ':y' to set
lvchange --writemostly $d0:y $vg/$lv
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*w.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "w"
# Toggle both at once
lvchange --writemostly $d0:t --writemostly $d1:t $vg/$lv
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*-.$'
- get lv_field $vg/${lv}_rimage_1 lv_attr -a | grep '.*w.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "-"
+ check lv_attr_bit health $vg/${lv}_rimage_1 "w"
# Toggle both at once again
lvchange --writemostly $d0:t --writemostly $d1:t $vg/$lv
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*w.$'
- get lv_field $vg/${lv}_rimage_1 lv_attr -a | grep '.*-.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "w"
+ check lv_attr_bit health $vg/${lv}_rimage_1 "-"
# Toggle one, unset the other
lvchange --writemostly $d0:n --writemostly $d1:t $vg/$lv
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*-.$'
- get lv_field $vg/${lv}_rimage_1 lv_attr -a | grep '.*w.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "-"
+ check lv_attr_bit health $vg/${lv}_rimage_1 "w"
# Toggle one, set the other
lvchange --writemostly $d0:y --writemostly $d1:t $vg/$lv
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*w.$'
- get lv_field $vg/${lv}_rimage_1 lv_attr -a | grep '.*-.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "w"
+ check lv_attr_bit health $vg/${lv}_rimage_1 "-"
# Partial flag supercedes writemostly flag
aux disable_dev $d0
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*p.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "p"
# It is possible for the kernel to detect the failed device before
# we re-enable it. If so, the field will be set to 'r'efresh since
# that also takes precedence over 'w'ritemostly. If this has happened,
# we refresh the LV and then check for 'w'.
aux enable_dev $d0
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*r.$' && lvchange --refresh $vg/$lv
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*w.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "r" && lvchange --refresh $vg/$lv
+ check lv_attr_bit health $vg/${lv}_rimage_0 "w"
# Catch Bad writebehind values
- not lvchange --writebehind "invalid" $vg/$lv
- not lvchange --writebehind -256 $vg/$lv
+ invalid lvchange --writebehind "invalid" $vg/$lv
+ invalid lvchange --writebehind -256 $vg/$lv
# Set writebehind
check lv_field $vg/$lv raid_write_behind ""
@@ -122,8 +122,8 @@ run_writemostly_check() {
lvconvert -m 0 $vg/$lv $d1
lvconvert --type raid1 -m 1 $vg/$lv $d1
check lv_field $vg/$lv raid_write_behind ""
- get lv_field $vg/${lv}_rimage_0 lv_attr -a | grep '.*-.$'
- get lv_field $vg/${lv}_rimage_1 lv_attr -a | grep '.*-.$'
+ check lv_attr_bit health $vg/${lv}_rimage_0 "-"
+ check lv_attr_bit health $vg/${lv}_rimage_1 "-"
}
# run_syncaction_check <VG> <LV>
@@ -152,7 +152,7 @@ run_syncaction_check() {
seek=$(($seek + $size)) # Jump halfway through the RAID image
- get lv_field $vg/$lv lv_attr | grep '.*-.$'
+ check lv_attr_bit health $vg/$lv "-"
check lv_field $vg/$lv raid_mismatch_count "0"
# Overwrite the last half of one of the PVs with crap
@@ -192,7 +192,7 @@ run_syncaction_check() {
# 'lvs' should show results
lvchange --syncaction check $vg/$lv
aux wait_for_sync $vg $lv
- get lv_field $vg/$lv lv_attr | grep '.*-.$'
+ check lv_attr_bit health $vg/$lv "-"
check lv_field $vg/$lv raid_mismatch_count "0"
}
@@ -220,7 +220,7 @@ run_refresh_check() {
sync
# Check for 'p'artial flag
- get lv_field $vg/$lv lv_attr | grep '.*p.$'
+ check lv_attr_bit health $vg/$lv "p"
dmsetup status
lvs -a -o name,attr,devices $vg
@@ -230,18 +230,18 @@ run_refresh_check() {
lvs -a -o name,attr,devices $vg
# Check for 'r'efresh flag
- get lv_field $vg/$lv lv_attr | grep '.*r.$'
+ check lv_attr_bit health $vg/$lv "r"
lvchange --refresh $vg/$lv
aux wait_for_sync $vg $lv
- get lv_field $vg/$lv lv_attr | grep '.*-.$'
+ check lv_attr_bit health $vg/$lv "-"
# Writing random data above should mean that the devices
# were out-of-sync. The refresh should have taken care
# of properly reintegrating the device.
lvchange --syncaction repair $vg/$lv
aux wait_for_sync $vg $lv
- get lv_field $vg/$lv lv_attr | grep '.*-.$'
+ check lv_attr_bit health $vg/$lv "-"
}
# run_recovery_rate_check <VG> <LV>
diff --git a/test/shell/lvconvert-mirror-basic.sh b/test/shell/lvconvert-mirror-basic.sh
index 28258b2..49d32aa 100644
--- a/test/shell/lvconvert-mirror-basic.sh
+++ b/test/shell/lvconvert-mirror-basic.sh
@@ -77,7 +77,7 @@ test_lvconvert() {
fi
lvcreate -aey -l2 --type mirror -m $start_count --mirrorlog $start_log_type \
- -n $lv1 $vg $alloc
+ --nosync -n $lv1 $vg $alloc
check mirror_legs $vg $lv1 $start_count_p1
# FIXME: check mirror log
else
diff --git a/test/shell/lvcreate-pvtags.sh b/test/shell/lvcreate-pvtags.sh
index 340a4f4..1df07fc 100644
--- a/test/shell/lvcreate-pvtags.sh
+++ b/test/shell/lvcreate-pvtags.sh
@@ -31,10 +31,10 @@ not lvcreate -l4 -i4 $vg @fast
not lvcreate -l2 -i2 $vg "$DM_DEV_DIR/mapper/pv1"
# lvcreate mirror
-lvcreate -aey -l1 --type mirror -m1 $vg @fast
+lvcreate -aey -l1 --type mirror -m1 --nosync $vg @fast
# lvcreate mirror w/corelog
-lvcreate -aey -l1 --type mirror -m2 --corelog $vg @fast
+lvcreate -aey -l1 --type mirror -m2 --corelog --nosync $vg @fast
# lvcreate mirror w/no free PVs
not lvcreate -aey -l1 --type mirror -m2 $vg @fast
diff --git a/test/shell/lvcreate-raid.sh b/test/shell/lvcreate-raid.sh
index 15cf09f..d0d365f 100644
--- a/test/shell/lvcreate-raid.sh
+++ b/test/shell/lvcreate-raid.sh
@@ -12,11 +12,7 @@
. lib/test
lv_devices() {
- local local_vg=$1
- local local_lv=$2
- local count=$3
-
- [ $count == `lvs --noheadings -o devices $local_vg/$local_lv | sed s/,/' '/g | wc -w` ]
+ test $3 -eq $(get lv_devices $1/$2 | wc -w)
}
########################################################
@@ -47,10 +43,10 @@ lvremove -ff $vg
# Create RAID1 (explicit 3-way) - Set min/max recovery rate
lvcreate --type raid1 -m 2 -l 2 \
- --minrecoveryrate 50 --maxrecoveryrate 100 \
+ --minrecoveryrate 50 --maxrecoveryrate 1M \
-n $lv1 $vg
check lv_field $vg/$lv1 raid_min_recovery_rate 50
-check lv_field $vg/$lv1 raid_max_recovery_rate 100
+check lv_field $vg/$lv1 raid_max_recovery_rate 1024
aux wait_for_sync $vg $lv1
lvremove -ff $vg
@@ -70,10 +66,10 @@ for i in raid4 \
raid6 raid6_zr raid6_nr raid6_nc; do
lvcreate --type $i -l 3 -i 3 \
- --minrecoveryrate 50 --maxrecoveryrate 100 \
+ --minrecoveryrate 50 --maxrecoveryrate 1M \
-n $lv1 $vg
check lv_field $vg/$lv1 raid_min_recovery_rate 50
- check lv_field $vg/$lv1 raid_max_recovery_rate 100
+ check lv_field $vg/$lv1 raid_max_recovery_rate 1024
aux wait_for_sync $vg $lv1
lvremove -ff $vg
done
@@ -83,86 +79,84 @@ done
# 6 PVs with 18.5m in each PV.
# 1 metadata LV = 1 extent = .5m
# 1 image = 36+37+37 extents = 55.00m = lv_size
-lvcreate --type raid1 -m 1 -l 100%FREE -n raid1 $vg
+lvcreate --type raid1 -m 1 -l 100%FREE -an -Zn -n raid1 $vg
check lv_field $vg/raid1 size "55.00m"
lvremove -ff $vg
# 1 metadata LV = 1 extent
# 1 image = 36 extents
# 5 images = 180 extents = 90.00m = lv_size
-lvcreate --type raid5 -i 5 -l 100%FREE -n raid5 $vg
+lvcreate --type raid5 -i 5 -l 100%FREE -an -Zn -n raid5 $vg
should check lv_field $vg/raid5 size "90.00m"
#FIXME: Currently allocates incorrectly at 87.50m
lvremove -ff $vg
# 1 image = 36+37 extents
# 2 images = 146 extents = 73.00m = lv_size
-lvcreate --type raid5 -i 2 -l 100%FREE -n raid5 $vg
+lvcreate --type raid5 -i 2 -l 100%FREE -an -Zn -n raid5 $vg
check lv_field $vg/raid5 size "73.00m"
lvremove -ff $vg
# 1 image = 36 extents
# 4 images = 144 extents = 72.00m = lv_size
-lvcreate --type raid6 -i 4 -l 100%FREE -n raid6 $vg
+lvcreate --type raid6 -i 4 -l 100%FREE -an -Zn -n raid6 $vg
should check lv_field $vg/raid6 size "72.00m"
#FIXME: Currnently allocates incorrectly at 70.00m
lvremove -ff $vg
-# Eat 18 of 37 extents from dev1, leaving 19
-lvcreate -l 18 -n lv $vg "$dev1"
+###
+# For following tests eat 18 of 37 extents from dev1, leaving 19
+lvcreate -l 18 -an -Zn -n eat_space $vg "$dev1"
+EAT_SIZE=$(get lv_field $vg/eat_space size)
+
# Using 100% free should take the rest of dev1 and equal from dev2
# 1 meta takes 1 extent
# 1 image = 18 extents = 9.00m = lv_size
-lvcreate --type raid1 -m 1 -l 100%FREE -n raid1 $vg "$dev1" "$dev2"
+lvcreate --type raid1 -m 1 -l 100%FREE -an -Zn -n raid1 $vg "$dev1" "$dev2"
check lv_field $vg/raid1 size "9.00m"
# Ensure image size is the same as the RAID1 size
check lv_field $vg/raid1 size $(get lv_field $vg/raid1_rimage_0 size -a)
# Amount remaining in dev2 should equal the amount taken by 'lv' in dev1
-check pv_field "$dev2" pv_free $(get lv_field $vg/lv size)
-lvremove -ff $vg
+check pv_field "$dev2" pv_free "$EAT_SIZE"
+lvremove -ff $vg/raid1
-# Eat 18 of 37 extents from dev1, leaving 19
-lvcreate -l 18 -n lv $vg "$dev1"
# Using 100% free should take the rest of dev1 and equal amount from the rest
# 1 meta takes 1 extent
# 1 image = 18 extents = 9.00m
# 5 images = 90 extents = 45.00m = lv_size
-lvcreate --type raid5 -i 5 -l 100%FREE -n raid5 $vg
+lvcreate --type raid5 -i 5 -l 100%FREE -an -Zn -n raid5 $vg
check lv_field $vg/raid5 size "45.00m"
# Amount remaining in dev6 should equal the amount taken by 'lv' in dev1
-check pv_field "$dev6" pv_free `lvs --noheadings -o size $vg/lv`
-lvremove -ff $vg
+check pv_field "$dev6" pv_free "$EAT_SIZE"
+lvremove -ff $vg/raid5
-# Eat 18 of 37 extents from dev1, leaving 19
-lvcreate -l 18 -n lv $vg "$dev1"
# Using 100% free should take the rest of dev1, an equal amount
# from 2 more devs, and all extents from 3 additional devs
# 1 meta takes 1 extent
# 1 image = 18+37 extents
# 2 images = 110 extents = 55.00m = lv_size
-lvcreate --type raid5 -i 2 -l 100%FREE -n raid5 $vg
+lvcreate --type raid5 -i 2 -l 100%FREE -an -Zn -n raid5 $vg
check lv_field $vg/raid5 size "55.00m"
-lvremove -ff $vg
+lvremove -ff $vg/raid5
# Let's do some stripe tests too
-# Eat 18 of 37 extents from dev1, leaving 19
-lvcreate -l 18 -n lv $vg "$dev1"
# Using 100% free should take the rest of dev1 and an equal amount from rest
# 1 image = 19 extents
# 6 images = 114 extents = 57.00m = lv_size
-lvcreate -i 6 -l 100%FREE -n stripe $vg
+lvcreate -i 6 -l 100%FREE -an -Zn -n stripe $vg
check lv_field $vg/stripe size "57.00m"
-lvremove -ff $vg
+lvremove -ff $vg/stripe
-# Eat 18 of 37 extents from dev1, leaving 19
-lvcreate -l 18 -n lv $vg "$dev1"
# Using 100% free should take the rest of dev1, an equal amount from
# one more dev, and all of the remaining 4
# 1 image = 19+37+37 extents
# 2 images = 186 extents = 93.00m = lv_size
-lvcreate -i 2 -l 100%FREE -n stripe $vg
+lvcreate -i 2 -l 100%FREE -an -Zn -n stripe $vg
check lv_field $vg/stripe size "93.00m"
+
lvremove -ff $vg
+# end of use of '$vg/eat_space'
+###
# Create RAID (implicit stripe count based on PV count)
#######################################################
@@ -173,20 +167,20 @@ not lvcreate --type raid5 -l2 $vg "$dev1" "$dev2"
not lvcreate --type raid6 -l3 $vg "$dev1" "$dev2" "$dev3" "$dev4"
# Implicit count comes from #PVs given (always 2 for mirror though)
-lvcreate --type raid1 -l1 -n raid1 $vg "$dev1" "$dev2"
+lvcreate --type raid1 -l1 -an -Zn -n raid1 $vg "$dev1" "$dev2"
lv_devices $vg raid1 2
-lvcreate --type raid5 -l2 -n raid5 $vg "$dev1" "$dev2" "$dev3"
+lvcreate --type raid5 -l2 -an -Zn -n raid5 $vg "$dev1" "$dev2" "$dev3"
lv_devices $vg raid5 3
-lvcreate --type raid6 -l3 -n raid6 $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5"
+lvcreate --type raid6 -l3 -an -Zn -n raid6 $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5"
lv_devices $vg raid6 5
lvremove -ff $vg
# Implicit count comes from total #PVs in VG (always 2 for mirror though)
-lvcreate --type raid1 -l1 -n raid1 $vg
+lvcreate --type raid1 -l1 -an -Zn -n raid1 $vg
lv_devices $vg raid1 2
-lvcreate --type raid5 -l2 -n raid5 $vg
+lvcreate --type raid5 -l2 -an -Zn -n raid5 $vg
lv_devices $vg raid5 6
-lvcreate --type raid6 -l3 -n raid6 $vg
+lvcreate --type raid6 -l3 -an -Zn -n raid6 $vg
lv_devices $vg raid6 6
vgremove -ff $vg
diff --git a/test/shell/lvcreate-raid10.sh b/test/shell/lvcreate-raid10.sh
index 7ce8100..a521794 100644
--- a/test/shell/lvcreate-raid10.sh
+++ b/test/shell/lvcreate-raid10.sh
@@ -12,11 +12,7 @@
. lib/test
lv_devices() {
- local local_vg=$1
- local local_lv=$2
- local count=$3
-
- [ $count == `lvs --noheadings -o devices $local_vg/$local_lv | sed s/,/' '/g | wc -w` ]
+ test $3 -eq $(get lv_devices $1/$2 | wc -w)
}
########################################################
@@ -41,10 +37,10 @@ lvremove -ff $vg/$lv1
# 2-way mirror, 2-stripes - Set min/max recovery rate
lvcreate --type raid10 -m 1 -i 2 -l 2 \
- --minrecoveryrate 50 --maxrecoveryrate 100 \
+ --minrecoveryrate 50 --maxrecoveryrate 1M \
-n $lv1 $vg
check lv_field $vg/$lv1 raid_min_recovery_rate 50
-check lv_field $vg/$lv1 raid_max_recovery_rate 100
+check lv_field $vg/$lv1 raid_max_recovery_rate 1024
aux wait_for_sync $vg $lv1
# 2-way mirror, 3-stripes
@@ -57,7 +53,7 @@ lvremove -ff $vg
# 37 extents / device
# 1 image = 36 extents (1 for meta)
# 3 images = 108 extents = 54.00m
-lvcreate --type raid10 -i 3 -l 100%FREE -n raid10 $vg
+lvcreate --type raid10 -i 3 -l 100%FREE -an -Zn -n raid10 $vg
check lv_field $vg/raid10 size "54.00m"
lvremove -ff $vg
@@ -68,12 +64,12 @@ lvremove -ff $vg
not lvcreate --type raid10 -l2 $vg "$dev1" "$dev2" "$dev3"
# Implicit count comes from #PVs given (always 2-way mirror)
-lvcreate --type raid10 -l2 -n raid10 $vg "$dev1" "$dev2" "$dev3" "$dev4"
+lvcreate --type raid10 -l2 -an -Zn -n raid10 $vg "$dev1" "$dev2" "$dev3" "$dev4"
lv_devices $vg raid10 4
lvremove -ff $vg
# Implicit count comes from total #PVs in VG (always 2 for mirror though)
-lvcreate --type raid10 -l2 -n raid10 $vg
+lvcreate --type raid10 -l2 -an -Zn -n raid10 $vg
lv_devices $vg raid10 6
lvremove -ff $vg
diff --git a/test/shell/snapshots-of-mirrors.sh b/test/shell/snapshots-of-mirrors.sh
index cfb0792..ac5cf85 100644
--- a/test/shell/snapshots-of-mirrors.sh
+++ b/test/shell/snapshots-of-mirrors.sh
@@ -13,9 +13,9 @@
aux prepare_vg 4
-# Attempt to create snapshot of a mirror origin - should fail
-lvcreate -aey --type mirror -m 1 -L 10M -n lv $vg
+lvcreate -aey --type mirror -m 1 -L 10M --nosync -n lv $vg
+# Create snapshot of a mirror origin
lvcreate -s $vg/lv -L 10M -n snap
# Down-convert (mirror -> linear) under a snapshot
diff --git a/test/shell/vgsplit-operation.sh b/test/shell/vgsplit-operation.sh
index 201ad17..4291dd4 100644
--- a/test/shell/vgsplit-operation.sh
+++ b/test/shell/vgsplit-operation.sh
@@ -278,7 +278,7 @@ vgremove -ff $vg1
COMM "vgsplit fails splitting 1 mirror + 1 striped LV, only striped LV specified"
create_vg_ $vg1 "$dev1" "$dev2" "$dev3" "$dev4"
-lvcreate -an -Zn -l 16 -n $lv1 --type mirror -m1 $vg1 "$dev1" "$dev2" "$dev3"
+lvcreate -an -Zn -l 16 -n $lv1 --type mirror --nosync -m1 $vg1 "$dev1" "$dev2" "$dev3"
lvcreate -an -Zn -l 16 -n $lv2 -i 2 $vg1 "$dev3" "$dev4"
check pvlv_counts $vg1 4 2 0
not vgsplit -n $lv2 $vg1 $vg2 2>err
@@ -289,7 +289,7 @@ vgremove -f $vg1
#
COMM "vgsplit fails, active mirror involved in split"
create_vg_ $vg1 "$dev1" "$dev2" "$dev3" "$dev4"
-lvcreate -aey -l 16 -n $lv1 --type mirror -m1 $vg1 "$dev1" "$dev2" "$dev3"
+lvcreate -aey -l 16 -n $lv1 --type mirror --nosync -m1 $vg1 "$dev1" "$dev2" "$dev3"
lvcreate -l 16 -n $lv2 $vg1 "$dev4"
lvchange -an $vg1/$lv2
check pvlv_counts $vg1 4 2 0
@@ -299,7 +299,7 @@ vgremove -f $vg1
COMM "vgsplit succeeds, active mirror not involved in split"
create_vg_ $vg1 "$dev1" "$dev2" "$dev3" "$dev4"
-lvcreate -aey -l 16 -n $lv1 --type mirror -m1 $vg1 "$dev1" "$dev2" "$dev3"
+lvcreate -aey -l 16 -n $lv1 --type mirror --nosync -m1 $vg1 "$dev1" "$dev2" "$dev3"
lvcreate -l 16 -n $lv2 $vg1 "$dev4"
lvchange -an $vg1/$lv2
check pvlv_counts $vg1 4 2 0
9 years, 12 months
master - man:misc updates
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=309201a53bcbbd...
Commit: 309201a53bcbbd4967f380214e688c520b957fdf
Parent: 7c86131233011c9fb81190bcb40d5d4ac54a533d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu May 15 10:25:15 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu May 15 12:08:35 2014 +0200
man:misc updates
---
man/lvchange.8.in | 6 +++++-
man/lvconvert.8.in | 35 ++++++++++++++++++++++-------------
2 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index 5de75e0..b138c3d 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -181,7 +181,7 @@ the number of I/Os to the drive to a minimum. The default behavior is to
set the write-mostly attribute for the specified physical volume in the
logical volume. It is possible to also remove the write-mostly flag by
appending a ":n" to the physical volume or to toggle the value by specifying
-":t". The \fI--writemostly\fP argument can be specified more than one time
+":t". The \fB--writemostly\fP argument can be specified more than one time
in a single command; making it possible to toggle the write-mostly attributes
for all the physical volumes in a logical volume at once.
.TP
@@ -237,6 +237,10 @@ manually without a clustered lock manager.
Set zeroing mode for thin pool. Note: already provisioned blocks from pool
in non-zero mode are not cleared in unwritten parts when setting zero to
\fIy\fP.
+.SH ENVIRONMENT VARIABLES
+.TP
+.B LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES
+Suppress locking failure messages.
.SH Examples
Changes the permission on volume lvol1 in volume group vg00 to be read-only:
.sp
diff --git a/man/lvconvert.8.in b/man/lvconvert.8.in
index fe6525b..8c3479f 100644
--- a/man/lvconvert.8.in
+++ b/man/lvconvert.8.in
@@ -162,15 +162,17 @@ Exactly one of
.BR \-\-replace ,
.BR \-\-splitsnapshot ,
.BR \-\-snapshot ,
-.BR \-\-splitmirrors
-or
+.BR \-\-splitmirrors ,
+.BR \-\-thin ,
.BR \-\-thinpool
+or
+.BR \-\-type
arguments is required.
.TP
.BR \-b ", " \-\-background
Run the daemon in the background.
.TP
-.BR \-\-cachepool " " \fCachePoolLV
+.BR \-\-cachepool " " \fICachePoolLV
This argument is necessary when converting a logical volume to a cache LV.
For more information on cache pool LVs and cache LVs, see \fBlvm\fP(8).
.TP
@@ -204,9 +206,15 @@ A mirror is divided into regions of this size (in MB), and the mirror log
uses this granularity to track which regions are in sync.
.TP
.B \-\-type \fISegmentType
-Used to convert a logical volume to another segment type, like cache-pool,
-cache, raid1, or thin-pool. When converting a logical volume to a cache LV,
-the \-\-cachepool argument is required.
+Used to convert a logical volume to another segment type, like
+.IR cache-pool ,
+.IR cache ,
+.IR raid1 ,
+or
+.IR thin-pool .
+When converting a logical volume to a cache LV, the
+.B \-\-cachepool
+argument is required.
.TP
.BR \-i ", " \-\-interval " " \fISeconds
Report progress as a percentage at regular intervals.
@@ -246,8 +254,9 @@ The inverse of \-\-snapshot.
.TP
.B \-s, \-\-snapshot
Recreates a snapshot from constituent logical volumes (or copies of them) after
-having been separated using \-\-splitsnapshot. For this to work correctly, no
-changes may be made to the contents of either volume after the split.
+having been separated using \fB\-\-splitsnapshot\fP.
+For this to work correctly, no changes may be made to the contents
+of either volume after the split.
.TP
.BR \-c ", " \-\-chunksize " " \fIChunkSize [ \fIbBsSkKmMgG ]
Gives the size of chunk for snapshot and thin pool logical volumes.
@@ -328,9 +337,9 @@ Default unit is megabytes.
.TP
.IR \fB\-r ", " \fB\-\-readahead " {" ReadAheadSectors | auto | none }
Sets read ahead sector count of thin pool metadata logical volume.
-The default value is "auto" which allows the kernel to choose
+The default value is "\fIauto\fP" which allows the kernel to choose
a suitable value automatically.
-"None" is equivalent to specifying zero.
+"\fINone\fP" is equivalent to specifying zero.
.TP
.B \-\-repair
Repair a mirror after suffering a disk failure or try to fix thin pool metadata.
@@ -380,9 +389,9 @@ The volume cannot be further modified as long as it is used as an
external origin volume for unprovisioned areas of any thin logical volume.
.TP
.IR \fB\-\-thinpool " " ThinPoolLogicalVolume { Name | Path }
-Changes logical volume into a thin pool volume. The volume
-will store the pool's data.
-Thin pool metadata logical volume can be specified with the option
+Switches logical volume into a thin pool's data volume.
+Content of converted volume is lost.
+Thin pool's metadata logical volume can be specified with the option
\fB\-\-poolmetadata\fP or allocated with \fB\-\-poolmetadatasize\fP.
.SH Examples
9 years, 12 months
master - report: export DM_REPORT_FIELD_RESERVED_NAME_{HELP, HELP_ALT} and show help on '<lvm_command> -O help'
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7c86131233011c...
Commit: 7c86131233011c9fb81190bcb40d5d4ac54a533d
Parent: 5684cfcb1c13129b70ddaf1ee4df95e08bc551a9
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu May 15 10:58:05 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu May 15 10:58:14 2014 +0200
report: export DM_REPORT_FIELD_RESERVED_NAME_{HELP,HELP_ALT} and show help on '<lvm_command> -O help'
Share DM_REPORT_FIELD_RESERVED_NAME_{HELP,HELP_ALT} between libdm and
any libdm user to handle reserved field names, in this case the virtual
field name to show help instead of failing on unrecognized field.
The libdm user also needs to check the field name so it can fire
proper code in this case (cleanup, exit etc.).
---
WHATS_NEW | 1 +
WHATS_NEW_DM | 2 ++
libdm/libdevmapper.h | 4 ++++
libdm/libdm-report.c | 11 ++++++++---
tools/reporter.c | 5 ++++-
5 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index c5cbf37..090e914 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Make reporting commands show help about possible sort keys on '-O help'.
Add metadata_percent to lvs_cols.
Take account of parity areas with alloc anywhere in _calc_required_extents.
Use proper uint64 casting for calculation of cache metadata size.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index c81d354..6304ff6 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,7 @@
Version 1.02.88 -
=================================
+ Also recognize 'help'/'?' as reserved sort key name to show help.
+ Export recognized DM_REPORT_FIELD_RESERVED_NAME_{HELP,HELP_ALT} to show help.
Add dm_units_to_factor for size unit parsing.
Increase bitset size for minors for thin dmeventd plugin.
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 8ffa145..d63b135 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -1601,6 +1601,10 @@ struct dm_report_field;
#define DM_REPORT_FIELD_TYPE_ID_LEN 32
#define DM_REPORT_FIELD_TYPE_HEADING_LEN 32
+/* Reserved field names for special purposes. */
+#define DM_REPORT_FIELD_RESERVED_NAME_HELP "help" /* shows help */
+#define DM_REPORT_FIELD_RESERVED_NAME_HELP_ALT "?" /* shows help */
+
struct dm_report;
struct dm_report_field_type {
uint32_t type; /* object type id */
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index 7e8484e..f3395a7 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -529,7 +529,8 @@ static int _parse_fields(struct dm_report *rh, const char *format,
if (!_field_match(rh, ws, (size_t) (we - ws), report_type_only)) {
_display_fields(rh);
log_warn(" ");
- if (strcasecmp(ws, "help") && strcmp(ws, "?"))
+ if (strcasecmp(ws, DM_REPORT_FIELD_RESERVED_NAME_HELP) &&
+ strcmp(ws, DM_REPORT_FIELD_RESERVED_NAME_HELP_ALT))
log_error("Unrecognised field: %.*s",
(int) (we - ws), ws);
return 0;
@@ -556,8 +557,12 @@ static int _parse_keys(struct dm_report *rh, const char *keys,
while (*we && *we != ',')
we++;
if (!_key_match(rh, ws, (size_t) (we - ws), report_type_only)) {
- log_error("dm_report: Unrecognised field: %.*s",
- (int) (we - ws), ws);
+ _display_fields(rh);
+ log_warn(" ");
+ if (strcasecmp(ws, DM_REPORT_FIELD_RESERVED_NAME_HELP) &&
+ strcmp(ws, DM_REPORT_FIELD_RESERVED_NAME_HELP_ALT))
+ log_error("dm_report: Unrecognised field: %.*s",
+ (int) (we - ws), ws);
return 0;
}
}
diff --git a/tools/reporter.c b/tools/reporter.c
index 2591fd5..b4a0c0b 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -370,7 +370,10 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
separator, aligned, buffered,
headings, field_prefixes, quoted,
columns_as_rows))) {
- if (!strcasecmp(options, "help") || !strcmp(options, "?"))
+ if ( (!strcasecmp(options, DM_REPORT_FIELD_RESERVED_NAME_HELP) ||
+ !strcmp(options, DM_REPORT_FIELD_RESERVED_NAME_HELP_ALT)) ||
+ (!strcasecmp(keys, DM_REPORT_FIELD_RESERVED_NAME_HELP) ||
+ !strcmp(keys, DM_REPORT_FIELD_RESERVED_NAME_HELP_ALT)) )
return r;
return_ECMD_FAILED;
}
9 years, 12 months
master - report: Add metadata_percent to lvs_cols.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5684cfcb1c1312...
Commit: 5684cfcb1c13129b70ddaf1ee4df95e08bc551a9
Parent: 42d7409da2761198781e067b81a4dca86ba27ee9
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu May 15 08:32:27 2014 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu May 15 08:32:27 2014 +0100
report: Add metadata_percent to lvs_cols.
---
WHATS_NEW | 1 +
conf/example.conf.in | 2 +-
lib/config/defaults.h | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 8bcf687..c5cbf37 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Add metadata_percent to lvs_cols.
Take account of parity areas with alloc anywhere in _calc_required_extents.
Use proper uint64 casting for calculation of cache metadata size.
Better support for nesting of blocking signals.
diff --git a/conf/example.conf.in b/conf/example.conf.in
index bc1758d..935d3e7 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -1040,7 +1040,7 @@ activation {
# Comma separated list of columns to report for 'lvs' command.
# See 'lvs -o help' for the list of possible fields.
- # lvs_cols="lv_name,vg_name,lv_attr,lv_size,pool_lv,origin,data_percent,move_pv,mirror_log,copy_percent,convert_lv"
+ # lvs_cols="lv_name,vg_name,lv_attr,lv_size,pool_lv,origin,data_percent,metadata_percent,move_pv,mirror_log,copy_percent,convert_lv"
# Comma separated list of columns to report for 'lvs' command in verbose mode.
# See 'lvs -o help' for the list of possible fields.
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 137b4c8..4200dc8 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -180,7 +180,7 @@
#define DEFAULT_REP_QUOTED 1
#define DEFAULT_REP_SEPARATOR " "
-#define DEFAULT_LVS_COLS "lv_name,vg_name,lv_attr,lv_size,pool_lv,origin,data_percent,move_pv,mirror_log,copy_percent,convert_lv"
+#define DEFAULT_LVS_COLS "lv_name,vg_name,lv_attr,lv_size,pool_lv,origin,data_percent,metadata_percent,move_pv,mirror_log,copy_percent,convert_lv"
#define DEFAULT_VGS_COLS "vg_name,pv_count,lv_count,snap_count,vg_attr,vg_size,vg_free"
#define DEFAULT_PVS_COLS "pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free"
#define DEFAULT_SEGS_COLS "lv_name,vg_name,lv_attr,stripes,segtype,seg_size"
9 years, 12 months
master - man: lvmthin cover snapshot merge and xfs
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=42d7409da27611...
Commit: 42d7409da2761198781e067b81a4dca86ba27ee9
Parent: 044b7968005a23e52a78c26eb56a7f74a973312f
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed May 14 14:05:21 2014 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed May 14 15:15:35 2014 -0500
man: lvmthin cover snapshot merge and xfs
also fix a couple inconsistent example values.
---
man/lvmthin.7.in | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 112 insertions(+), 3 deletions(-)
diff --git a/man/lvmthin.7.in b/man/lvmthin.7.in
index 5a4ee87..030745b 100644
--- a/man/lvmthin.7.in
+++ b/man/lvmthin.7.in
@@ -104,7 +104,7 @@ The primary method for using lvm thin provisioning:
lvcreate -n ThinDataLV -L LargeSize VG
Example
- # lvcreate -n pool0 -L 100G vg
+ # lvcreate -n pool0 -L 10G vg
2. create ThinMetaLV
@@ -251,6 +251,10 @@ Single step thin pool LV creation
.br
Single step thin pool LV and thin LV creation
.br
+Merge thin snapshots
+.br
+XFS on snapshots
+.br
\&
@@ -269,7 +273,7 @@ lvcreate -n ThinMetaLV -L SmallSize VG SmallPV
lvconvert --thinpool VG/ThinDataLV --poolmetadata VG/ThinMetaLV
Example
-# lvcreate -n pool0 -L 100G vg /dev/sdA
+# lvcreate -n pool0 -L 10G vg /dev/sdA
# lvcreate -n pool0meta -L 1G vg /dev/sdB
# lvconvert --thinpool vg/pool0 --poolmetadata vg/pool0meta
.fi
@@ -293,7 +297,7 @@ lvcreate --type raid1 -m 1 -n ThinDataLV -L LargeSize VG PVC PVD
lvconvert --thinpool VG/ThinDataLV --poolmetadata VG/ThinMetaLV
Example
-# lvcreate --type raid1 -m 1 -n pool0 -L 100G vg /dev/sdA /dev/sdB
+# lvcreate --type raid1 -m 1 -n pool0 -L 10G vg /dev/sdA /dev/sdB
# lvcreate --type raid1 -m 1 -n pool0meta -L 1G vg /dev/sdC /dev/sdD
# lvconvert --thinpool vg/pool0 --poolmetadata vg/pool0meta
.fi
@@ -981,6 +985,111 @@ pool0 vg twi-a-tz-- 8.00m
thin1 vg Vwi-a-tz-- 2.00g pool0
.fi
+
+.SS Merge thin snapshots
+
+\&
+
+A thin snapshot can be merged into its origin thin LV using the lvconvert
+--merge command. The result of a snapshot merge is that the origin thin
+LV takes the content of the snapshot LV, and the snapshot LV is removed.
+Any content that was unique to the origin thin LV is lost after the merge.
+
+Because a merge changes the content of an LV, it cannot be done while the
+LVs are open, e.g. mounted. If a merge is initiated while the LVs are open,
+the effect of the merge is delayed until the origin thin LV is next
+activated.
+
+.nf
+lvconvert --merge VG/SnapLV
+
+Example
+# lvs vg
+LV VG Attr LSize Pool Origin
+pool0 vg twi-a-tz-- 10.00g
+thin1 vg Vwi-a-tz-- 100.00g pool0
+thin1s1 vg Vwi-a-tz-k 100.00g pool0 thin1
+
+# lvconvert --merge vg/thin1s1
+
+# lvs vg
+LV VG Attr LSize Pool Origin
+pool0 vg twi-a-tz-- 10.00g
+thin1 vg Vwi-a-tz-- 100.00g pool0
+.fi
+
+.nf
+Example
+
+Delayed merging of open LVs.
+
+# lvs vg
+LV VG Attr LSize Pool Origin
+pool0 vg twi-a-tz-- 10.00g
+thin1 vg Vwi-aotz-- 100.00g pool0
+thin1s1 vg Vwi-aotz-k 100.00g pool0 thin1
+
+# df
+/dev/mapper/vg-thin1 100G 33M 100G 1% /mnt/X
+/dev/mapper/vg-thin1s1 100G 33M 100G 1% /mnt/Xs
+
+# ls /mnt/X
+file1 file2 file3
+# ls /mnt/Xs
+file3 file4 file5
+
+# lvconvert --merge vg/thin1s1
+Logical volume vg/thin1s1 contains a filesystem in use.
+Delaying merge since snapshot is open.
+Merging of thin snapshot thin1s1 will occur on next activation.
+
+# umount /mnt/X
+# umount /mnt/Xs
+
+# lvs -a vg
+LV VG Attr LSize Pool Origin
+pool0 vg twi-a-tz-- 10.00g
+[pool0_tdata] vg Twi-ao---- 10.00g
+[pool0_tmeta] vg ewi-ao---- 1.00g
+thin1 vg Owi-a-tz-- 100.00g pool0
+[thin1s1] vg Swi-a-tz-k 100.00g pool0 thin1
+
+# lvchange -an vg/thin1
+# lvchange -ay vg/thin1
+
+# mount /dev/vg/thin1 /mnt/X
+
+# ls /mnt/X
+file3 file4 file5
+.fi
+
+
+.SS XFS on snapshots
+
+\&
+
+Mounting an XFS file system on a new snapshot LV requires attention to the
+file system's log state and uuid. On the snapshot LV, the xfs log will
+contain a dummy transaction, and the xfs uuid will match the uuid from the
+file system on the origin LV.
+
+If the snapshot LV is writable, mounting will recover the log to clear the
+dummy transaction, but will require skipping the uuid check:
+
+mount /dev/VG/SnapLV /mnt -o nouuid
+
+Or, the uuid can be changed on disk before mounting:
+
+xfs_admin -U generate /dev/VG/SnapLV
+.br
+mount /dev/VG/SnapLV /mnt
+
+If the snapshot LV is readonly, the log recovery and uuid check need to be
+skipped while mounting readonly:
+
+mount /dev/VG/SnapLV /mnt -o ro,nouuid,norecovery
+
+
.SH SEE ALSO
.BR lvm (8),
.BR lvm.conf (5),
9 years, 12 months
master - man: more lvmthin discard references
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=044b7968005a23...
Commit: 044b7968005a23e52a78c26eb56a7f74a973312f
Parent: 3b989e317fecf115ce9a2b89f777e4feec2461ec
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed May 14 09:44:09 2014 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed May 14 15:15:35 2014 -0500
man: more lvmthin discard references
and some fixes from Tom.
---
man/lvmthin.7.in | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/man/lvmthin.7.in b/man/lvmthin.7.in
index 55b1562..5a4ee87 100644
--- a/man/lvmthin.7.in
+++ b/man/lvmthin.7.in
@@ -23,10 +23,10 @@ that will hold blocks for thin LVs, and a metadata LV that will hold
metadata. The metadata tracks which data blocks belong to each thin LV.
Snapshots of thin LVs are efficient because the data blocks common to a
-thin LV and its snapshot are shared. Snapshots may be taken of thin LVs
-or of other thin snapshots. Blocks common to recursive snapshots are also
-shared in the thin pool. There is no limit to or degradation from
-sequences of snapshots.
+thin LV and any of its snapshots are shared. Snapshots may be taken of
+thin LVs or of other thin snapshots. Blocks common to recursive snapshots
+are also shared in the thin pool. There is no limit to or degradation
+from sequences of snapshots.
As thin LVs or snapshot LVs are written to, they consume data blocks in
the thin pool. As free data blocks in the pool decrease, more free blocks
@@ -620,6 +620,9 @@ pool0 vg twi-a-tz-- 10.00g 47.01 21.03
thin1 vg Vwi-aotz-- 100.00g pool0 2.70
.fi
+The "Discard" section covers an option for automatically freeing data
+space in a thin pool.
+
.SS Automatically extend thin pool LV
@@ -691,7 +694,7 @@ extended. (Disabling dmeventd is not recommended.)
writes to thin LVs in the pool. (This can be addressed by tuning the
thin_pool_autoextend_threshold and thin_pool_autoextend_percent.)
-4. The VG does have enough free blocks to extend the thin pool.
+4. The VG does not have enough free blocks to extend the thin pool.
The response to data space exhaustion is to extend the thin pool. This is
described in the section "Manually manage free data space of thin pool
@@ -768,8 +771,10 @@ controls the default zeroing mode used when creating a thin pool.
\&
-The discard behavior of a thin pool LV determines how discard requests
-are handled. Possible discard behaviors:
+The discard behavior of a thin pool LV determines how discard requests are
+handled. Enabling discard under a file system may adversely affect the
+file system performance (see the section on fstrim for an alternative.)
+Possible discard behaviors:
ignore: Ignore any discards that are received.
@@ -933,7 +938,7 @@ and combines the two into a thin pool LV.
lvcreate -L LargeSize --thinpool VG/ThinPoolLV
Example
-# lvcreate -l1 --thinpool vg/pool0
+# lvcreate -L8M --thinpool vg/pool0
# lvs vg/pool0
LV VG Attr LSize Pool Origin Data%
9 years, 12 months
master - allocation: Fix alloc anywhere with parity.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3b989e317fecf1...
Commit: 3b989e317fecf115ce9a2b89f777e4feec2461ec
Parent: 422b3b0fb53d83bc3ffbd35f7d7505a1938cb24c
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed May 14 16:25:43 2014 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed May 14 16:25:43 2014 +0100
allocation: Fix alloc anywhere with parity.
Take account of parity areas with alloc anywhere in
_calc_required_extents. Extents beyond area_count were treated
incorrectly as mirror logs.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 5 ++---
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 88ae713..8bcf687 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.107 -
==================================
+ Take account of parity areas with alloc anywhere in _calc_required_extents.
Use proper uint64 casting for calculation of cache metadata size.
Better support for nesting of blocking signals.
Use only sigaction handler and drop duplicate signal handler.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 2005826..fa08c39 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -1432,8 +1432,7 @@ static int _alloc_parallel_area(struct alloc_handle *ah, uint32_t max_to_allocat
struct alloced_area *aa;
struct pv_area *pva;
- total_area_count = ah->area_count + alloc_state->log_area_count_still_needed;
- total_area_count += ah->parity_count;
+ total_area_count = ah->area_count + ah->parity_count + alloc_state->log_area_count_still_needed;
if (!total_area_count) {
log_warn(INTERNAL_ERROR "_alloc_parallel_area called without any allocation to do.");
return 1;
@@ -1980,7 +1979,7 @@ static uint32_t _calc_required_extents(struct alloc_handle *ah, struct pv_area *
* reduce amount we're looking for.
*/
if (alloc == ALLOC_ANYWHERE) {
- if (ix_pva >= ah->area_count)
+ if (ix_pva >= ah->area_count + ah->parity_count)
required = ah->log_len;
} else if (required < ah->log_len)
required = ah->log_len;
9 years, 12 months
master - man: Fix man7 dir dependency.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=422b3b0fb53d83...
Commit: 422b3b0fb53d83bc3ffbd35f7d7505a1938cb24c
Parent: 85cf5a23d265c10af7e69b5f85e06e75105d8f14
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue May 13 11:18:13 2014 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue May 13 11:18:13 2014 +0100
man: Fix man7 dir dependency.
https://bugs.gentoo.org/510202
---
man/Makefile.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/man/Makefile.in b/man/Makefile.in
index af108cf..c6a27d0 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -103,7 +103,7 @@ install_man5: $(MAN5)
$(INSTALL) -d $(MAN5DIR)
$(INSTALL_DATA) $(MAN5) $(MAN5DIR)/
-install_man7: $(MAN8)
+install_man7: $(MAN7)
$(INSTALL) -d $(MAN7DIR)
$(INSTALL_DATA) $(MAN7) $(MAN7DIR)/
9 years, 12 months
master - cleanup: improve error message
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=85cf5a23d265c1...
Commit: 85cf5a23d265c10af7e69b5f85e06e75105d8f14
Parent: 7b766b064837110a09d448376ea61af174260ae7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue May 13 10:33:17 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue May 13 10:33:17 2014 +0200
cleanup: improve error message
Update impossile to happen error message.
---
lib/config/config.c | 2 +-
lib/metadata/thin_manip.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/config/config.c b/lib/config/config.c
index 1a9f636..04f917d 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -1767,7 +1767,7 @@ int get_default_allocation_thin_pool_chunk_size_CFG(struct cmd_context *cmd, str
uint32_t chunk_size;
if (!(str = find_config_tree_str(cmd, allocation_thin_pool_chunk_size_policy_CFG, profile))) {
- log_error(INTERNAL_ERROR "Cannot find profile.");
+ log_error(INTERNAL_ERROR "Cannot find configuration.");
return 0;
}
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index c1c90b4..cccd244 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -376,7 +376,7 @@ int update_profilable_pool_params(struct cmd_context *cmd, struct profile *profi
if (!(passed_args & PASS_ARG_CHUNK_SIZE)) {
if (!(*chunk_size = find_config_tree_int(cmd, allocation_thin_pool_chunk_size_CFG, profile) * 2)) {
if (!(str = find_config_tree_str(cmd, allocation_thin_pool_chunk_size_policy_CFG, profile))) {
- log_error(INTERNAL_ERROR "Could not find profile.");
+ log_error(INTERNAL_ERROR "Could not find configuration.");
return 0;
}
if (!strcasecmp(str, "generic"))
@@ -401,7 +401,7 @@ int update_profilable_pool_params(struct cmd_context *cmd, struct profile *profi
if (!(passed_args & PASS_ARG_DISCARDS)) {
if (!(str = find_config_tree_str(cmd, allocation_thin_pool_discards_CFG, profile))) {
- log_error(INTERNAL_ERROR "Could not find profile.");
+ log_error(INTERNAL_ERROR "Could not find configuration.");
return 0;
}
if (!get_pool_discards(str, discards))
9 years, 12 months
master - tests: updates
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7b766b06483711...
Commit: 7b766b064837110a09d448376ea61af174260ae7
Parent: 6f057e3c6640f25676b0c5d0fe93912ac91244bf
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue May 13 10:28:55 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue May 13 10:28:55 2014 +0200
tests: updates
Move thin test out of listing.
---
test/shell/listings.sh | 2 +-
test/shell/lvcreate-thin.sh | 6 +++---
test/shell/snapshot-maxsize.sh | 5 ++---
test/shell/snapshot-usage.sh | 10 ++++++----
4 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/test/shell/listings.sh b/test/shell/listings.sh
index 79c9c89..2121ecd 100644
--- a/test/shell/listings.sh
+++ b/test/shell/listings.sh
@@ -65,10 +65,10 @@ lvcreate -aey -l2 --type mirror -m2 -n $lv3 $vg
test $(lvs --noheadings $vg | wc -l) -eq 2
test $(lvs -a --noheadings $vg | wc -l) -eq 6
dmsetup ls|grep "$PREFIX"|grep -v "LVMTEST.*pv."
+
lvcreate -l2 -s $vg/$lv3
lvcreate -l1 -s -n inval $vg/$lv3
lvcreate -l4 -I4 -i2 -n stripe $vg
-lvcreate -T $vg/pool -I4 -i2 -l5 -V1P -n thin
# Invalidate snapshot
not dd if=/dev/zero of="$DM_DEV_DIR/$vg/inval" bs=4K
invalid lvscan "$dev1"
diff --git a/test/shell/lvcreate-thin.sh b/test/shell/lvcreate-thin.sh
index 0873ce1..7ea4fcf 100644
--- a/test/shell/lvcreate-thin.sh
+++ b/test/shell/lvcreate-thin.sh
@@ -135,7 +135,7 @@ lvremove -ff $vg
check vg_field $vg lv_count 0
# Create thin snapshot of thinLV
-lvcreate -L10M -V10M -T $vg/pool --name lv1
+lvcreate -L10M -I4 -i2 -V10M -T $vg/pool --name lv1
mkfs.ext4 "$DM_DEV_DIR/$vg/lv1"
lvcreate -K -s $vg/lv1 --name snap_lv1
fsck -n "$DM_DEV_DIR/$vg/snap_lv1"
@@ -145,8 +145,10 @@ lvcreate --type snapshot $vg/lv1 --name lv6
lvcreate --type snapshot $vg/lv1 --name lv4
lvcreate --type snapshot $vg/lv1 --name $vg/lv5
+lvdisplay --maps $vg
check_lv_field_modules_ thin-pool,thin lv1 snap_lv1 lv2 lv3 lv4 lv5 lv6
check vg_field $vg lv_count 8
+
lvremove -ff $vg
@@ -163,8 +165,6 @@ check vg_field $vg lv_count 6
lvremove -ff $vg
check vg_field $vg lv_count 0
-lvdisplay $vg
-
# Fail cases
# Too small pool size (1 extent 64KB) for given chunk size
not lvcreate --chunksize 256 -l1 -T $vg/pool1
diff --git a/test/shell/snapshot-maxsize.sh b/test/shell/snapshot-maxsize.sh
index a20e306..e1380c6 100644
--- a/test/shell/snapshot-maxsize.sh
+++ b/test/shell/snapshot-maxsize.sh
@@ -24,8 +24,7 @@ lvcreate -L2 -s $vg/$lv1 -n $lv2
dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv2" bs=1M count=1
-get lv_field $vg/$lv2 lv_attr | tee attrs
-# Snapshot must not be invalid here
-grep -v "....I" attrs
+# Snapshot must not be 'I'nvalid here
+check lv_attr_bit state $vg/$lv2 "a"
vgremove -f $vg
diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh
index 095fddb..589ed43 100644
--- a/test/shell/snapshot-usage.sh
+++ b/test/shell/snapshot-usage.sh
@@ -145,6 +145,7 @@ lvextend -l+33 $vg1/lvol1
check lv_field $vg1/lvol1 size "$EXPECT3"
fill 20K
+
lvremove -f $vg1
# Check snapshot really deletes COW header for read-only snapshot
@@ -172,11 +173,12 @@ fsck -n "$DM_DEV_DIR/$vg1/snap"
# we have 2 valid results (unsure about correct version number)
check lv_field $vg1/snap data_percent "$EXPECT4"
-# Can't test >= 16T devices on 32bit
-if test "$TSIZE" = 15P ; then
-
vgremove -ff $vg1
+
+# Can't test >= 16T devices on 32bit
+test "$TSIZE" = 15P || exit 0
+
# Check usability with largest extent size
pvcreate "$DM_DEV_DIR/$vg/$lv"
vgcreate -s 4G $vg1 "$DM_DEV_DIR/$vg/$lv"
@@ -189,4 +191,4 @@ lvremove -ff $vg1
lvcreate -V15E -l1 -n $lv1 -s $vg1
check lv_field $vg1/$lv1 origin_size "15.00e"
-fi
+vgremove -ff $vg1
9 years, 12 months