master - WHATS_NEW: recent commits
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=406d8ff3323dde...
Commit: 406d8ff3323dde6860d88b603701aa4dace47af0
Parent: 00348c0a630a7e5578edf48052ec695b15de752f
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Oct 29 16:50:09 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Oct 29 16:50:09 2015 +0100
WHATS_NEW: recent commits
---
WHATS_NEW | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 03c70d6..00e807e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,7 @@
Version 2.02.133 -
======================================
- Check metadata area size is at least minimum size of 8 * memory page size.
+ Check newly created VG's metadata do not overlap in metadata ring buffer.
+ Check metadata area size is at least the minimum size defined for the format.
Thin pool targets uses low_water_mark from profile.
Dropping 'yet' from error of unsupported thick snapshot of snapshots.
Do not support unpartitioned DASD devices with CDL formatted with pvcreate.
8 years, 6 months
master - metadata: format_text: check VG metadata do not overlap themselves
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=00348c0a630a7e...
Commit: 00348c0a630a7e5578edf48052ec695b15de752f
Parent: ccb8da404d00288b7d49c7a28006ec5d4687bb55
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Oct 29 16:33:06 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Oct 29 16:46:41 2015 +0100
metadata: format_text: check VG metadata do not overlap themselves
We're already checking whether old and new meta do not overlap in
ring buffer (as we need to keep both old and new meta during vg_write
up until vg_commit).
We also need to check whether the new metadata do not overlap
themselves in case we don't have old metadata yet (...because
we're in vgcreate). This could happen if we're creating a VG so
that the very first metadata written are long enough that it wraps
themselves in metadata ring buffer.
Although we limited the minimum metadata area size better with the
previous commit ccb8da404d00288b7d49c7a28006ec5d4687bb55 which
makes the initial VG metadata overlap in ring buffer to be less
probable, the risk of hitting this overlap condition is still there
if we still manage to generate big enough metadata somehow.
For example, users can provide many and/or long VG tags during vgcreate
so that the VG metadata is long enough to start to wrap in the ring
buffer again...
---
lib/format_text/format-text.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 6c653ca..84d0947 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -654,6 +654,7 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
if ((new_wrap && old_wrap) ||
(rlocn && (new_wrap || old_wrap) && (new_end > rlocn->offset)) ||
+ (!rlocn && new_wrap && (new_end > mdac->rlocn.offset)) ||
(mdac->rlocn.size >= mdah->size)) {
log_error("VG %s metadata too large for circular buffer",
vg->name);
8 years, 6 months
master - metadata: format_text: check metadata area size is at least MDA_SIZE_MIN
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ccb8da404d0028...
Commit: ccb8da404d00288b7d49c7a28006ec5d4687bb55
Parent: 28e54032c092ed4a5592575ac716fe698ce75d22
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Oct 29 15:59:29 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Oct 29 16:00:32 2015 +0100
metadata: format_text: check metadata area size is at least MDA_SIZE_MIN
---
WHATS_NEW | 1 +
lib/format_text/format-text.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f453604..03c70d6 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Check metadata area size is at least minimum size of 8 * memory page size.
Thin pool targets uses low_water_mark from profile.
Dropping 'yet' from error of unsupported thick snapshot of snapshots.
Do not support unpartitioned DASD devices with CDL formatted with pvcreate.
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index e0ec8ed..6c653ca 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -2146,7 +2146,6 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
goto bad;
}
/* Otherwise, give up and take any usable space. */
- /* FIXME: We should probably check for some minimum MDA size here. */
else
mda_size = limit - mda_start;
@@ -2242,6 +2241,12 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
FMTu64 ").", pv_dev_name(pv),
mda_size, limit_name, limit);
+ if (mda_size < MDA_SIZE_MIN) {
+ log_error("Metadata area size too small. "
+ "It must be at least %u bytes.", MDA_SIZE_MIN);
+ goto bad;
+ }
+
if (mda_size) {
/* Wipe metadata area with zeroes. */
if (!dev_set((struct device *) pv->dev, mda_start,
8 years, 6 months
master - tests: update test for resize
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=28e54032c092ed...
Commit: 28e54032c092ed4a5592575ac716fe698ce75d22
Parent: bca55c9b205ff2b0613ad44d85c12c6d6ae9691b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 29 15:11:16 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 29 15:11:16 2015 +0100
tests: update test for resize
Drop already tested 'threshold & create' which is in
lvextend-thin-full.sh
Count with now match faster 'dmeventd' wakeup on watermark
as it's now nearly instant after crossing threshold value.
---
test/shell/lvextend-thin-metadata-dmeventd.sh | 28 +++++-------------------
1 files changed, 6 insertions(+), 22 deletions(-)
diff --git a/test/shell/lvextend-thin-metadata-dmeventd.sh b/test/shell/lvextend-thin-metadata-dmeventd.sh
index 030991f..a2d6a39 100644
--- a/test/shell/lvextend-thin-metadata-dmeventd.sh
+++ b/test/shell/lvextend-thin-metadata-dmeventd.sh
@@ -23,8 +23,8 @@ meta_percent_() {
wait_for_change_() {
# dmeventd only checks every 10 seconds :(
- for i in $(seq 1 15) ; do
- test "$(meta_percent_)" != "$1" && return
+ for i in $(seq 1 12) ; do
+ test "$(meta_percent_)" -lt "$1" && return
sleep 1
done
@@ -101,43 +101,27 @@ lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1
vgchange -ay $vg
-# Check dmeventd resizes metadata
+# Check dmeventd resizes metadata via timeout (nothing is written to pool)
pre=$(meta_percent_)
wait_for_change_ $pre
lvchange -an $vg
-lvs -a $vg
#
fake_metadata_ 350 2 >data
lvchange -ay $vg/$lv1
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
-lvs -a $vg
-dmsetup table
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1
lvchange -ay $vg/pool $vg/$lv1
lvs -a $vg
lvcreate -s -Ky -n $lv2 $vg/thin
-echo 2 >"$DM_DEV_DIR/mapper/$vg-$lv2"
-
-#lvchange -an $vg
-#lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1
-#lvchange -ay $vg/$lv1
-#thin_dump "$DM_DEV_DIR/mapper/$vg-$lv1"
-#exit
+pre=$(meta_percent_)
-# no more space for new thin LV
-#
-# TODO:
-# though maybe 'lvcreate' itself should initiate resize - if dmeventd is not 'fast' enough
-# deploying usage of threshold kernel module paramater would likely help as well
-# for now it stops here:
-not lvcreate -s -Ky -n $lv3 $vg/thin
-lvs -a $vg
+# go over thin metadata threshold
+echo 2 >"$DM_DEV_DIR/mapper/$vg-$lv2"
-pre=$(meta_percent_)
wait_for_change_ $pre
lvs -a $vg
8 years, 6 months
master - tests: replace invalid use of 'fail' with 'die'
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bca55c9b205ff2...
Commit: bca55c9b205ff2b0613ad44d85c12c6d6ae9691b
Parent: f104a81932e1011acb4798402f4f67f78f701a0b
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Thu Oct 29 13:30:29 2015 +0100
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Thu Oct 29 13:30:29 2015 +0100
tests: replace invalid use of 'fail' with 'die'
---
test/shell/lvconvert-mirror.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvconvert-mirror.sh b/test/shell/lvconvert-mirror.sh
index 029112c..5c7aad3 100644
--- a/test/shell/lvconvert-mirror.sh
+++ b/test/shell/lvconvert-mirror.sh
@@ -317,7 +317,7 @@ lvremove -ff $vg
# to get synced
lvcreate -l2 -n $lv1 $vg
lvconvert --type mirror -i1 -m1 $vg/$lv1 | tee out
-grep -e "$vg/$lv1: Converted:" out || fail "Missing sync info in foreground mode"
+grep -e "$vg/$lv1: Converted:" out || die "Missing sync info in foreground mode"
lvremove -ff $vg
vgremove -ff $vg
8 years, 6 months
master - tests: let pass bigger readahead
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f104a81932e101...
Commit: f104a81932e1011acb4798402f4f67f78f701a0b
Parent: 3720eb63bed5d087a13d184894197373ebbbaeba
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 29 12:33:15 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 29 12:39:07 2015 +0100
tests: let pass bigger readahead
If the underlaying device has actually bigger read-ahead settings,
let it pass.
But anyway switch to 512 strip-size to get really high R-A sector count.
---
test/shell/read-ahead.sh | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/test/shell/read-ahead.sh b/test/shell/read-ahead.sh
index 82a0707..94465cb 100644
--- a/test/shell/read-ahead.sh
+++ b/test/shell/read-ahead.sh
@@ -21,12 +21,11 @@ SKIP_WITH_LVMPOLLD=1
aux prepare_vg 5
#COMM "test various read ahead settings (bz450922)"
-lvcreate -l 100%FREE -i5 -I256 -n $lv $vg
+lvcreate -l 100%FREE -i5 -I512 -n $lv $vg
ra=$(get lv_field $vg/$lv lv_kernel_read_ahead --units s --nosuffix)
-test $(( ( $ra / 5 ) * 5 )) -eq $ra
+test $(( ( $ra / 5 ) * 5 )) -le $ra
not lvchange -r auto $vg/$lv 2>&1 | grep auto
check lv_field $vg/$lv lv_read_ahead auto
-check lv_field $vg/$lv lv_kernel_read_ahead 5120 --units s --nosuffix
lvchange -r 640 $vg/$lv
check lv_field $vg/$lv lv_read_ahead 640 --units s --nosuffix
lvremove -ff $vg
8 years, 6 months
master - tests: fix wrong line has been commented
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3720eb63bed5d0...
Commit: 3720eb63bed5d087a13d184894197373ebbbaeba
Parent: 8b5525383f2070a6df8508bfe5696324ca6acb54
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 29 12:30:00 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 29 12:39:07 2015 +0100
tests: fix wrong line has been commented
---
test/shell/snapshot-remove-dmsetup.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/shell/snapshot-remove-dmsetup.sh b/test/shell/snapshot-remove-dmsetup.sh
index 395fad1..6a4f9d2 100644
--- a/test/shell/snapshot-remove-dmsetup.sh
+++ b/test/shell/snapshot-remove-dmsetup.sh
@@ -36,12 +36,12 @@ mount -o errors=remount-ro "$DM_DEV_DIR/$vg1/snap" mnt
sync
-# intetionally suspend layer bellow
+# intentionally suspend layer bellow
dmsetup suspend $vg-$lv1
# now this should pass without blocking
-#dmsetup suspend --noflush --nolockfs $vg1-snap &
-dmsetup suspend $vg1-snap &
+dmsetup suspend --noflush --nolockfs $vg1-snap &
+#dmsetup suspend $vg1-snap &
sleep .5
8 years, 6 months
master - tests: no point in using should
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8b5525383f2070...
Commit: 8b5525383f2070a6df8508bfe5696324ca6acb54
Parent: f58c63410327c2bc49b671df4538dee9e90e577d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 29 12:23:38 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 29 12:39:07 2015 +0100
tests: no point in using should
lvmetad does not support lvm1 - so expect failure.
---
test/shell/lvmetad-lvm1.sh | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/test/shell/lvmetad-lvm1.sh b/test/shell/lvmetad-lvm1.sh
index 3b14fdd..c1b34ea 100644
--- a/test/shell/lvmetad-lvm1.sh
+++ b/test/shell/lvmetad-lvm1.sh
@@ -14,14 +14,19 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
+# lvmetad does not support lvm1 format
+
aux prepare_devs 2
pvcreate --metadatatype 1 "$dev1"
-should vgscan --cache
-pvs | should grep "$dev1"
+not vgscan --cache
+pvs | tee out
+not grep "$dev1" out
vgcreate --metadatatype 1 $vg1 "$dev1"
-should vgscan --cache
-vgs | should grep $vg1
-pvs | should grep "$dev1"
+not vgscan --cache
+vgs | tee out
+not grep $vg1 out
+pvs | tee out
+not grep "$dev1" out
# check for RHBZ 1080189 -- SEGV in lvremove/vgremove
pvcreate -ff -y --metadatatype 1 "$dev1" "$dev2"
8 years, 6 months
master - cleanup: error is not a WARNING
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f58c63410327c2...
Commit: f58c63410327c2bc49b671df4538dee9e90e577d
Parent: 175119fdcd1a8eb23011e4c25d0df5899dfc42ea
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 29 12:18:40 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 29 12:38:59 2015 +0100
cleanup: error is not a WARNING
Drop 'WARNING' from error message.
It's plain error message leading to command failure.
---
lib/cache/lvmetad.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index c7f6ecb..683c87c 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -1331,7 +1331,7 @@ int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev,
log_warn("WARNING: Ignoring obsolete format of metadata (%s) on device %s when using lvmetad",
baton.fid->fmt->name, dev_name(dev));
else
- log_error("WARNING: Ignoring obsolete format of metadata (%s) on device %s when using lvmetad",
+ log_error("Ignoring obsolete format of metadata (%s) on device %s when using lvmetad.",
baton.fid->fmt->name, dev_name(dev));
lvmcache_fmt(info)->ops->destroy_instance(baton.fid);
8 years, 6 months
master - cleanup: remove thin low_water_mark from metadata
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=175119fdcd1a8e...
Commit: 175119fdcd1a8eb23011e4c25d0df5899dfc42ea
Parent: 33a8a2febf483df088ec8e1928d25a6705a18991
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Oct 29 12:07:24 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Oct 29 12:14:20 2015 +0100
cleanup: remove thin low_water_mark from metadata
This option could never have been printed in lvm2 metadata, so it could
be safely removed as it could have been set only as 0.
These configurable setting is supported via metadata profile.
---
lib/metadata/lv_manip.c | 2 --
lib/metadata/metadata-exported.h | 1 -
lib/thin/thin.c | 7 -------
tools/lvconvert.c | 1 -
4 files changed, 0 insertions(+), 11 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 8e20dfa..2310bfa 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7388,8 +7388,6 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
first_seg(lv)->chunk_size = lp->chunk_size;
first_seg(lv)->zero_new_blocks = lp->zero ? 1 : 0;
first_seg(lv)->discards = lp->discards;
- /* FIXME: use lowwatermark via lvm.conf global for all thinpools ? */
- first_seg(lv)->low_water_mark = 0;
if (!recalculate_pool_chunk_size_with_dev_hints(lv, lp->passed_args,
lp->thin_chunk_size_calc_policy)) {
stack;
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 41838a8..2d118f4 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -454,7 +454,6 @@ struct lv_segment {
struct lv_segment_area *meta_areas; /* For RAID */
struct logical_volume *metadata_lv; /* For thin_pool */
uint64_t transaction_id; /* For thin_pool, thin */
- uint64_t low_water_mark; /* For thin_pool */
unsigned zero_new_blocks; /* For thin_pool */
thin_discards_t discards; /* For thin_pool */
struct dm_list thin_messages; /* For thin_pool */
diff --git a/lib/thin/thin.c b/lib/thin/thin.c
index ad400ef..be7a6b4 100644
--- a/lib/thin/thin.c
+++ b/lib/thin/thin.c
@@ -118,10 +118,6 @@ static int _thin_pool_text_import(struct lv_segment *seg,
else if (!set_pool_discards(&seg->discards, discards_str))
return SEG_LOG_ERROR("Discards option unsupported for");
- if (dm_config_has_node(sn, "low_water_mark") &&
- !dm_config_get_uint64(sn, "low_water_mark", &seg->low_water_mark))
- return SEG_LOG_ERROR("Could not read low_water_mark");
-
if ((seg->chunk_size < DM_THIN_MIN_DATA_BLOCK_SIZE) ||
(seg->chunk_size > DM_THIN_MAX_DATA_BLOCK_SIZE))
return SEG_LOG_ERROR("Unsupported value %u for chunk_size",
@@ -169,9 +165,6 @@ static int _thin_pool_text_export(const struct lv_segment *seg, struct formatter
return 0;
}
- if (seg->low_water_mark)
- outf(f, "low_water_mark = %" PRIu64, seg->low_water_mark);
-
if (seg->zero_new_blocks)
outf(f, "zero_new_blocks = 1");
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 0e06160..a7df26d 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3064,7 +3064,6 @@ static int _lvconvert_pool(struct cmd_context *cmd,
/* FIXME: revert renamed LVs in fail path? */
/* FIXME: any common code with metadata/thin_manip.c extend_pool() ? */
- seg->low_water_mark = 0;
seg->transaction_id = 0;
mda_write:
8 years, 6 months