master - tests: drop remove
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f4afd07700986b...
Commit: f4afd07700986b368c7ea8543f04f8e2dfc02a8c
Parent: 07ba047116b3fa5e07647ee79854b93c7fb27bb8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Feb 27 14:48:32 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Feb 27 14:48:32 2014 +0100
tests: drop remove
Generates waaaaay too much log from lvmetad test.
TODO: once we will be able to remove more LVs with a single
write - we may restore....
---
test/shell/vgchange-many.sh | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/test/shell/vgchange-many.sh b/test/shell/vgchange-many.sh
index ba3d2b8..491c8b1 100644
--- a/test/shell/vgchange-many.sh
+++ b/test/shell/vgchange-many.sh
@@ -50,5 +50,3 @@ vgcfgrestore -f data_new $vg
# Activate and deactivate all of them
vgchange -ay $vg
vgchange -an $vg
-
-vgremove -ff $vg
10 years, 2 months
master - cleanup: relocate segment flags
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=07ba047116b3fa...
Commit: 07ba047116b3fa5e07647ee79854b93c7fb27bb8
Parent: 47b15b805ed5f605cd9ce93137df409c05fb0b46
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Feb 27 14:46:11 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Feb 27 14:46:11 2014 +0100
cleanup: relocate segment flags
Move flags for segments to segtype header where it seems more closely
related as the features are related to segtype and not activation.
Use unsigned #define - since it's more common in lvm2 source code
for bit flags.
---
lib/activate/activate.h | 25 -------------------------
lib/metadata/segtype.h | 15 +++++++++++++++
2 files changed, 15 insertions(+), 25 deletions(-)
diff --git a/lib/activate/activate.h b/lib/activate/activate.h
index ad14a57..5b17b8a 100644
--- a/lib/activate/activate.h
+++ b/lib/activate/activate.h
@@ -52,31 +52,6 @@ struct lv_activate_opts {
* that follows. */
};
-/* target attribute flags */
-#define MIRROR_LOG_CLUSTERED 0x00000001U
-
-/* snapshot target attribute flags */
-enum {
- SNAPSHOT_FEATURE_FIXED_LEAK = (1 << 0), /* version 1.12 */
-};
-
-/* thin target attribute flags */
-enum {
- /* bitfields - new features from 1.1 version */
- THIN_FEATURE_DISCARDS = (1 << 0),
- THIN_FEATURE_EXTERNAL_ORIGIN = (1 << 1),
- THIN_FEATURE_HELD_ROOT = (1 << 2),
- THIN_FEATURE_BLOCK_SIZE = (1 << 3),
- THIN_FEATURE_DISCARDS_NON_POWER_2 = (1 << 4),
- THIN_FEATURE_METADATA_RESIZE = (1 << 5),
- THIN_FEATURE_EXTERNAL_ORIGIN_EXTEND = (1 << 6),
-};
-
-/* raid target attribute flags */
-enum {
- RAID_FEATURE_RAID10 = (1 << 0), /* version 1.3 */
-};
-
void set_activation(int activation);
int activation(void);
diff --git a/lib/metadata/segtype.h b/lib/metadata/segtype.h
index 75429b4..4f060cd 100644
--- a/lib/metadata/segtype.h
+++ b/lib/metadata/segtype.h
@@ -141,6 +141,9 @@ struct segment_type *init_error_segtype(struct cmd_context *cmd);
struct segment_type *init_free_segtype(struct cmd_context *cmd);
struct segment_type *init_unknown_segtype(struct cmd_context *cmd,
const char *name);
+
+#define RAID_FEATURE_RAID10 (1U << 0) /* version 1.3 */
+
#ifdef RAID_INTERNAL
int init_raid_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
#endif
@@ -149,6 +152,14 @@ int init_raid_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
int init_replicator_segtype(struct cmd_context *cmd, struct segtype_library *seglib);
#endif
+#define THIN_FEATURE_DISCARDS (1U << 0)
+#define THIN_FEATURE_EXTERNAL_ORIGIN (1U << 1)
+#define THIN_FEATURE_HELD_ROOT (1U << 2)
+#define THIN_FEATURE_BLOCK_SIZE (1U << 3)
+#define THIN_FEATURE_DISCARDS_NON_POWER_2 (1U << 4)
+#define THIN_FEATURE_METADATA_RESIZE (1U << 5)
+#define THIN_FEATURE_EXTERNAL_ORIGIN_EXTEND (1U << 6)
+
#ifdef THIN_INTERNAL
int init_thin_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
#endif
@@ -157,10 +168,14 @@ int init_thin_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
int init_cache_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
#endif
+#define SNAPSHOT_FEATURE_FIXED_LEAK (1U << 0) /* version 1.12 */
+
#ifdef SNAPSHOT_INTERNAL
struct segment_type *init_snapshot_segtype(struct cmd_context *cmd);
#endif
+#define MIRROR_LOG_CLUSTERED (1U << 0)
+
#ifdef MIRRORED_INTERNAL
struct segment_type *init_mirrored_segtype(struct cmd_context *cmd);
#endif
10 years, 2 months
master - tests: updates
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=47b15b805ed5f6...
Commit: 47b15b805ed5f605cd9ce93137df409c05fb0b46
Parent: d00fc1de784cee27d6ddb1b045a67c930f743074
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Feb 26 23:25:30 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Feb 27 13:01:04 2014 +0100
tests: updates
Add some vgremove calls.
Remove uneeded test for some unused commands.
Add tests for missing commands.
---
test/shell/activate-minor.sh | 2 ++
test/shell/activate-missing-segment.sh | 2 ++
test/shell/activate-missing.sh | 2 ++
test/shell/activate-partial.sh | 2 +-
test/shell/activation-skip.sh | 2 ++
test/shell/covercmd.sh | 2 ++
test/shell/fsadm.sh | 2 ++
test/shell/inconsistent-metadata.sh | 2 ++
test/shell/listings.sh | 2 ++
test/shell/lock-blocking.sh | 2 ++
test/shell/lock-parallel.sh | 2 ++
test/shell/lvchange-mirror.sh | 3 ++-
test/shell/lvchange-partial-raid10.sh | 3 ++-
test/shell/lvchange-partial.sh | 3 ++-
test/shell/lvchange-raid.sh | 2 ++
test/shell/lvconvert-mirror-basic-0.sh | 3 +++
test/shell/lvconvert-mirror-basic-1.sh | 3 +++
test/shell/lvconvert-mirror-basic-2.sh | 3 +++
test/shell/lvconvert-mirror-basic-3.sh | 3 +++
test/shell/lvconvert-mirror.sh | 2 ++
test/shell/lvconvert-raid.sh | 2 ++
test/shell/lvconvert-raid10.sh | 2 +-
test/shell/lvconvert-repair-policy.sh | 2 ++
test/shell/lvconvert-repair-snapshot.sh | 2 ++
test/shell/lvconvert-repair-thin.sh | 2 ++
test/shell/lvconvert-twostep.sh | 2 ++
test/shell/lvcreate-cache.sh | 3 ++-
test/shell/lvcreate-large-raid.sh | 2 +-
test/shell/lvcreate-large-raid10.sh | 4 ++--
test/shell/lvcreate-large.sh | 2 ++
test/shell/lvcreate-mirror.sh | 2 ++
test/shell/lvcreate-missing.sh | 2 ++
test/shell/lvcreate-operation.sh | 2 ++
test/shell/lvcreate-raid.sh | 3 ++-
test/shell/lvcreate-raid10.sh | 1 +
test/shell/lvcreate-thin-snap.sh | 5 +++--
test/shell/lvcreate-thin.sh | 2 +-
test/shell/lvmcache-exercise.sh | 2 ++
test/shell/lvmetad-dump.sh | 2 ++
test/shell/lvmetad-no-cluster.sh | 2 ++
test/shell/lvmetad-override.sh | 1 +
test/shell/lvmetad-pvscan-cache.sh | 2 ++
test/shell/lvmetad-pvscan-nomda.sh | 2 ++
test/shell/lvmetad-restart.sh | 2 ++
test/shell/lvmetad-warning.sh | 2 ++
test/shell/lvresize-mirror.sh | 2 ++
test/shell/pvmove-all-segtypes.sh | 3 ++-
test/shell/pvmove-basic.sh | 1 -
test/shell/pvmove-cache-segtypes.sh | 1 -
test/shell/pvmove-raid-segtypes.sh | 4 ++--
test/shell/pvmove-restart.sh | 2 ++
test/shell/pvmove-thin-segtypes.sh | 3 ++-
test/shell/pvremove-usage.sh | 2 ++
test/shell/read-ahead.sh | 3 ++-
test/shell/snapshot-lvm1.sh | 2 ++
test/shell/tags.sh | 2 ++
test/shell/unknown-segment.sh | 2 ++
test/shell/unlost-pv.sh | 2 ++
test/shell/vg-name-from-env.sh | 1 +
test/shell/vgchange-many.sh | 2 ++
test/shell/vgchange-maxlv.sh | 2 ++
test/shell/vgchange-partial.sh | 2 ++
test/shell/vgchange-sysinit.sh | 5 +++++
test/shell/vgchange-usage.sh | 1 +
test/shell/vgck.sh | 2 ++
test/shell/vgextend-restoremissing.sh | 2 ++
test/shell/vgimportclone.sh | 2 ++
test/shell/vgreduce-removemissing-snapshot.sh | 2 ++
test/shell/vgreduce-usage.sh | 2 ++
test/shell/vgsplit-stacked.sh | 2 ++
70 files changed, 136 insertions(+), 20 deletions(-)
diff --git a/test/shell/activate-minor.sh b/test/shell/activate-minor.sh
index 3726faa..1cebda4 100644
--- a/test/shell/activate-minor.sh
+++ b/test/shell/activate-minor.sh
@@ -21,3 +21,5 @@ lvchange $vg/foo -My --major=255 --minor=123
lvchange $vg/foo -a y
dmsetup info $vg-foo | tee info
egrep "^Major, minor: *[0-9]+, 123" info
+
+vgremove -ff $vg
diff --git a/test/shell/activate-missing-segment.sh b/test/shell/activate-missing-segment.sh
index 55ec7ec..afda20f 100644
--- a/test/shell/activate-missing-segment.sh
+++ b/test/shell/activate-missing-segment.sh
@@ -27,3 +27,5 @@ aux disable_dev "$dev1"
not vgchange -a y $vg
vgchange -a y --partial $vg
check active $vg span
+
+vgremove -ff $vg
diff --git a/test/shell/activate-missing.sh b/test/shell/activate-missing.sh
index 6f7c7a2..fd57e1a 100644
--- a/test/shell/activate-missing.sh
+++ b/test/shell/activate-missing.sh
@@ -84,3 +84,5 @@ check active $vg linear2
check active $vg linear12
check active $vg mirror12
check active $vg mirror123
+
+vgremove -ff $vg
diff --git a/test/shell/activate-partial.sh b/test/shell/activate-partial.sh
index 757c696..cbfa433 100644
--- a/test/shell/activate-partial.sh
+++ b/test/shell/activate-partial.sh
@@ -28,4 +28,4 @@ vgchange -a n --partial $vg
vgchange -aey --partial $vg
# check vgremove
-vgremove -f $vg
+vgremove -ff $vg
diff --git a/test/shell/activation-skip.sh b/test/shell/activation-skip.sh
index 7c80283..76680b2 100644
--- a/test/shell/activation-skip.sh
+++ b/test/shell/activation-skip.sh
@@ -30,3 +30,5 @@ get lv_field $vg/$lv1 lv_attr | grep -- "-wi------k"
lvchange -ay -K $vg
check active $vg $lv1
+
+vgremove -ff $vg
diff --git a/test/shell/covercmd.sh b/test/shell/covercmd.sh
index 7a24a9c..f9a04e9 100644
--- a/test/shell/covercmd.sh
+++ b/test/shell/covercmd.sh
@@ -122,3 +122,5 @@ lvcreate -l1 -an -Zn $vg3
vgdisplay -s -A | grep $vg1
vgdisplay -s -A | grep $vg2
vgdisplay -s -A | not grep $vg3
+
+vgremove -ff $vg1 $vg2 $vg3
diff --git a/test/shell/fsadm.sh b/test/shell/fsadm.sh
index 8d4b37d..13e5304 100644
--- a/test/shell/fsadm.sh
+++ b/test/shell/fsadm.sh
@@ -17,10 +17,12 @@ aux prepare_vg 1 100
# set to "skip" to avoid testing given fs and test warning result
# i.e. check_reiserfs=skip
+check_ext2=
check_ext3=
check_xfs=
check_reiserfs=
+which mkfs.ext2 || check_ext2=${check_ext2:-mkfs.ext2}
which mkfs.ext3 || check_ext3=${check_ext3:-mkfs.ext3}
which fsck.ext3 || check_ext3=${check_ext3:-fsck.ext3}
which mkfs.xfs || check_xfs=${check_xfs:-mkfs.xfs}
diff --git a/test/shell/inconsistent-metadata.sh b/test/shell/inconsistent-metadata.sh
index 699fea7..06bd310 100644
--- a/test/shell/inconsistent-metadata.sh
+++ b/test/shell/inconsistent-metadata.sh
@@ -73,3 +73,5 @@ vgextend $vg "$dev2"
aux restore_dev "$dev2"
vgscan $cache
should check compare_fields vgs $vg vg_mda_count pvs "$dev2" vg_mda_count
+
+vgremove -ff $vg
diff --git a/test/shell/listings.sh b/test/shell/listings.sh
index e5a3954..bb72055 100644
--- a/test/shell/listings.sh
+++ b/test/shell/listings.sh
@@ -72,3 +72,5 @@ not diff out out2
aux disable_dev $dev1
pvs -o +pv_uuid | grep BADBEE-BAAD-BAAD-BAAD-BAAD-BAAD-BADBEE
+
+vgremove -ff $vg
diff --git a/test/shell/lock-blocking.sh b/test/shell/lock-blocking.sh
index 480a73b..aaf2e0b 100644
--- a/test/shell/lock-blocking.sh
+++ b/test/shell/lock-blocking.sh
@@ -39,3 +39,5 @@ flock_pid=`jobs -p`
not vgremove --config 'global { wait_for_locks = 0 }' $vg
test -f $TESTDIR/var/lock/lvm/P_orphans # still running
kill $flock_pid
+
+vgremove -ff $vg
diff --git a/test/shell/lock-parallel.sh b/test/shell/lock-parallel.sh
index 4820129..e7d15ef 100644
--- a/test/shell/lock-parallel.sh
+++ b/test/shell/lock-parallel.sh
@@ -38,3 +38,5 @@ aux enable_dev "$dev1"
# Check removed $lv2 does not reappear
not check lv_exists $vg $lv2
+
+vgremove -ff $vg
diff --git a/test/shell/lvchange-mirror.sh b/test/shell/lvchange-mirror.sh
index 1a0c06b..37a6e1b 100644
--- a/test/shell/lvchange-mirror.sh
+++ b/test/shell/lvchange-mirror.sh
@@ -31,4 +31,5 @@ lvchange -an $vg/$lv1
check mirror $vg $lv1 "$dev3"
lvchange --resync $vg/$lv1
check mirror $vg $lv1 "$dev3"
-lvremove -ff $vg
+
+vgremove -ff $vg
diff --git a/test/shell/lvchange-partial-raid10.sh b/test/shell/lvchange-partial-raid10.sh
index 64a2389..3141add 100644
--- a/test/shell/lvchange-partial-raid10.sh
+++ b/test/shell/lvchange-partial-raid10.sh
@@ -26,4 +26,5 @@ lvchange -ay $vg/$lv1 --partial
lvchange -an $vg/$lv1
aux enable_dev "$dev1"
-lvremove -ff $vg
+
+vgremove -ff $vg
diff --git a/test/shell/lvchange-partial.sh b/test/shell/lvchange-partial.sh
index b79004d..7483d88 100644
--- a/test/shell/lvchange-partial.sh
+++ b/test/shell/lvchange-partial.sh
@@ -67,4 +67,5 @@ not lvchange --resync -ay $vg/$lv1
not lvchange --resync --addtag foo $vg/$lv1
aux enable_dev "$dev1"
-lvremove -ff $vg
+
+vgremove -ff $vg
diff --git a/test/shell/lvchange-raid.sh b/test/shell/lvchange-raid.sh
index 0ee5290..b6107b9 100644
--- a/test/shell/lvchange-raid.sh
+++ b/test/shell/lvchange-raid.sh
@@ -357,3 +357,5 @@ for i in "-" "snapshot" "thinpool_data" "thinpool_meta"; do
run_checks $vg $lv1 $i
lvremove -ff $vg
done
+
+vgremove -ff $vg
diff --git a/test/shell/lvconvert-mirror-basic-0.sh b/test/shell/lvconvert-mirror-basic-0.sh
index dc71bb8..f08b58e 100644
--- a/test/shell/lvconvert-mirror-basic-0.sh
+++ b/test/shell/lvconvert-mirror-basic-0.sh
@@ -10,4 +10,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. ./shell/lvconvert-mirror-basic.sh
+
test_many 0
+
+vgremove -ff $vg
diff --git a/test/shell/lvconvert-mirror-basic-1.sh b/test/shell/lvconvert-mirror-basic-1.sh
index b7ebf9e..f50f2e1 100644
--- a/test/shell/lvconvert-mirror-basic-1.sh
+++ b/test/shell/lvconvert-mirror-basic-1.sh
@@ -10,4 +10,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. ./shell/lvconvert-mirror-basic.sh
+
test_many 1
+
+vgremove -ff $vg
diff --git a/test/shell/lvconvert-mirror-basic-2.sh b/test/shell/lvconvert-mirror-basic-2.sh
index d47f77d..480206c 100644
--- a/test/shell/lvconvert-mirror-basic-2.sh
+++ b/test/shell/lvconvert-mirror-basic-2.sh
@@ -10,4 +10,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. ./shell/lvconvert-mirror-basic.sh
+
test_many 2
+
+vgremove -ff $vg
diff --git a/test/shell/lvconvert-mirror-basic-3.sh b/test/shell/lvconvert-mirror-basic-3.sh
index 732fb2d..ce906c8 100644
--- a/test/shell/lvconvert-mirror-basic-3.sh
+++ b/test/shell/lvconvert-mirror-basic-3.sh
@@ -10,4 +10,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. ./shell/lvconvert-mirror-basic.sh
+
test_many 3
+
+vgremove -ff $vg
diff --git a/test/shell/lvconvert-mirror.sh b/test/shell/lvconvert-mirror.sh
index 097e0d4..1e9925a 100644
--- a/test/shell/lvconvert-mirror.sh
+++ b/test/shell/lvconvert-mirror.sh
@@ -305,3 +305,5 @@ lvchange -an $vg/$lv1
lvconvert --mirrorlog disk $vg/$lv1 "$dev3:0-1"
check mirror $vg $lv1 "$dev3"
lvremove -ff $vg
+
+vgremove -ff $vg
diff --git a/test/shell/lvconvert-raid.sh b/test/shell/lvconvert-raid.sh
index 0bdb023..a2a7792 100644
--- a/test/shell/lvconvert-raid.sh
+++ b/test/shell/lvconvert-raid.sh
@@ -239,3 +239,5 @@ for i in 4 5 6; do
lvremove -ff $vg
done
+
+vgremove -ff $vg
diff --git a/test/shell/lvconvert-raid10.sh b/test/shell/lvconvert-raid10.sh
index 4b3ceb4..6297f65 100644
--- a/test/shell/lvconvert-raid10.sh
+++ b/test/shell/lvconvert-raid10.sh
@@ -55,4 +55,4 @@ for i in 0 1; do
aux wait_for_sync $vg $lv1
done
-lvremove -ff $vg
+vgremove -ff $vg
diff --git a/test/shell/lvconvert-repair-policy.sh b/test/shell/lvconvert-repair-policy.sh
index 49afb7b..f3fe139 100644
--- a/test/shell/lvconvert-repair-policy.sh
+++ b/test/shell/lvconvert-repair-policy.sh
@@ -89,3 +89,5 @@ repair 'activation { mirror_log_fault_policy = "remove" }'
check mirror $vg mirror core
not check lv_exists $vg mirror_mlog
cleanup "$dev3" "$dev4"
+
+vgremove -ff $vg
diff --git a/test/shell/lvconvert-repair-snapshot.sh b/test/shell/lvconvert-repair-snapshot.sh
index 29576bb..77fd217 100644
--- a/test/shell/lvconvert-repair-snapshot.sh
+++ b/test/shell/lvconvert-repair-snapshot.sh
@@ -25,3 +25,5 @@ vgreduce --removemissing $vg
aux enable_dev "$dev2" "$dev4"
lvs -a -o +devices $vg
check mirror $vg 4way "$dev5"
+
+vgremove -ff $vg
diff --git a/test/shell/lvconvert-repair-thin.sh b/test/shell/lvconvert-repair-thin.sh
index b80b855..37a24ff 100644
--- a/test/shell/lvconvert-repair-thin.sh
+++ b/test/shell/lvconvert-repair-thin.sh
@@ -114,3 +114,5 @@ should vgremove -ff $vg
# Let's do a final forced cleanup
pvremove --yes -ff "$dev3"
pvremove --yes -ff "$dev4"
+
+vgremove -ff $vg
diff --git a/test/shell/lvconvert-twostep.sh b/test/shell/lvconvert-twostep.sh
index 8417e6a..6b1dd51 100644
--- a/test/shell/lvconvert-twostep.sh
+++ b/test/shell/lvconvert-twostep.sh
@@ -26,3 +26,5 @@ test -e LOCAL_CLVMD && exit 0
# FIXME mirrored unsupported in cluster
not lvconvert -m 1 --mirrorlog mirrored $vg/mirror "$dev3" "$dev4" 2>&1 | tee errs
grep "two steps" errs
+
+vgremove -ff $vg
diff --git a/test/shell/lvcreate-cache.sh b/test/shell/lvcreate-cache.sh
index ccfb4ad..21ef5fe 100644
--- a/test/shell/lvcreate-cache.sh
+++ b/test/shell/lvcreate-cache.sh
@@ -127,7 +127,6 @@ lvremove -ff $vg
# Attempt to create smaller cache than origin should fail
lvcreate -l 1 -n $lv1 $vg
not lvcreate --type cache -l 2 $vg/$lv1
-lvremove -ff $vg
# Option testing
@@ -135,3 +134,5 @@ lvremove -ff $vg
# --cachepolicy
# --poolmetadatasize
# --poolmetadataspare
+
+vgremove -ff $vg
diff --git a/test/shell/lvcreate-large-raid.sh b/test/shell/lvcreate-large-raid.sh
index e5d883c..3f06d04 100644
--- a/test/shell/lvcreate-large-raid.sh
+++ b/test/shell/lvcreate-large-raid.sh
@@ -71,4 +71,4 @@ lvremove -ff $vg1
# bz837927 END
-lvremove -ff $vg
+vgremove -ff $vg
diff --git a/test/shell/lvcreate-large-raid10.sh b/test/shell/lvcreate-large-raid10.sh
index 3d02e81..635d7a3 100644
--- a/test/shell/lvcreate-large-raid10.sh
+++ b/test/shell/lvcreate-large-raid10.sh
@@ -38,6 +38,6 @@ vgcreate $vg1 "$DM_DEV_DIR"/$vg/$lv[12345]
lvcreate --type raid10 -m 1 -i 2 -L 200T -n $lv1 $vg1 --nosync
check lv_field $vg1/$lv1 size "200.00t"
-lvremove -ff $vg1
+vgremove -ff $vg1
-lvremove -ff $vg
+vgremove -ff $vg
diff --git a/test/shell/lvcreate-large.sh b/test/shell/lvcreate-large.sh
index f3d3f30..401191b 100644
--- a/test/shell/lvcreate-large.sh
+++ b/test/shell/lvcreate-large.sh
@@ -41,3 +41,5 @@ check lv_field $vg1/$lv1 size "737.28t"
lvremove -ff $vg1/$lv1
lvremove -ff $vg/$lv
+
+vgremove -ff $vg
diff --git a/test/shell/lvcreate-mirror.sh b/test/shell/lvcreate-mirror.sh
index 7826800..6b54081 100644
--- a/test/shell/lvcreate-mirror.sh
+++ b/test/shell/lvcreate-mirror.sh
@@ -34,3 +34,5 @@ lvremove -ff $vg
# creating 2-way mirror with disklog from 2 PVs fails
not lvcreate -aey -l2 --type mirror -m1 -n $lv1 $vg "$dev1" "$dev2"
+
+vgremove -ff $vg
diff --git a/test/shell/lvcreate-missing.sh b/test/shell/lvcreate-missing.sh
index 63471c3..dfc6e65 100644
--- a/test/shell/lvcreate-missing.sh
+++ b/test/shell/lvcreate-missing.sh
@@ -17,3 +17,5 @@ dmsetup remove -f "$dev1" || true
finish_udev_transaction
not lvcreate -n "foo" $vg -l 1
+
+vgremove -ff $vg
diff --git a/test/shell/lvcreate-operation.sh b/test/shell/lvcreate-operation.sh
index 6fc20b6..2aa96d2 100644
--- a/test/shell/lvcreate-operation.sh
+++ b/test/shell/lvcreate-operation.sh
@@ -42,3 +42,5 @@ cleanup_lvs
# Create mirror on one dev with mirrored log using --alloc anywhere, should fail
not lvcreate --type mirror -m 1 -l4 -n $lv1 --mirrorlog mirrored $vg --alloc anywhere "$dev1"
cleanup_lvs
+
+vgremove -ff $vg
diff --git a/test/shell/lvcreate-raid.sh b/test/shell/lvcreate-raid.sh
index 2053d04..a8ae4f1 100644
--- a/test/shell/lvcreate-raid.sh
+++ b/test/shell/lvcreate-raid.sh
@@ -187,4 +187,5 @@ lvcreate --type raid5 -l2 -n raid5 $vg
lv_devices $vg raid5 6
lvcreate --type raid6 -l3 -n raid6 $vg
lv_devices $vg raid6 6
-lvremove -ff $vg
+
+vgremove -ff $vg
diff --git a/test/shell/lvcreate-raid10.sh b/test/shell/lvcreate-raid10.sh
index ba35fdf..68a61f7 100644
--- a/test/shell/lvcreate-raid10.sh
+++ b/test/shell/lvcreate-raid10.sh
@@ -80,3 +80,4 @@ lvremove -ff $vg
#
# FIXME: Add tests that specify particular PVs to use for creation
#
+vgremove -ff $vg
diff --git a/test/shell/lvcreate-thin-snap.sh b/test/shell/lvcreate-thin-snap.sh
index cfc801a..6a6a842 100644
--- a/test/shell/lvcreate-thin-snap.sh
+++ b/test/shell/lvcreate-thin-snap.sh
@@ -27,6 +27,7 @@ check_lv_field_modules_()
# Main
#
aux have_thin 1 0 0 || skip
+which mkfs.ext4 || skip
aux prepare_pvs 2 64
@@ -34,8 +35,8 @@ vgcreate $vg -s 64K $(cat DEVICES)
lvcreate -L10M -V10M -T $vg/pool --name $lv1
mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
-# create thin snapshot of thin LV
-lvcreate -K -s $vg/$lv1 --name snap
+# create read-only thin snapshot of thin LV
+lvcreate -K -s $vg/$lv1 -pr --name snap
# check snapshot filesystem was properly frozen before snapping
fsck -n "$DM_DEV_DIR/$vg/snap"
lvcreate -K -s $vg/$lv1 --name $lv2
diff --git a/test/shell/lvcreate-thin.sh b/test/shell/lvcreate-thin.sh
index a2811d2..721f3d1 100644
--- a/test/shell/lvcreate-thin.sh
+++ b/test/shell/lvcreate-thin.sh
@@ -25,11 +25,11 @@ check_lv_field_modules_()
done
}
-
#
# Main
#
aux have_thin 1 0 0 || skip
+which mkfs.ext4 || skip
aux prepare_pvs 2 64
diff --git a/test/shell/lvmcache-exercise.sh b/test/shell/lvmcache-exercise.sh
index 6e8efda..09522e3 100644
--- a/test/shell/lvmcache-exercise.sh
+++ b/test/shell/lvmcache-exercise.sh
@@ -34,3 +34,5 @@ lvs
lvs -a $vg2 -o+devices 2>&1 | tee out
not grep reappeared out
+
+vgremove -ff $vg1 $vg2
diff --git a/test/shell/lvmetad-dump.sh b/test/shell/lvmetad-dump.sh
index e49eb68..462de1c 100644
--- a/test/shell/lvmetad-dump.sh
+++ b/test/shell/lvmetad-dump.sh
@@ -36,3 +36,5 @@ lvmetad_dump() {
lvmetad_dump ./lvmetad.socket | tee lvmetad.txt
grep $vg1 lvmetad.txt
+
+vgremove -ff $vg1
diff --git a/test/shell/lvmetad-no-cluster.sh b/test/shell/lvmetad-no-cluster.sh
index db68e77..0c53822 100644
--- a/test/shell/lvmetad-no-cluster.sh
+++ b/test/shell/lvmetad-no-cluster.sh
@@ -17,3 +17,5 @@ aux prepare_lvmetad
vgs -vv 2> errs
cat errs
grep 'use_lvmetad' errs
+
+vgremove -ff $vg
diff --git a/test/shell/lvmetad-override.sh b/test/shell/lvmetad-override.sh
index 3fb281a..8f6e641 100644
--- a/test/shell/lvmetad-override.sh
+++ b/test/shell/lvmetad-override.sh
@@ -23,3 +23,4 @@ lvchange -ay $vg1 --config 'global { use_lvmetad = 0 }' 2>&1 | not grep "Failed
aux lvmconf "global/use_lvmetad = 0"
lvchange -ay $vg1 --config 'global { use_lvmetad = 1 }' 2>&1 | grep "Failed to connect"
+vgremove -ff $vg1
diff --git a/test/shell/lvmetad-pvscan-cache.sh b/test/shell/lvmetad-pvscan-cache.sh
index a27b6ad..7b161aa 100644
--- a/test/shell/lvmetad-pvscan-cache.sh
+++ b/test/shell/lvmetad-pvscan-cache.sh
@@ -21,3 +21,5 @@ vgs | grep $vg1
pvscan --cache
vgs | grep $vg1
+
+vgremove -ff $vg1
diff --git a/test/shell/lvmetad-pvscan-nomda.sh b/test/shell/lvmetad-pvscan-nomda.sh
index c04a275..195b8d2 100644
--- a/test/shell/lvmetad-pvscan-nomda.sh
+++ b/test/shell/lvmetad-pvscan-nomda.sh
@@ -47,3 +47,5 @@ pvscan --cache $dev1 -aay
aux lvmconf 'global/use_lvmetad = 0'
check active $vg1 foo
aux lvmconf 'global/use_lvmetad = 1'
+
+vgremove -ff $vg1
diff --git a/test/shell/lvmetad-restart.sh b/test/shell/lvmetad-restart.sh
index 10268c2..585d63b 100644
--- a/test/shell/lvmetad-restart.sh
+++ b/test/shell/lvmetad-restart.sh
@@ -21,3 +21,5 @@ kill $(cat LOCAL_LVMETAD)
aux prepare_lvmetad
vgs | grep $vg1
+
+vgremove -ff $vg1
diff --git a/test/shell/lvmetad-warning.sh b/test/shell/lvmetad-warning.sh
index 3a97a1b..6953165 100644
--- a/test/shell/lvmetad-warning.sh
+++ b/test/shell/lvmetad-warning.sh
@@ -25,3 +25,5 @@ lvchange -ay $vg1 --sysinit 2>&1 | not grep "Failed to connect"
aux prepare_lvmetad
lvchange -ay $vg1 2>&1 | not grep "Failed to connect"
lvchange -ay $vg1 --sysinit 2>&1 | not grep "Failed to connect"
+
+vgremove -ff $vg
diff --git a/test/shell/lvresize-mirror.sh b/test/shell/lvresize-mirror.sh
index 68f0ff8..b4bbb04 100644
--- a/test/shell/lvresize-mirror.sh
+++ b/test/shell/lvresize-mirror.sh
@@ -41,3 +41,5 @@ for deactivate in true false; do
lvremove -ff $vg
done
+
+vgremove -ff $vg
diff --git a/test/shell/pvmove-all-segtypes.sh b/test/shell/pvmove-all-segtypes.sh
index 5e1c71c..130a4e9 100644
--- a/test/shell/pvmove-all-segtypes.sh
+++ b/test/shell/pvmove-all-segtypes.sh
@@ -13,7 +13,6 @@ test_description="ensure pvmove works with all common segment types"
. lib/test
-which mkfs.ext2 || skip
which md5sum || skip
aux prepare_pvs 5 20
@@ -96,3 +95,5 @@ check lv_tree_on $vg ${lv1}_foo "$dev5"
check dev_md5sum $vg snap
lvremove -ff $vg
fi
+
+vgremove -ff $vg
diff --git a/test/shell/pvmove-basic.sh b/test/shell/pvmove-basic.sh
index 69244be..911bbf0 100644
--- a/test/shell/pvmove-basic.sh
+++ b/test/shell/pvmove-basic.sh
@@ -14,7 +14,6 @@ test_description="ensure that pvmove works with basic options"
. lib/test
-which mkfs.ext2 || skip
which md5sum || skip
# ---------------------------------------------------------------------
diff --git a/test/shell/pvmove-cache-segtypes.sh b/test/shell/pvmove-cache-segtypes.sh
index 1c2423e..2b62b1f 100644
--- a/test/shell/pvmove-cache-segtypes.sh
+++ b/test/shell/pvmove-cache-segtypes.sh
@@ -20,7 +20,6 @@ test_description="ensure pvmove works with the cache segment types"
# stacking complications to consider.
test -e LOCAL_CLVMD && skip
-which mkfs.ext2 || skip
which md5sum || skip
aux target_at_least dm-cache 1 3 0 || skip
diff --git a/test/shell/pvmove-raid-segtypes.sh b/test/shell/pvmove-raid-segtypes.sh
index 4b720bb..1b0f129 100644
--- a/test/shell/pvmove-raid-segtypes.sh
+++ b/test/shell/pvmove-raid-segtypes.sh
@@ -14,7 +14,6 @@ test_description="ensure pvmove works with raid segment types"
. lib/test
test -e LOCAL_CLVMD && skip
-which mkfs.ext2 || skip
which md5sum || skip
aux target_at_least dm-raid 1 3 5 || skip
@@ -76,4 +75,5 @@ pvmove -n $lv1 "$dev5" "$dev4"
check lv_tree_on $vg $lv1 "$dev2" "$dev3" "$dev4"
check lv_tree_on $vg ${lv1}_foo "$dev5"
check dev_md5sum $vg $lv1
-lvremove -ff $vg
+
+vgremove -ff $vg
diff --git a/test/shell/pvmove-restart.sh b/test/shell/pvmove-restart.sh
index e1d5381..3f9e151 100644
--- a/test/shell/pvmove-restart.sh
+++ b/test/shell/pvmove-restart.sh
@@ -71,3 +71,5 @@ pvmove --abort
aux delay_dev "$dev3"
lvs -a -o+devices $vg
+
+vgremove -ff $vg
diff --git a/test/shell/pvmove-thin-segtypes.sh b/test/shell/pvmove-thin-segtypes.sh
index fb29fe3..684b3f5 100644
--- a/test/shell/pvmove-thin-segtypes.sh
+++ b/test/shell/pvmove-thin-segtypes.sh
@@ -13,7 +13,6 @@ test_description="ensure pvmove works with thin segment types"
. lib/test
test -e LOCAL_CLVMD && skip
-which mkfs.ext2 || skip
which md5sum || skip
aux target_at_least dm-thin-pool 1 8 0 || skip
@@ -65,3 +64,5 @@ check lv_tree_on $vg $lv1 "$dev2" "$dev4"
check lv_tree_on $vg ${lv1}_foo "$dev5"
check dev_md5sum $vg $lv1
lvremove -ff $vg
+
+vgremove -ff $vg
diff --git a/test/shell/pvremove-usage.sh b/test/shell/pvremove-usage.sh
index aa71215..4f7b35f 100644
--- a/test/shell/pvremove-usage.sh
+++ b/test/shell/pvremove-usage.sh
@@ -66,3 +66,5 @@ for mdacp in 0 1 2; do
pvcreate --metadatacopies $mdacp "$dev1"
vgextend $vg "$dev1"
done
+
+vgremove -ff $vg
diff --git a/test/shell/read-ahead.sh b/test/shell/read-ahead.sh
index 264910c..26335f0 100644
--- a/test/shell/read-ahead.sh
+++ b/test/shell/read-ahead.sh
@@ -46,4 +46,5 @@ lvchange -r 512 $vg/$lv
lvchange -ay $vg/$lv
check lv_field $vg/$lv lv_read_ahead 256.00k
check lv_field $vg/$lv lv_kernel_read_ahead 256.00k
-lvremove -ff $vg
+
+vgremove -ff $vg
diff --git a/test/shell/snapshot-lvm1.sh b/test/shell/snapshot-lvm1.sh
index 4d06f0a..642dd6f 100644
--- a/test/shell/snapshot-lvm1.sh
+++ b/test/shell/snapshot-lvm1.sh
@@ -26,3 +26,5 @@ lvcreate -s $vg/origin -n snap_with_lvm1_meta -l4
# Remove volume snapper/snap_with_lvm1_meta
lvremove -f $vg/snap_with_lvm1_meta
+
+vgremove -ff $vg
diff --git a/test/shell/tags.sh b/test/shell/tags.sh
index 2bf87a1..ee2f610 100644
--- a/test/shell/tags.sh
+++ b/test/shell/tags.sh
@@ -71,3 +71,5 @@ lvchange --deltag firstlvtag2 $vg1/$lv1
lvchange --deltag firstlvtag2 $vg1/$lv1
check lv_field $vg1/$lv1 tags "firstlvtag1,firstlvtag3"
check lv_field $vg1/$lv2 tags "secondlvtag1,secondlvtag2,secondlvtag3"
+
+vgremove -ff $vg1
diff --git a/test/shell/unknown-segment.sh b/test/shell/unknown-segment.sh
index c3bba0a..8ec48d2 100644
--- a/test/shell/unknown-segment.sh
+++ b/test/shell/unknown-segment.sh
@@ -32,3 +32,5 @@ vgcfgbackup -f bak2 $vg
egrep -v 'description|seqno|creation_time|Generated' < bak0.orig > a
egrep -v 'description|seqno|creation_time|Generated' < bak2 > b
diff -u a b
+
+vgremove -ff $vg
diff --git a/test/shell/unlost-pv.sh b/test/shell/unlost-pv.sh
index 3e74e0e..307a71b 100644
--- a/test/shell/unlost-pv.sh
+++ b/test/shell/unlost-pv.sh
@@ -42,3 +42,5 @@ aux enable_dev "$dev1"
check_
test -e LOCAL_LVMETAD && lvremove $vg/boo # FIXME trigger a write :-(
check_ not
+
+vgremove -ff $vg
diff --git a/test/shell/vg-name-from-env.sh b/test/shell/vg-name-from-env.sh
index c8e8c76..dedbfd6 100644
--- a/test/shell/vg-name-from-env.sh
+++ b/test/shell/vg-name-from-env.sh
@@ -102,3 +102,4 @@ not grep $lv3 err
grep $lv2 err
not grep $lv4 err
+vgremove -ff $vg1 $vg2
diff --git a/test/shell/vgchange-many.sh b/test/shell/vgchange-many.sh
index 491c8b1..ba3d2b8 100644
--- a/test/shell/vgchange-many.sh
+++ b/test/shell/vgchange-many.sh
@@ -50,3 +50,5 @@ vgcfgrestore -f data_new $vg
# Activate and deactivate all of them
vgchange -ay $vg
vgchange -an $vg
+
+vgremove -ff $vg
diff --git a/test/shell/vgchange-maxlv.sh b/test/shell/vgchange-maxlv.sh
index 9da08ed..99a6a79 100644
--- a/test/shell/vgchange-maxlv.sh
+++ b/test/shell/vgchange-maxlv.sh
@@ -28,3 +28,5 @@ not lvcreate -n three -l 1 $vg
vgchange --monitor y $vg
vgchange -an $vg 2>&1 | tee vgchange.out
not grep "event server" vgchange.out
+
+vgremove -ff $vg
diff --git a/test/shell/vgchange-partial.sh b/test/shell/vgchange-partial.sh
index 5b21a40..ad99460 100644
--- a/test/shell/vgchange-partial.sh
+++ b/test/shell/vgchange-partial.sh
@@ -50,3 +50,5 @@ not vgchange --vgmetadatacopies 2 $vg
# Ensure that allowed args don't cause disallowed args to get through
#
not vgchange -p 10 --addtag foo $vg
+
+vgremove -ff $vg
diff --git a/test/shell/vgchange-sysinit.sh b/test/shell/vgchange-sysinit.sh
index 67f07df..49c3bde 100644
--- a/test/shell/vgchange-sysinit.sh
+++ b/test/shell/vgchange-sysinit.sh
@@ -50,3 +50,8 @@ vgchange --sysinit -an $vg2
test ! -b "$DM_DEV_DIR/$vg2/$lv2"
vgchange --ignorelockingfailure -ay $vg2
+
+# TODO maybe also support --ignorelockingfailure ??
+vgremove --config 'global{locking_type=0}' -ff $vg2
+umount "$mount_dir" || true
+vgremove -ff $vg1
diff --git a/test/shell/vgchange-usage.sh b/test/shell/vgchange-usage.sh
index a7bd488..0ae9c14 100644
--- a/test/shell/vgchange-usage.sh
+++ b/test/shell/vgchange-usage.sh
@@ -42,3 +42,4 @@ not vgchange -l 1 $vg 2>err
grep "MaxLogicalVolume is less than the current number $lv_count of LVs for" err
aux check vg_field $vg max_lv 128
+vgremove -ff $vg
diff --git a/test/shell/vgck.sh b/test/shell/vgck.sh
index 772233c..0dec605 100644
--- a/test/shell/vgck.sh
+++ b/test/shell/vgck.sh
@@ -29,3 +29,5 @@ fi
dd if=/dev/urandom bs=512 seek=2 count=32 of=$dev2
vgck $vg 2>&1 | tee vgck.out
grep Incorrect vgck.out
+
+vgremove -ff $vg
diff --git a/test/shell/vgextend-restoremissing.sh b/test/shell/vgextend-restoremissing.sh
index 29273ed..143bff7 100644
--- a/test/shell/vgextend-restoremissing.sh
+++ b/test/shell/vgextend-restoremissing.sh
@@ -27,3 +27,5 @@ not lvcreate -aey --type mirror -m 1 -l 1 -n mirror $vg # write operations fail
vgextend --restore $vg "$dev1" # restore the missing device
vgck $vg
lvcreate -an -Zn --type mirror -m 1 -l 1 -n mirror $vg
+
+vgremove -ff $vg
diff --git a/test/shell/vgimportclone.sh b/test/shell/vgimportclone.sh
index 0c81585..cf85518 100644
--- a/test/shell/vgimportclone.sh
+++ b/test/shell/vgimportclone.sh
@@ -43,3 +43,5 @@ aux notify_lvmetad "$dev1"
# Verify we can activate / deactivate the LV from both VGs
lvchange -ay $vg1/$lv1 $vg2/$lv1
vgchange -an $vg1 $vg2
+
+vgremove -ff $vg1 $vg2
diff --git a/test/shell/vgreduce-removemissing-snapshot.sh b/test/shell/vgreduce-removemissing-snapshot.sh
index 3f24c7f..c587b17 100644
--- a/test/shell/vgreduce-removemissing-snapshot.sh
+++ b/test/shell/vgreduce-removemissing-snapshot.sh
@@ -33,3 +33,5 @@ vgreduce -v --removemissing --force $vg # "$dev2" "$dev4"
lvs -a -o +devices $vg | not grep unknown
lvs -a -o +devices $vg
check mirror $vg 4way "$dev5"
+
+vgremove -ff $vg
diff --git a/test/shell/vgreduce-usage.sh b/test/shell/vgreduce-usage.sh
index 29475b2..fab7496 100644
--- a/test/shell/vgreduce-usage.sh
+++ b/test/shell/vgreduce-usage.sh
@@ -87,3 +87,5 @@ aux enable_dev "$dev1"
pvs -P $(cat DEVICES) # for record
lvs -P $vg1 # for record
vgs -P $vg1 # for record
+
+vgremove -ff $vg1
diff --git a/test/shell/vgsplit-stacked.sh b/test/shell/vgsplit-stacked.sh
index c8b89b5..4373b20 100644
--- a/test/shell/vgsplit-stacked.sh
+++ b/test/shell/vgsplit-stacked.sh
@@ -25,3 +25,5 @@ vgchange -a n $vg $vg1
# this should fail but not segfault, RHBZ 481793.
not vgsplit $vg $vg1 "$dev3"
+
+vgremove -ff $vg $vg1
10 years, 2 months
master - snapshot: correct previous snapshot commit
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d00fc1de784cee...
Commit: d00fc1de784cee27d6ddb1b045a67c930f743074
Parent: 1769eddde7dcdd16716d646e14487cc1df6a3efc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Feb 27 12:55:50 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Feb 27 13:00:49 2014 +0100
snapshot: correct previous snapshot commit
Condition was swapped - however since it's been based on 'random'
memory content it's been missed as attribute has not been set.
So now we have quite a few possible results when testing.
We have old status without separate metadata and
we have kernels with fixed snapshot leak bug.
(in-release update)
---
lib/metadata/snapshot_manip.c | 4 ++--
lib/snapshot/snapshot.c | 3 +++
test/shell/snapshot-usage.sh | 31 ++++++++++++++++++++++++-------
3 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c
index 25fee76..8fcab0c 100644
--- a/lib/metadata/snapshot_manip.c
+++ b/lib/metadata/snapshot_manip.c
@@ -46,9 +46,9 @@ static uint64_t _cow_extra_chunks(struct cmd_context *cmd, uint64_t n_chunks)
segtype->ops->target_present &&
segtype->ops->target_present(cmd, NULL, &attrs) &&
(attrs & SNAPSHOT_FEATURE_FIXED_LEAK))
- return (n_chunks + 63) / 64;
+ return 0;
- return 0;
+ return (n_chunks + 63) / 64;
}
static uint64_t _cow_max_size(struct cmd_context *cmd, uint64_t origin_size, uint32_t chunk_size)
diff --git a/lib/snapshot/snapshot.c b/lib/snapshot/snapshot.c
index 0b7b845..64919b0 100644
--- a/lib/snapshot/snapshot.c
+++ b/lib/snapshot/snapshot.c
@@ -165,6 +165,9 @@ static int _snap_target_present(struct cmd_context *cmd,
log_very_verbose("Target snapshot may leak metadata.");
}
+ if (attributes)
+ *attributes = _snap_attrs;
+
/* TODO: test everything at once */
if (seg && (seg->status & MERGING)) {
if (!_snap_merge_checked) {
diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh
index cb60556..bd0723d 100644
--- a/test/shell/snapshot-usage.sh
+++ b/test/shell/snapshot-usage.sh
@@ -33,6 +33,25 @@ vgcreate -s 4M $vg $(cat DEVICES)
TSIZE=15P
aux can_use_16T || TSIZE=15T
+# With different snapshot target driver we may obtain different results.
+# Older targets have metadata leak bug which needs extra compenstion.
+# Ancient targets do not even provide separate info for metadata.
+EXPECT1="16.00k"
+EXPECT2="512.00k"
+EXPECT3="32.00k"
+EXPECT4="66.67"
+if aux target_at_least dm-snapshot 1 10 0 ; then
+ # Extra metadata size
+ EXPECT4="0.00"
+
+ if aux target_at_least dm-snapshot 1 12 0 ; then
+ # When fixed leak, expect smaller sizes
+ EXPECT1="12.00k"
+ EXPECT2="384.00k"
+ EXPECT3="28.00k"
+ fi
+fi
+
lvcreate -s -l 100%FREE -n $lv $vg --virtualsize $TSIZE
aux extend_filter_LVMTEST
@@ -86,12 +105,12 @@ lvcreate -an -Zn -l1 -n $lv1 $vg1
not lvcreate -s -l1 $vg1/$lv1
not lvcreate -s -l3 $vg1/$lv1
lvcreate -s -l30 -n $lv2 $vg1/$lv1
-check lv_field $vg1/$lv2 size "12.00k"
+check lv_field $vg1/$lv2 size "$EXPECT1"
not lvcreate -s -c512 -l512 $vg1/$lv1
lvcreate -s -c128 -l1700 -n $lv3 $vg1/$lv1
# 3 * 128
-check lv_field $vg1/$lv3 size "384.00k"
+check lv_field $vg1/$lv3 size "$EXPECT2"
lvremove -ff $vg1
lvcreate -aey -l20 $vg1
@@ -110,7 +129,7 @@ lvextend --use-policies $vg1/lvol1
check lv_field $vg1/lvol1 size "18.00k"
lvextend -l+33 $vg1/lvol1
-check lv_field $vg1/lvol1 size "32.00k"
+check lv_field $vg1/lvol1 size "$EXPECT3"
fill 20K
lvremove -f $vg1
@@ -138,14 +157,12 @@ fsck -n "$DM_DEV_DIR/$vg1/snap"
# This test would trigger read of weird percentage for undeleted header
# And since older snapshot target counts with metadata sectors
# we have 2 valid results (unsure about correct version number)
-EXPECT="0.00"
-aux target_at_least dm-snapshot 1 10 0 || EXPECT="66.67"
-check lv_field $vg1/snap data_percent "$EXPECT"
+check lv_field $vg1/snap data_percent "$EXPECT4"
vgremove -ff $vg1
# Can't test >= 16T devices on 32bit
-if test "$TSIZE" -eq 15P ; then
+if test "$TSIZE" = 15P ; then
# Check usability with largest extent size
pvcreate "$DM_DEV_DIR/$vg/$lv"
10 years, 2 months
master - lvmetad: Make token_mismatch handling more robust in the clients.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1769eddde7dcdd...
Commit: 1769eddde7dcdd16716d646e14487cc1df6a3efc
Parent: 4143b284f8871b57b416eeab795489fcc66ed017
Author: Petr Rockai <me(a)mornfall.net>
AuthorDate: Wed Feb 26 15:11:00 2014 +0100
Committer: Petr Rockai <me(a)mornfall.net>
CommitterDate: Wed Feb 26 15:11:00 2014 +0100
lvmetad: Make token_mismatch handling more robust in the clients.
---
lib/cache/lvmetad.c | 27 +++++++++++++++++++++------
1 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index 61361ed..c994874 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -159,12 +159,27 @@ retry:
daemon_request_destroy(req);
if (!repl.error && !strcmp(daemon_reply_str(repl, "response", ""), "token_mismatch") &&
- try < 2 && !test_mode()) {
- if (lvmetad_pvscan_all_devs(_lvmetad_cmd, NULL)) {
- ++ try;
- daemon_reply_destroy(repl);
- goto retry;
- }
+ try < 60 && !test_mode()) {
+ /*
+ * If another process is trying to scan, they might have the
+ * same future token id and it's better to wait and avoid doing
+ * the work multiple times. For the case the future token is
+ * different, the wait is randomized so that multiple waiting
+ * processes do not start scanning all at once.
+ *
+ * If the token is mismatched because of global_filter changes,
+ * we re-scan immediately, but if we lose the potential race for
+ * the update, we back off for a short while (0.2-2 seconds) and
+ * try again.
+ */
+ if (!strcmp(daemon_reply_str(repl, "expected", ""), "update in progress") || try % 5)
+ usleep( 50000 + random() % 450000 ); /* 0.05 - 0.5s */
+ else
+ /* If the re-scan fails here, we try again later. */
+ lvmetad_pvscan_all_devs(_lvmetad_cmd, NULL);
+ ++ try;
+ daemon_reply_destroy(repl);
+ goto retry;
}
return repl;
10 years, 2 months
master - lvmetad: Make "reason" in a token_mismatch reply more informative.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4143b284f8871b...
Commit: 4143b284f8871b57b416eeab795489fcc66ed017
Parent: 40e6176d251b68f5be8ca7925a2f073982de6cec
Author: Petr Rockai <me(a)mornfall.net>
AuthorDate: Wed Feb 26 15:10:21 2014 +0100
Committer: Petr Rockai <me(a)mornfall.net>
CommitterDate: Wed Feb 26 15:10:21 2014 +0100
lvmetad: Make "reason" in a token_mismatch reply more informative.
---
daemons/lvmetad/lvmetad-core.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index ab0573f..e6e222f 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -1095,7 +1095,8 @@ static response handler(daemon_state s, client_handle h, request r)
return daemon_reply_simple("token_mismatch",
"expected = %s", state->token,
"received = %s", token,
- "reason = %s", "token mismatch", NULL);
+ "reason = %s",
+ "lvmetad cache is invalid due to a global_filter change or due to a running rescan", NULL);
}
pthread_mutex_unlock(&state->token_lock);
10 years, 2 months
master - snapshots: fix incorrect calculation of cow size
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=40e6176d251b68...
Commit: 40e6176d251b68f5be8ca7925a2f073982de6cec
Parent: 014ba37cb19c9172b1b81af3f31897939f72b1d2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Feb 25 19:43:07 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Feb 26 14:25:09 2014 +0100
snapshots: fix incorrect calculation of cow size
Code uses target driver version for better estimation of
max size of COW device for snapshot.
The bug can be tested with this script:
VG=vg1
lvremove -f $VG/origin
set -e
lvcreate -L 2143289344b -n origin $VG
lvcreate -n snap -c 8k -L 2304M -s $VG/origin
dd if=/dev/zero of=/dev/$VG/snap bs=1M count=2044 oflag=direct
The bug happens when these two conditions are met
* origin size is divisible by (chunk_size/16) - so that the last
metadata area is filled completely
* the miscalculated snapshot metadata size is divisible by extent size -
so that there is no padding to extent boundary which would otherwise
save us
Signed-off-by:Mikulas Patocka <mpatocka(a)redhat.com>
---
WHATS_NEW | 1 +
lib/activate/activate.h | 5 ++++
lib/metadata/snapshot_manip.c | 43 ++++++++++++++++++++++++++++++----------
lib/snapshot/snapshot.c | 15 ++++++++++++-
test/shell/snapshot-usage.sh | 2 +-
5 files changed, 52 insertions(+), 14 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 9a3da75..224e351 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Fix calculation of maximum size of COW device for snapshot (2.02.99).
Do not allow stripe size to be bigger then extent size for lvresize.
Zero snapshot COW header when creating read-only snapshot.
Comment out config lines in dumpconfig output without default values defined.
diff --git a/lib/activate/activate.h b/lib/activate/activate.h
index c3cf3d9..ad14a57 100644
--- a/lib/activate/activate.h
+++ b/lib/activate/activate.h
@@ -55,6 +55,11 @@ struct lv_activate_opts {
/* target attribute flags */
#define MIRROR_LOG_CLUSTERED 0x00000001U
+/* snapshot target attribute flags */
+enum {
+ SNAPSHOT_FEATURE_FIXED_LEAK = (1 << 0), /* version 1.12 */
+};
+
/* thin target attribute flags */
enum {
/* bitfields - new features from 1.1 version */
diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c
index 362c805..25fee76 100644
--- a/lib/metadata/snapshot_manip.c
+++ b/lib/metadata/snapshot_manip.c
@@ -32,7 +32,26 @@ int lv_is_cow(const struct logical_volume *lv)
return (!lv_is_thin_volume(lv) && !lv_is_origin(lv) && lv->snapshot) ? 1 : 0;
}
-static uint64_t _cow_max_size(uint64_t origin_size, uint32_t chunk_size)
+/*
+ * Some kernels have a bug that they may leak space in the snapshot on crash.
+ * If the kernel is buggy, we add some extra space.
+ */
+static uint64_t _cow_extra_chunks(struct cmd_context *cmd, uint64_t n_chunks)
+{
+ const struct segment_type *segtype;
+ unsigned attrs;
+
+ if (activation() &&
+ (segtype = get_segtype_from_string(cmd, "snapshot")) &&
+ segtype->ops->target_present &&
+ segtype->ops->target_present(cmd, NULL, &attrs) &&
+ (attrs & SNAPSHOT_FEATURE_FIXED_LEAK))
+ return (n_chunks + 63) / 64;
+
+ return 0;
+}
+
+static uint64_t _cow_max_size(struct cmd_context *cmd, uint64_t origin_size, uint32_t chunk_size)
{
/* Snapshot disk layout:
* COW is divided into chunks
@@ -41,21 +60,22 @@ static uint64_t _cow_max_size(uint64_t origin_size, uint32_t chunk_size)
* 3rd. chunk is the 1st. data chunk
*/
- /* Size of metadata for snapshot in sectors */
- uint64_t mdata_size = ((origin_size + chunk_size - 1) / chunk_size * 16 + 511) >> SECTOR_SHIFT;
+ uint64_t origin_chunks = (origin_size + chunk_size - 1) / chunk_size;
+ uint64_t chunks_per_metadata_area = (uint64_t)chunk_size << (SECTOR_SHIFT - 4);
- /* Sum all chunks - header + metadata size + origin size (aligned on chunk boundary) */
- uint64_t size = chunk_size +
- ((mdata_size + chunk_size - 1) & ~(uint64_t)(chunk_size - 1)) +
- ((origin_size + chunk_size - 1) & ~(uint64_t)(chunk_size - 1));
+ /*
+ * Note: if origin_chunks is divisible by chunks_per_metadata_area, we
+ * need one extra metadata chunk as a terminator.
+ */
+ uint64_t metadata_chunks = (origin_chunks + chunks_per_metadata_area) / chunks_per_metadata_area;
+ uint64_t n_chunks = 1 + origin_chunks + metadata_chunks;
- /* Does not overflow since size is in sectors (9 bits) */
- return size;
+ return (n_chunks + _cow_extra_chunks(cmd, n_chunks)) * chunk_size;
}
uint32_t cow_max_extents(const struct logical_volume *origin, uint32_t chunk_size)
{
- uint64_t size = _cow_max_size(origin->size, chunk_size);
+ uint64_t size = _cow_max_size(origin->vg->cmd, origin->size, chunk_size);
uint32_t extent_size = origin->vg->extent_size;
uint64_t max_size = (uint64_t) MAX_EXTENT_COUNT * extent_size;
@@ -71,7 +91,8 @@ uint32_t cow_max_extents(const struct logical_volume *origin, uint32_t chunk_siz
int lv_is_cow_covering_origin(const struct logical_volume *lv)
{
return lv_is_cow(lv) &&
- (lv->size >= _cow_max_size(origin_from_cow(lv)->size, find_snapshot(lv)->chunk_size));
+ (lv->size >= _cow_max_size(lv->vg->cmd, origin_from_cow(lv)->size,
+ find_snapshot(lv)->chunk_size));
}
int lv_is_visible(const struct logical_volume *lv)
diff --git a/lib/snapshot/snapshot.c b/lib/snapshot/snapshot.c
index 91e778f..0b7b845 100644
--- a/lib/snapshot/snapshot.c
+++ b/lib/snapshot/snapshot.c
@@ -142,19 +142,30 @@ static int _snap_target_percent(void **target_state __attribute__((unused)),
static int _snap_target_present(struct cmd_context *cmd,
const struct lv_segment *seg,
- unsigned *attributes __attribute__((unused)))
+ unsigned *attributes)
{
static int _snap_checked = 0;
static int _snap_merge_checked = 0;
static int _snap_present = 0;
static int _snap_merge_present = 0;
+ static unsigned _snap_attrs = 0;
+ uint32_t maj, min, patchlevel;
if (!_snap_checked) {
+ _snap_checked = 1;
_snap_present = target_present(cmd, "snapshot", 1) &&
target_present(cmd, "snapshot-origin", 0);
- _snap_checked = 1;
+
+ if (_snap_present &&
+ target_version("snapshot", &maj, &min, &patchlevel) &&
+ (maj > 1 ||
+ (maj == 1 && (min >= 12 || (min == 10 && patchlevel >= 2)))))
+ _snap_attrs |= SNAPSHOT_FEATURE_FIXED_LEAK;
+ else
+ log_very_verbose("Target snapshot may leak metadata.");
}
+ /* TODO: test everything at once */
if (seg && (seg->status & MERGING)) {
if (!_snap_merge_checked) {
_snap_merge_present = target_present(cmd, "snapshot-merge", 0);
diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh
index 4d15fb1..cb60556 100644
--- a/test/shell/snapshot-usage.sh
+++ b/test/shell/snapshot-usage.sh
@@ -110,7 +110,7 @@ lvextend --use-policies $vg1/lvol1
check lv_field $vg1/lvol1 size "18.00k"
lvextend -l+33 $vg1/lvol1
-check lv_field $vg1/lvol1 size "28.00k"
+check lv_field $vg1/lvol1 size "32.00k"
fill 20K
lvremove -f $vg1
10 years, 2 months
master - lvresize: fix stripe size validation
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=014ba37cb19c91...
Commit: 014ba37cb19c9172b1b81af3f31897939f72b1d2
Parent: b5e03c88b8b31db9a4b27c2e1a50441f99e0da48
Author: Zhiqing Zhang <zhangzq.fnst(a)cn.fujitsu.com>
AuthorDate: Wed Feb 26 10:14:18 2014 +0800
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Feb 26 13:25:50 2014 +0100
lvresize: fix stripe size validation
While stripe size is twice the physical extent size,
the original code will not reduce stripe size to maximum
(physical extent size).
Signed-off-by: Zhiqing Zhang <zhangzq.fnst(a)cn.fujitsu.com>
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 11 ++++++-----
man/lvresize.8.in | 4 +++-
test/shell/lvresize-usage.sh | 9 +++++++--
4 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 05218ee..9a3da75 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Do not allow stripe size to be bigger then extent size for lvresize.
Zero snapshot COW header when creating read-only snapshot.
Comment out config lines in dumpconfig output without default values defined.
Improve detection of clustered mirror support.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 9dd8f0e..57ce2d9 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -3406,6 +3406,7 @@ int lv_rename(struct cmd_context *cmd, struct logical_volume *lv,
#define SIZE_BUF 128
+/* TODO: unify stripe size validation across source code */
static int _validate_stripesize(struct cmd_context *cmd,
const struct volume_group *vg,
struct lvresize_params *lp)
@@ -3419,11 +3420,11 @@ static int _validate_stripesize(struct cmd_context *cmd,
if (!(vg->fid->fmt->features & FMT_SEGMENTS))
log_warn("Varied stripesize not supported. Ignoring.");
- else if (lp->ac_stripesize_value > (uint64_t) vg->extent_size * 2) {
- log_error("Reducing stripe size %s to maximum, "
- "physical extent size %s",
- display_size(cmd,lp->ac_stripesize_value),
- display_size(cmd, (uint64_t) vg->extent_size));
+ else if (lp->ac_stripesize_value > vg->extent_size) {
+ log_print_unless_silent("Reducing stripe size %s to maximum, "
+ "physical extent size %s",
+ display_size(cmd, lp->ac_stripesize_value),
+ display_size(cmd, vg->extent_size));
lp->stripe_size = vg->extent_size;
} else
lp->stripe_size = lp->ac_stripesize_value;
diff --git a/man/lvresize.8.in b/man/lvresize.8.in
index 14fc7ba..75d20a0 100644
--- a/man/lvresize.8.in
+++ b/man/lvresize.8.in
@@ -95,7 +95,9 @@ Defaults to whatever the last segment of the Logical Volume uses.
Not applicable to LVs using the original metadata LVM format, which
must use a single value throughout.
.br
-StripeSize must be 2^n (n = 2 to 9).
+StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format.
+For metadata in LVM2 format, the stripe size may be a larger
+power of 2 but must not exceed the physical extent size.
.TP
.B \-\-noudevsync
Disable udev synchronisation. The
diff --git a/test/shell/lvresize-usage.sh b/test/shell/lvresize-usage.sh
index 51ef221..84431ed 100644
--- a/test/shell/lvresize-usage.sh
+++ b/test/shell/lvresize-usage.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2007-2008 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2007-2014 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -11,7 +11,7 @@
. lib/test
-aux prepare_vg 2
+aux prepare_vg 2 80
lvcreate -L 10M -n lv -i2 $vg
lvresize -l +4 $vg/lv
@@ -19,3 +19,8 @@ lvremove -ff $vg
lvcreate -L 64M -n $lv -i2 $vg
not lvresize -v -l +4 xxx/$lv
+
+# Check stripe size is reduced to extent size when it's bigger
+ESIZE=$(get vg_field $vg vg_extent_size --units b)
+lvextend -L+64m -i 2 -I$(( ${ESIZE%%B} * 2 ))B $vg/$lv 2>&1 | tee err
+grep "Reducing stripe size" err
10 years, 2 months
master - tests: support for older snapshot target version
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b5e03c88b8b31d...
Commit: b5e03c88b8b31db9a4b27c2e1a50441f99e0da48
Parent: aef60160112832b2773b128e30668d4fe3dda707
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Feb 26 11:16:08 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Feb 26 11:17:39 2014 +0100
tests: support for older snapshot target version
TODO: unsure about 1.10...
---
test/shell/snapshot-usage.sh | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh
index bf78ac5..4d15fb1 100644
--- a/test/shell/snapshot-usage.sh
+++ b/test/shell/snapshot-usage.sh
@@ -135,8 +135,12 @@ lvcreate -s -pr -l12 -n snap $vg1/$lv
#dd if="$DM_DEV_DIR/$vg1/snap" of=/dev/null bs=1M count=2
fsck -n "$DM_DEV_DIR/$vg1/snap"
-# This would trigger read of weird percentage for undeleted header
-check lv_field $vg1/snap data_percent "0.00"
+# This test would trigger read of weird percentage for undeleted header
+# And since older snapshot target counts with metadata sectors
+# we have 2 valid results (unsure about correct version number)
+EXPECT="0.00"
+aux target_at_least dm-snapshot 1 10 0 || EXPECT="66.67"
+check lv_field $vg1/snap data_percent "$EXPECT"
vgremove -ff $vg1
10 years, 2 months
master - tests: improve read-only test for snapshot
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=aef60160112832...
Commit: aef60160112832b2773b128e30668d4fe3dda707
Parent: 2b044452e30accf9ee026fc62ccea219bb4c7be4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Feb 26 10:19:46 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Feb 26 10:19:46 2014 +0100
tests: improve read-only test for snapshot
Switch to use ext2 to make it usable on older systems.
Previous test has not been able to catching problem.
Multiple tests are now put in.
FIXME: validate what is doing kernel target when
the header is undeleted and same chunk size is used.
It seems snapshot target successfully resumes and
just complains COW is not big enough:
kernel: dm-8: rw=0, want=40, limit=24
kernel: attempt to access beyond end of device
When chunk size is different it fails instantly.
For checking this with lvm2 and this test case use this patch:
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -769,7 +769,7 @@ static int _read_activation_params(struct
lvcreate_params *lp,
lp->permission = arg_uint_value(cmd, permission_ARG,
LVM_READ | LVM_WRITE);
- if (lp->snapshot) {
+ if (0 && lp->snapshot) {
/* Snapshot has to zero COW header */
lp->zero = 1;
lp->wipe_signatures = 0;
---
and switch to use -c 4 for both snapshots
---
test/shell/snapshot-usage.sh | 39 ++++++++++++++++++++++++++++-----------
1 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh
index 62a70e0..bf78ac5 100644
--- a/test/shell/snapshot-usage.sh
+++ b/test/shell/snapshot-usage.sh
@@ -13,6 +13,9 @@
. lib/test
+MKFS=mkfs.ext2
+which $MKFS || skip
+
fill() {
dd if=/dev/zero of="$DM_DEV_DIR/$vg1/lvol0" bs=$1 count=1
}
@@ -110,6 +113,31 @@ lvextend -l+33 $vg1/lvol1
check lv_field $vg1/lvol1 size "28.00k"
fill 20K
+lvremove -f $vg1
+
+# Check snapshot really deletes COW header for read-only snapshot
+# Test needs special relation between chunk size and extent size
+# This test expects extent size 1K
+aux lvmconf "allocation/wipe_signatures_when_zeroing_new_lvs = 1"
+lvcreate -aey -L4 -n $lv $vg1
+lvcreate -c 8 -s -L1 -n snap $vg1/$lv
+# Populate snapshot
+#dd if=/dev/urandom of="$DM_DEV_DIR/$vg1/$lv" bs=4096 count=10
+$MKFS "$DM_DEV_DIR/$vg1/$lv"
+lvremove -f $vg1/snap
+
+# Undeleted header would trigger attempt to access
+# beyond end of COW device
+# Fails to create when chunk size is different
+lvcreate -s -pr -l12 -n snap $vg1/$lv
+
+# When header is undelete, fails to read snapshot without read errors
+#dd if="$DM_DEV_DIR/$vg1/snap" of=/dev/null bs=1M count=2
+fsck -n "$DM_DEV_DIR/$vg1/snap"
+
+# This would trigger read of weird percentage for undeleted header
+check lv_field $vg1/snap data_percent "0.00"
+
vgremove -ff $vg1
# Can't test >= 16T devices on 32bit
@@ -131,15 +159,4 @@ vgremove -ff $vg1
fi
-lvremove -f $vg
-
-# Check snapshot really deletes COW header for read-only snapshot
-aux lvmconf "allocation/wipe_signatures_when_zeroing_new_lvs = 1"
-lvcreate -L10 -n $lv1 $vg
-lvcreate -s -L10 -n snap $vg/$lv1
-# Populate snapshot with some filesystem signatures
-mkfs.ext4 "$DM_DEV_DIR/$vg/snap"
-lvremove -f $vg/snap
-lvcreate -s -pr -l12 -n snap $vg/$lv1
-
vgremove -ff $vg
10 years, 2 months