master - cache: Disallow vgsplit when there are cache LVs in the VG
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b84797be3278e2...
Commit: b84797be3278e2ec232b8de7293dcac665d980f0
Parent: b359b86f88642888116d54d4204d367664fbdcf5
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Mon Feb 24 16:51:02 2014 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Mon Feb 24 16:54:09 2014 -0600
cache: Disallow vgsplit when there are cache LVs in the VG
The code seems to work fine for the most trivial case - moving a
simple cache LV. However, it can cause problems when trying to
split out other LVs on different VGs and there hasn't been sufficient
testing for LV stacks that contain cache to enable the code. So,
we actively disable what is already broken and wait for the next
release to fix it.
---
tools/vgsplit.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 79 insertions(+), 0 deletions(-)
diff --git a/tools/vgsplit.c b/tools/vgsplit.c
index dfcb120..150be1d 100644
--- a/tools/vgsplit.c
+++ b/tools/vgsplit.c
@@ -14,6 +14,7 @@
*/
#include "tools.h"
+#include "metadata.h" /* for 'get_only_segment_using_this_lv' */
/* FIXME Why not (lv->vg == vg) ? */
static int _lv_is_in_vg(struct volume_group *vg, struct logical_volume *lv)
@@ -72,6 +73,10 @@ static int _move_lvs(struct volume_group *vg_from, struct volume_group *vg_to)
lv_is_thin_volume(lv))
continue;
+ if (lv_is_cache(lv) || lv_is_cache_pool(lv))
+ /* further checks by _move_cache() */
+ continue;
+
/* Ensure all the PVs used by this LV remain in the same */
/* VG as each other */
vg_with = NULL;
@@ -268,6 +273,77 @@ static int _move_thins(struct volume_group *vg_from,
return 1;
}
+static int _move_cache(struct volume_group *vg_from,
+ struct volume_group *vg_to)
+{
+ int is_moving;
+ struct dm_list *lvh, *lvht;
+ struct logical_volume *lv, *data, *meta, *orig;
+ struct lv_segment *seg, *cache_seg;
+
+ dm_list_iterate_safe(lvh, lvht, &vg_from->lvs) {
+ lv = dm_list_item(lvh, struct lv_list)->lv;
+ data = meta = orig = NULL;
+ seg = first_seg(lv);
+
+ if (!lv_is_cache(lv) && !lv_is_cache_pool(lv))
+ continue;
+
+ /*
+ * FIXME: The code seems to move cache LVs fine, but it
+ * hasn't been well tested and it causes problems
+ * when just splitting PVs that don't contain
+ * cache LVs.
+ * Waiting for next release before fixing and enabling.
+ */
+ log_error("Unable to split VG while it contains cache LVs");
+ return 0;
+
+ if (lv_is_cache(lv)) {
+ orig = seg_lv(seg, 0);
+ data = seg_lv(first_seg(seg->pool_lv), 0);
+ meta = first_seg(seg->pool_lv)->metadata_lv;
+ /* Ensure all components are coming along */
+ is_moving = !!_lv_is_in_vg(vg_to, orig);
+ } else {
+ if (!dm_list_empty(&seg->lv->segs_using_this_lv) &&
+ !(cache_seg = get_only_segment_using_this_lv(seg->lv)))
+ return_0;
+ orig = seg_lv(cache_seg, 0);
+ data = seg_lv(seg, 0);
+ meta = seg->metadata_lv;
+
+ if (_lv_is_in_vg(vg_to, data) ||
+ _lv_is_in_vg(vg_to, meta))
+ is_moving = 1;
+ }
+
+ if (orig && (!!_lv_is_in_vg(vg_to, orig) != is_moving)) {
+ log_error("Can't split %s and its origin (%s)"
+ " into separate VGs", lv->name, orig->name);
+ return 0;
+ }
+
+ if (data && (!!_lv_is_in_vg(vg_to, data) != is_moving)) {
+ log_error("Can't split %s and its cache pool"
+ " data LV (%s) into separate VGs",
+ lv->name, data->name);
+ return 0;
+ }
+
+ if (meta && (!!_lv_is_in_vg(vg_to, meta) != is_moving)) {
+ log_error("Can't split %s and its cache pool"
+ " metadata LV (%s) into separate VGs",
+ lv->name, meta->name);
+ return 0;
+ }
+ if (!_move_one_lv(vg_from, vg_to, lvh))
+ return_0;
+ }
+
+ return 1;
+}
+
/*
* Create or open the destination of the vgsplit operation.
* Returns
@@ -481,6 +557,9 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
if (!(_move_thins(vg_from, vg_to)))
goto_bad;
+ if (!(_move_cache(vg_from, vg_to)))
+ goto_bad;
+
/* Split metadata areas and check if both vgs have at least one area */
if (!(vg_split_mdas(cmd, vg_from, vg_to)) && vg_from->pv_count) {
log_error("Cannot split: Nowhere to store metadata for new Volume Group");
10 years, 2 months
master - allocation: improve approx alloc with resize
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b359b86f886428...
Commit: b359b86f88642888116d54d4204d367664fbdcf5
Parent: 80831438220f0ee8b88d2c8c25fab131bf619f5b
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Feb 24 22:48:23 2014 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Feb 24 22:48:23 2014 +0000
allocation: improve approx alloc with resize
Start to convert percentage size handling in lvresize to the new
standard. Note in the man pages that this code is incomplete.
Fix a regression in non-percentage allocation in my last check in.
This is what I am aiming for:
-l<extents>
-l<percent> LV/ORIGIN
sets or changes the LV size based on the specified quantity
of logical logical extents (that might be backed by
a higher number of physical extents)
-l<percent> PVS/VG/FREE
sets or changes the LV size so as to allocate or free the
desired quantity of physical extents (that might amount to a
lower number of logical extents for the LV concerned)
-l+50%FREE - Use up half the remaining free space in the VG when
carrying out this operation.
-l50%VG - After this operation, this LV should be using up half the
space in the VG.
-l200%LV - Double the logical size of this LV.
-l+100%LV - Double the logical size of this LV.
-l-50%LV - Reduce the logical size of this LV by half.
---
lib/metadata/lv_manip.c | 33 ++++++++++++++++++++++-----------
lib/metadata/metadata-exported.h | 1 +
man/lvcreate.8.in | 7 +++++--
man/lvextend.8.in | 7 +++++++
man/lvreduce.8.in | 6 ++++++
man/lvresize.8.in | 7 +++++++
tools/lvcreate.c | 1 +
7 files changed, 49 insertions(+), 13 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 92e65ae..c4b644c 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -1197,9 +1197,11 @@ static struct alloc_handle *_alloc_init(struct cmd_context *cmd,
ah->log_len = !metadata_area_count ? 0 :
mirror_log_extents(ah->region_size, extent_size,
new_extents / ah->area_multiple);
- ah->new_extents = ah->new_extents * ah->area_multiple / ah->area_count;
- ah->new_extents = (ah->new_extents / ah->area_multiple) * ah->area_multiple;
- log_debug("Adjusted allocation request to %" PRIu32 " data extents.", ah->new_extents);
+ if (approx_alloc) {
+ ah->new_extents = ah->new_extents * ah->area_multiple / ah->area_count;
+ ah->new_extents = (ah->new_extents / ah->area_multiple) * ah->area_multiple;
+ log_debug("Adjusted allocation request to %" PRIu32 " data extents.", ah->new_extents);
+ }
}
for (s = 0; s < alloc_count; s++)
@@ -3813,7 +3815,7 @@ static int _lvresize_adjust_extents(struct cmd_context *cmd, struct logical_volu
{
struct volume_group *vg = lv->vg;
uint32_t pv_extent_count;
- uint32_t extents_used;
+ uint32_t extents_used, extents;
uint32_t seg_stripes = 0, seg_stripesize = 0, seg_size;
uint32_t seg_mirrors = 0;
struct lv_segment *seg, *uninitialized_var(mirr_seg);
@@ -3825,24 +3827,24 @@ static int _lvresize_adjust_extents(struct cmd_context *cmd, struct logical_volu
/* If percent options were used, convert them into actual numbers of extents */
switch (lp->percent) {
case PERCENT_VG:
- lp->extents = percent_of_extents(lp->extents, vg->extent_count,
+ extents = percent_of_extents(lp->extents, vg->extent_count,
(lp->sign != SIGN_MINUS));
break;
case PERCENT_FREE:
- lp->extents = percent_of_extents(lp->extents, vg->free_count,
+ extents = percent_of_extents(lp->extents, vg->free_count,
(lp->sign != SIGN_MINUS));
break;
case PERCENT_LV:
- lp->extents = percent_of_extents(lp->extents, lv->le_count,
+ extents = percent_of_extents(lp->extents, lv->le_count,
(lp->sign != SIGN_MINUS));
break;
case PERCENT_PVS:
if (lp->argc) {
pv_extent_count = pv_list_extents_free(pvh);
- lp->extents = percent_of_extents(lp->extents, pv_extent_count,
+ extents = percent_of_extents(lp->extents, pv_extent_count,
(lp->sign != SIGN_MINUS));
} else
- lp->extents = percent_of_extents(lp->extents, vg->extent_count,
+ extents = percent_of_extents(lp->extents, vg->extent_count,
(lp->sign != SIGN_MINUS));
break;
case PERCENT_ORIGIN:
@@ -3850,13 +3852,22 @@ static int _lvresize_adjust_extents(struct cmd_context *cmd, struct logical_volu
log_error("Specified LV does not have an origin LV.");
return 0;
}
- lp->extents = percent_of_extents(lp->extents, origin_from_cow(lv)->le_count,
+ extents = percent_of_extents(lp->extents, origin_from_cow(lv)->le_count,
(lp->sign != SIGN_MINUS));
break;
case PERCENT_NONE:
+ extents = lp->extents;
break;
}
+ if (lp->percent != PERCENT_NONE) {
+ log_verbose("Converted %" PRIu32 "%%%s into %" PRIu32 " extents.", lp->extents, get_percent_string(lp->percent), extents);
+ lp->extents = extents;
+ if (lp->sign == SIGN_NONE && (lp->percent != PERCENT_LV && lp->percent != PERCENT_ORIGIN))
+ lp->approx_alloc = 1;
+ /* FIXME Adjust for parallel areas here before processing relative allocations */
+ }
+
if (lp->sign == SIGN_PLUS) {
if (lp->extents >= (MAX_EXTENT_COUNT - lv->le_count)) {
log_error("Unable to extend %s by %u extents, exceeds limit (%u).",
@@ -4213,7 +4224,7 @@ static struct logical_volume *_lvresize_volume(struct cmd_context *cmd,
lp->stripes, lp->stripe_size,
lp->mirrors, first_seg(lv)->region_size,
lp->extents - lv->le_count, NULL,
- pvh, alloc, 0))
+ pvh, alloc, lp->approx_alloc))
return_NULL;
if (lock_lv) {
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 3e57113..87e6046 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -484,6 +484,7 @@ struct lvresize_params {
uint64_t poolmetadatasize;
sign_t poolmetadatasign;
uint32_t poolmetadataextents;
+ int approx_alloc;
percent_type_t percent;
enum {
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index 682ff3a..c449eb1 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -223,14 +223,17 @@ is specified.
.TP
.IR \fB\-l ", " \fB\-\-extents " " LogicalExtentsNumber [ % { VG | PVS | FREE | ORIGIN }]
Gives the number of logical extents to allocate for the new
-logical volume.
+logical volume. The total number of physical extents allocated will be
+greater than this, for example, if the volume is mirrored.
The number can also be expressed as a percentage of the total space
in the Volume Group with the suffix \fI%VG\fR, as a percentage of the
remaining free space in the Volume Group with the suffix \fI%FREE\fR, as a
percentage of the remaining free space for the specified
PhysicalVolume(s) with the suffix \fI%PVS\fR, or (for a snapshot) as a
percentage of the total space in the Origin Logical Volume with the
-suffix \fI%ORIGIN\fR.
+suffix \fI%ORIGIN\fR. When expressed as a percentage, the number is treated
+as an approximate upper limit for the total number of physical extents
+to be allocated (including extents used by any mirrors, for example).
.TP
.IR \fB\-L ", " \fB\-\-size " " LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]
Gives the size to allocate for the new logical volume.
diff --git a/man/lvextend.8.in b/man/lvextend.8.in
index c51a9dc..d9bc0c8 100644
--- a/man/lvextend.8.in
+++ b/man/lvextend.8.in
@@ -45,6 +45,8 @@ Proceed with size extension without prompting.
Extend or set the logical volume size in units of logical extents.
With the '\fI+\fP' sign the value is added to the actual size
of the logical volume and without it, the value is taken as an absolute one.
+The total number of physical extents allocated will be
+greater than this, for example, if the volume is mirrored.
The number can also be expressed as a percentage of the total space
in the Volume Group with the suffix \fI%VG\fP, relative to the existing
size of the Logical Volume with the suffix \fI%LV\fP, of the remaining
@@ -53,6 +55,11 @@ as a percentage of the remaining free space in the Volume Group
with the suffix \fI%FREE\fP, or (for a snapshot) as a percentage of the total
space in the Origin Logical Volume with the suffix \fI%ORIGIN\fP.
The resulting value is rounded upward.
+N.B. In a future release, when expressed as a percentage with PVS, VG or FREE,
+the number will be treated as an approximate upper limit for the total number
+of physical extents to be allocated (including extents used by any mirrors, for
+example). The code may currently allocate more space than you might otherwise
+expect.
.TP
.IR \fB\-L ", " \fB\-\-size " [" + ] LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]
Extend or set the logical volume size in units of megabytes.
diff --git a/man/lvreduce.8.in b/man/lvreduce.8.in
index 2c38f5b..2b0f3f8 100644
--- a/man/lvreduce.8.in
+++ b/man/lvreduce.8.in
@@ -51,6 +51,8 @@ Reduce or set the logical volume size in units of logical extents.
With the \fI-\fP sign the value will be subtracted from
the logical volume's actual size and without it the value will be taken
as an absolute size.
+The total number of physical extents freed will be greater than this logical
+value if, for example, the volume is mirrored.
The number can also be expressed as a percentage of the total space
in the Volume Group with the suffix \fI%VG\fP, relative to the existing
size of the Logical Volume with the suffix \fI%LV\fP, as a percentage of the
@@ -59,6 +61,10 @@ a snapshot) as a percentage of the total space in the Origin Logical
Volume with the suffix \fI%ORIGIN\fP.
The resulting value for the subtraction is rounded downward, for the absolute
size it is rounded upward.
+N.B. In a future release, when expressed as a percentage with VG or FREE, the
+number will be treated as an approximate total number of physical extents to be
+freed (including extents used by any mirrors, for example). The code may
+currently release more space than you might otherwise expect.
.TP
.IR \fB\-L ", " \fB\-\-size " [" \- ] LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]
Reduce or set the logical volume size in units of megabytes.
diff --git a/man/lvresize.8.in b/man/lvresize.8.in
index 3606762..14fc7ba 100644
--- a/man/lvresize.8.in
+++ b/man/lvresize.8.in
@@ -49,6 +49,8 @@ Resize underlying filesystem together with the logical volume using
Change or set the logical volume size in units of logical extents.
With the \fI+\fP or \fI-\fP sign the value is added to or subtracted from the actual size
of the logical volume and without it, the value is taken as an absolute one.
+The total number of physical extents affected will be
+greater than this if, for example, the volume is mirrored.
The number can also be expressed as a percentage of the total space
in the Volume Group with the suffix \fI%VG\fP, relative to the existing
size of the Logical Volume with the suffix \fI%LV\fP, as a percentage of
@@ -58,6 +60,11 @@ Volume Group with the suffix \fI%FREE\fP, or (for a snapshot) as a percentage
of the total space in the Origin Logical Volume with the suffix \fI%ORIGIN\fP.
The resulting value is rounded downward for the subtraction otherwise
it is rounded upward.
+N.B. In a future release, when expressed as a percentage with PVS, VG or FREE,
+the number will be treated as an approximate total number of physical extents
+to be allocated or freed (including extents used by any mirrors, for example).
+The code may currently allocate or remove more space than you might otherwise
+expect.
.TP
.IR \fB\-L ", " \fB\-\-size " [" + | - ] LogicalVolumeSize [ bBsSkKmMgGtTpPeE ]
Change or set the logical volume size in units of megabytes.
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 19df387..7d9d22e 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -400,6 +400,7 @@ static int _update_extents_params(struct volume_group *vg,
}
if (lcp->percent) {
+ /* FIXME Don't do the adjustment for parallel allocation with PERCENT_ORIGIN! */
lp->approx_alloc = 1;
log_verbose("Converted %" PRIu32 "%%%s into %" PRIu32 " extents.", lp->extents, get_percent_string(lcp->percent), extents);
lp->extents = extents;
10 years, 2 months
master - tests: add extra wait
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=80831438220f0e...
Commit: 80831438220f0ee8b88d2c8c25fab131bf619f5b
Parent: dc839fb3610a344d6c392a09995e44e6dbfac545
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Feb 24 10:56:02 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 24 21:13:36 2014 +0100
tests: add extra wait
Parallel upconvert & downconvert is now tested separately
in lvconvert-mirror-updown.sh
---
test/shell/lvconvert-mirror.sh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-mirror.sh b/test/shell/lvconvert-mirror.sh
index 911e022..097e0d4 100644
--- a/test/shell/lvconvert-mirror.sh
+++ b/test/shell/lvconvert-mirror.sh
@@ -176,6 +176,10 @@ lvremove -ff $vg
# "remove from original mirror (the original is still mirror)"
lvcreate -aey -l2 --type mirror -m2 -n $lv1 $vg "$dev1" "$dev2" "$dev5" "$dev3:$DEVRANGE"
lvconvert -m+1 -b $vg/$lv1 "$dev4"
+# FIXME: Extra wait here for mirror upconvert synchronization
+# otherwise we may fail her on parallel upconvert and downconvert
+# lvconvert-mirror-updown.sh tests this errornous case separately
+lvconvert $vg/$lv1
lvconvert -m-1 $vg/$lv1 "$dev2"
lvconvert $vg/$lv1
10 years, 2 months
master - tests: check for python before other tests
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dc839fb3610a34...
Commit: dc839fb3610a344d6c392a09995e44e6dbfac545
Parent: 32138969f9f8bd4e33e2b9131ac67db061d75f70
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Feb 24 10:51:10 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 24 21:13:36 2014 +0100
tests: check for python before other tests
---
test/api/pytest.sh | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/test/api/pytest.sh b/test/api/pytest.sh
index a0f9a2f..8359c01 100644
--- a/test/api/pytest.sh
+++ b/test/api/pytest.sh
@@ -20,19 +20,20 @@
# Until fixed - testing always runs with enabled monitoring
# thus it needs dmeventd
#
-aux prepare_dmeventd
-test ! -e LOCAL_CLVMD || skip
-test ! -e LOCAL_LVMETAD || skip
-
-#If you change this change the unit test case too.
-aux prepare_pvs 6
#Locate the python binding library to use.
python_lib=$(find $abs_top_builddir -name lvm.so)
-
# Unable to test python bindings if library not available
test -n "$python_lib" || skip
+test -e LOCAL_CLVMD && skip
+test -e LOCAL_LVMETAD && skip
+
+aux prepare_dmeventd
+
+#If you change this change the unit test case too.
+aux prepare_pvs 6
+
export PYTHONPATH=$(dirname $python_lib):$PYTHONPATH
#Setup which devices the unit test can use.
10 years, 2 months
master - tests: enhance thin test
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=32138969f9f8bd...
Commit: 32138969f9f8bd4e33e2b9131ac67db061d75f70
Parent: 9c9f4515ae433beb2e6a582aacc422feb73c09dd
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Feb 24 09:46:09 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 24 21:13:36 2014 +0100
tests: enhance thin test
Add more tests to also check validaty of transaction_id
and also detect we are not leaving active unusable thin pool LVs.
---
test/shell/lvextend-thin-metadata-dmeventd.sh | 29 +++++++++++++++++++++---
1 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/test/shell/lvextend-thin-metadata-dmeventd.sh b/test/shell/lvextend-thin-metadata-dmeventd.sh
index 4b4ee30..cb5261c 100644
--- a/test/shell/lvextend-thin-metadata-dmeventd.sh
+++ b/test/shell/lvextend-thin-metadata-dmeventd.sh
@@ -32,7 +32,7 @@ wait_for_change_() {
# Currently it expects 2MB thin metadata and 200MB data volume size
# Argument specifies how many devices should be created.
fake_metadata_() {
- echo '<superblock uuid="" time="1" transaction="0" data_block_size="128" nr_data_blocks="3200">'
+ echo '<superblock uuid="" time="1" transaction="'$2'" data_block_size="128" nr_data_blocks="3200">'
for i in $(seq 1 $1)
do
echo ' <device dev_id="'$i'" mapped_blocks="785" transaction="0" creation_time="0" snap_time="1">'
@@ -56,12 +56,31 @@ vgcreate -s 1M $vg $(cat DEVICES)
# Testing dmeventd autoresize
lvcreate -L200M -V1G -n thin -T $vg/pool
lvcreate -L2M -n $lv1 $vg
+lvchange -an $vg/thin $vg/pool
-# Prepare some fake metadata prefilled to ~81% (>70%)
-fake_metadata_ 400 >data
+# Prepare some fake metadata with unmatching id
+# Transaction_id is lower by 1 and there are no message -> ERROR
+fake_metadata_ 10 0 >data
+thin_restore -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
+lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
+not vgchange -ay $vg 2>&1 | tee out
+grep expected out
+check inactive $vg pool_tmeta
+
+# Transaction_id is higher by 1
+fake_metadata_ 10 2 >data
thin_restore -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
-vgchange -an $vg
+lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
+not vgchange -ay $vg 2>&1 | tee out
+grep expected out
+
+check inactive $vg pool_tmeta
+
+# Prepare some fake metadata prefilled to ~81% (>70%)
+fake_metadata_ 400 1 >data
+thin_restore -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
+
# Swap volume with restored fake metadata
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
@@ -70,3 +89,5 @@ vgchange -ay $vg
# Check dmeventd resizes metadata
pre=$(meta_percent_)
wait_for_change_ $pre
+
+vgremove -f $vg
10 years, 2 months
master - tests: add some quotes
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9c9f4515ae433b...
Commit: 9c9f4515ae433beb2e6a582aacc422feb73c09dd
Parent: f8780e2d79596fcb3197e922247597d77336257e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 22 23:08:55 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 24 21:13:36 2014 +0100
tests: add some quotes
Use quotes for DM_DEV_DIR
---
test/shell/lvconvert-repair-dmeventd.sh | 2 +-
test/shell/lvconvert-repair-thin.sh | 26 ++++++++++----------
test/shell/lvconvert-repair-transient-dmeventd.sh | 2 +-
test/shell/lvconvert-repair-transient.sh | 2 +-
test/shell/lvconvert-thin-external.sh | 8 +++---
test/shell/lvcreate-large-raid.sh | 4 +-
test/shell/lvcreate-large-raid10.sh | 4 +-
test/shell/lvcreate-large.sh | 4 +-
test/shell/lvcreate-pvtags.sh | 2 +-
test/shell/lvcreate-thin-external.sh | 8 +++---
test/shell/lvcreate-thin-snap.sh | 8 +++---
test/shell/lvcreate-thin.sh | 4 +-
test/shell/name-mangling.sh | 4 +-
test/shell/read-ahead.sh | 2 +-
test/shell/snapshot-usage.sh | 12 +++++-----
test/shell/thin-merge.sh | 16 ++++++------
test/shell/vgsplit-stacked.sh | 4 +-
17 files changed, 56 insertions(+), 56 deletions(-)
diff --git a/test/shell/lvconvert-repair-dmeventd.sh b/test/shell/lvconvert-repair-dmeventd.sh
index 1604ecb..a2d3ef8 100644
--- a/test/shell/lvconvert-repair-dmeventd.sh
+++ b/test/shell/lvconvert-repair-dmeventd.sh
@@ -20,7 +20,7 @@ aux prepare_vg 5
lvcreate -aey --type mirror -m 3 --ignoremonitoring -L 1 -n 4way $vg
lvchange --monitor y $vg/4way
aux disable_dev "$dev2" "$dev4"
-mkfs.ext2 $DM_DEV_DIR/$vg/4way
+mkfs.ext2 "$DM_DEV_DIR/$vg/4way"
sleep 10 # FIXME: need a "poll" utility, akin to "check"
aux enable_dev "$dev2" "$dev4"
check mirror $vg 4way
diff --git a/test/shell/lvconvert-repair-thin.sh b/test/shell/lvconvert-repair-thin.sh
index aa301d6..b80b855 100644
--- a/test/shell/lvconvert-repair-thin.sh
+++ b/test/shell/lvconvert-repair-thin.sh
@@ -10,7 +10,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-# Test repairing of broken thin pool metadata
+# Test repairing of broken thin pool metadata
. lib/test
@@ -34,8 +34,8 @@ aux prepare_vg 4
lvcreate -T -L20 -V10 -n $lv1 $vg/pool "$dev1" "$dev2"
lvcreate -T -V10 -n $lv2 $vg/pool
-mkfs.ext2 $DM_DEV_DIR/$vg/$lv1
-mkfs.ext2 $DM_DEV_DIR/$vg/$lv2
+mkfs.ext2 "$DM_DEV_DIR/$vg/$lv1"
+mkfs.ext2 "$DM_DEV_DIR/$vg/$lv2"
lvcreate -L20 -n repair $vg
lvcreate -L2 -n fixed $vg
@@ -55,26 +55,26 @@ lvconvert -y -f --poolmetadata $vg/repair --thinpool $vg/pool
lvchange -aey $vg/repair $vg/fixed
-#dd if=$DM_DEV_DIR/$vg/repair of=back bs=1M
+#dd if="$DM_DEV_DIR/$vg/repair" of=back bs=1M
# Make some 'repairable' damage??
-dd if=/dev/zero of=$DM_DEV_DIR/$vg/repair bs=1 seek=40960 count=1
+dd if=/dev/zero of="$DM_DEV_DIR/$vg/repair" bs=1 seek=40960 count=1
-#dd if=$DM_DEV_DIR/$vg/repair of=back_trashed bs=1M
+#dd if="$DM_DEV_DIR/$vg/repair" of=back_trashed bs=1M
#not vgchange -ay $vg
#lvconvert --repair $vg/pool
# Using now SHOULD - since thin tools currently do not seem to work
-should not $THIN_CHECK $DM_DEV_DIR/$vg/repair
+should not "$THIN_CHECK" "$DM_DEV_DIR/$vg/repair"
-should not $LVM_TEST_THIN_DUMP_CMD $DM_DEV_DIR/$vg/repair | tee dump
+should not "$LVM_TEST_THIN_DUMP_CMD" "$DM_DEV_DIR/$vg/repair" | tee dump
-should $LVM_TEST_THIN_REPAIR_CMD -i $DM_DEV_DIR/$vg/repair -o $DM_DEV_DIR/$vg/fixed
+should "$LVM_TEST_THIN_REPAIR_CMD" -i "$DM_DEV_DIR/$vg/repair" -o "$DM_DEV_DIR/$vg/fixed"
-should $LVM_TEST_THIN_DUMP_CMD --repair $DM_DEV_DIR/$vg/repair | tee repaired_xml
+should "$LVM_TEST_THIN_DUMP_CMD" --repair "$DM_DEV_DIR/$vg/repair" | tee repaired_xml
-should $LVM_TEST_THIN_CHECK_CMD $DM_DEV_DIR/$vg/fixed
+should "$LVM_TEST_THIN_CHECK_CMD" "$DM_DEV_DIR/$vg/fixed"
# Swap repaired metadata back
lvconvert -y -f --poolmetadata $vg/fixed --thinpool $vg/pool
@@ -83,7 +83,7 @@ lvs -a $vg
# Activate pool - this should now work
should vgchange -ay $vg
-lvs -a -o+devices $vg
+lvs -a -o+devices $vg
dmsetup table
dmsetup info -c
dmsetup ls --tree
@@ -99,7 +99,7 @@ dmsetup remove $vg-pool_tmeta || true
dmsetup table
-# FIXME: needs also --yes with double force
+# FIXME: needs also --yes with double force
pvremove --yes -ff "$dev1"
pvremove --yes -ff "$dev2"
diff --git a/test/shell/lvconvert-repair-transient-dmeventd.sh b/test/shell/lvconvert-repair-transient-dmeventd.sh
index 699195a..6bd1442 100644
--- a/test/shell/lvconvert-repair-transient-dmeventd.sh
+++ b/test/shell/lvconvert-repair-transient-dmeventd.sh
@@ -18,7 +18,7 @@ aux prepare_dmeventd
lvcreate -aey --type mirror -m 3 --ignoremonitoring -L 1 -n 4way $vg
lvchange --monitor y $vg/4way
aux disable_dev "$dev2" "$dev4"
-mkfs.ext3 $DM_DEV_DIR/$vg/4way
+mkfs.ext3 "$DM_DEV_DIR/$vg/4way"
aux enable_dev "$dev2" "$dev4"
sleep 3
lvs -a -o +devices $vg | tee out
diff --git a/test/shell/lvconvert-repair-transient.sh b/test/shell/lvconvert-repair-transient.sh
index 28b06c6..3baa293 100644
--- a/test/shell/lvconvert-repair-transient.sh
+++ b/test/shell/lvconvert-repair-transient.sh
@@ -16,7 +16,7 @@ aux prepare_vg 5
lvcreate -aey --type mirror -m 3 --ignoremonitoring -L 1 -n 4way $vg
aux disable_dev "$dev2" "$dev4"
-mkfs.ext3 $DM_DEV_DIR/$vg/4way &
+mkfs.ext3 "$DM_DEV_DIR/$vg/4way" &
sleep 1
aux enable_dev "$dev2" "$dev4"
echo n | lvconvert --repair $vg/4way 2>&1 | tee 4way.out
diff --git a/test/shell/lvconvert-thin-external.sh b/test/shell/lvconvert-thin-external.sh
index dbe5972..00712bd 100644
--- a/test/shell/lvconvert-thin-external.sh
+++ b/test/shell/lvconvert-thin-external.sh
@@ -64,9 +64,9 @@ lvcreate -L8M -n $lv1 $vg
not lvconvert --thinpool $vg/$lv1 -T $vg/$lv1
check lv_field $vg/$lv1 segtype linear
-mkfs.ext2 $DM_DEV_DIR/$vg/$lv1
+mkfs.ext2 "$DM_DEV_DIR/$vg/$lv1"
mkdir mnt
-mount $DM_DEV_DIR/$vg/$lv1 mnt
+mount "$DM_DEV_DIR/$vg/$lv1" mnt
dd if=/dev/zero of=mnt/test1 bs=1M count=1
@@ -84,7 +84,7 @@ touch mnt/test
umount mnt
# check fs is without errors
-fsck -n $DM_DEV_DIR/$vg/$lv1
+fsck -n "$DM_DEV_DIR/$vg/$lv1"
lvchange -aey $vg/extorg
lvchange -an $vg/$lv1
@@ -93,7 +93,7 @@ check active $vg extorg
check inactive $vg $lv1
# fsck in read-only mode
-fsck -n $DM_DEV_DIR/$vg/extorg
+fsck -n "$DM_DEV_DIR/$vg/extorg"
not lvresize -l+8 $vg/extorg
not lvresize -l-4 $vg/extorg
diff --git a/test/shell/lvcreate-large-raid.sh b/test/shell/lvcreate-large-raid.sh
index 395cf2b..e5d883c 100644
--- a/test/shell/lvcreate-large-raid.sh
+++ b/test/shell/lvcreate-large-raid.sh
@@ -31,8 +31,8 @@ lvcreate -s -l 20%FREE -n $lv5 $vg --virtualsize 256T
aux extend_filter_LVMTEST
-pvcreate $DM_DEV_DIR/$vg/$lv[12345]
-vgcreate $vg1 $DM_DEV_DIR/$vg/$lv[12345]
+pvcreate "$DM_DEV_DIR"/$vg/$lv[12345]
+vgcreate $vg1 "$DM_DEV_DIR"/$vg/$lv[12345]
# bz837927 START
diff --git a/test/shell/lvcreate-large-raid10.sh b/test/shell/lvcreate-large-raid10.sh
index 4f97997..3d02e81 100644
--- a/test/shell/lvcreate-large-raid10.sh
+++ b/test/shell/lvcreate-large-raid10.sh
@@ -28,8 +28,8 @@ lvcreate -s -l 20%FREE -n $lv5 $vg --virtualsize 256T
aux extend_filter_LVMTEST
-pvcreate $DM_DEV_DIR/$vg/$lv[12345]
-vgcreate $vg1 $DM_DEV_DIR/$vg/$lv[12345]
+pvcreate "$DM_DEV_DIR"/$vg/$lv[12345]
+vgcreate $vg1 "$DM_DEV_DIR"/$vg/$lv[12345]
#
# Create large RAID LVs
diff --git a/test/shell/lvcreate-large.sh b/test/shell/lvcreate-large.sh
index c8790f1..f3d3f30 100644
--- a/test/shell/lvcreate-large.sh
+++ b/test/shell/lvcreate-large.sh
@@ -25,8 +25,8 @@ lvcreate -s -l 100%FREE -n $lv $vg --virtualsize 1024T
aux extend_filter_LVMTEST
-pvcreate $DM_DEV_DIR/$vg/$lv
-vgcreate $vg1 $DM_DEV_DIR/$vg/$lv
+pvcreate "$DM_DEV_DIR/$vg/$lv"
+vgcreate $vg1 "$DM_DEV_DIR/$vg/$lv"
lvcreate -l 100%FREE -n $lv1 $vg1
check lv_field $vg1/$lv1 size "1024.00t"
diff --git a/test/shell/lvcreate-pvtags.sh b/test/shell/lvcreate-pvtags.sh
index 20a241c..340a4f4 100644
--- a/test/shell/lvcreate-pvtags.sh
+++ b/test/shell/lvcreate-pvtags.sh
@@ -28,7 +28,7 @@ lvcreate -l3 -i3 $vg @fast
not lvcreate -l4 -i4 $vg @fast
# 2 stripes is too many with just one PV
-not lvcreate -l2 -i2 $vg $DM_DEV_DIR/mapper/pv1
+not lvcreate -l2 -i2 $vg "$DM_DEV_DIR/mapper/pv1"
# lvcreate mirror
lvcreate -aey -l1 --type mirror -m1 $vg @fast
diff --git a/test/shell/lvcreate-thin-external.sh b/test/shell/lvcreate-thin-external.sh
index 14c7f82..1e5b333 100644
--- a/test/shell/lvcreate-thin-external.sh
+++ b/test/shell/lvcreate-thin-external.sh
@@ -37,10 +37,10 @@ lvremove -f $vg
# Prepare pool and external origin with filesystem
lvcreate -L10M -V10M -T $vg/pool --name $lv1
-mkfs.ext2 $DM_DEV_DIR/$vg/$lv1
+mkfs.ext2 "$DM_DEV_DIR/$vg/$lv1"
lvcreate -L4M -n $lv2 $vg
-mkfs.ext2 $DM_DEV_DIR/$vg/$lv2
+mkfs.ext2 "$DM_DEV_DIR/$vg/$lv2"
# Fail to create external origin snapshot of rw LV
not lvcreate -s $vg/$lv2 --thinpool $vg/pool
@@ -90,7 +90,7 @@ check active $vg $lv5
check active $vg $lv6
check active $vg $lv7
-fsck -n $DM_DEV_DIR/$vg/$lv1
-fsck -n $DM_DEV_DIR/$vg/$lv7
+fsck -n "$DM_DEV_DIR/$vg/$lv1"
+fsck -n "$DM_DEV_DIR/$vg/$lv7"
vgremove -ff $vg
diff --git a/test/shell/lvcreate-thin-snap.sh b/test/shell/lvcreate-thin-snap.sh
index b7511e7..cfc801a 100644
--- a/test/shell/lvcreate-thin-snap.sh
+++ b/test/shell/lvcreate-thin-snap.sh
@@ -33,11 +33,11 @@ aux prepare_pvs 2 64
vgcreate $vg -s 64K $(cat DEVICES)
lvcreate -L10M -V10M -T $vg/pool --name $lv1
-mkfs.ext4 $DM_DEV_DIR/$vg/$lv1
+mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
# create thin snapshot of thin LV
lvcreate -K -s $vg/$lv1 --name snap
# check snapshot filesystem was properly frozen before snapping
-fsck -n $DM_DEV_DIR/$vg/snap
+fsck -n "$DM_DEV_DIR/$vg/snap"
lvcreate -K -s $vg/$lv1 --name $lv2
lvcreate -K -s $vg/$lv1 --name $vg/$lv3
lvcreate --type snapshot $vg/$lv1
@@ -57,8 +57,8 @@ lvcreate -K -s --name sn4 $vg/sn3
lvremove -ff $vg
lvcreate -L10M --zero n -T $vg/pool -V10M --name $lv1
-mkfs.ext4 $DM_DEV_DIR/$vg/$lv1
+mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
lvcreate -K -s $vg/$lv1 --name snap
-fsck -n $DM_DEV_DIR/$vg/snap
+fsck -n "$DM_DEV_DIR/$vg/snap"
vgremove -ff $vg
diff --git a/test/shell/lvcreate-thin.sh b/test/shell/lvcreate-thin.sh
index 98ab7eb..a2811d2 100644
--- a/test/shell/lvcreate-thin.sh
+++ b/test/shell/lvcreate-thin.sh
@@ -136,9 +136,9 @@ check vg_field $vg lv_count 0
# Create thin snapshot of thinLV
lvcreate -L10M -V10M -T $vg/pool --name lv1
-mkfs.ext4 $DM_DEV_DIR/$vg/lv1
+mkfs.ext4 "$DM_DEV_DIR/$vg/lv1"
lvcreate -K -s $vg/lv1 --name snap_lv1
-fsck -n $DM_DEV_DIR/$vg/snap_lv1
+fsck -n "$DM_DEV_DIR/$vg/snap_lv1"
lvcreate -s $vg/lv1 --name lv2
lvcreate -s $vg/lv1 --name $vg/lv3
lvcreate --type snapshot $vg/lv1 --name lv6
diff --git a/test/shell/name-mangling.sh b/test/shell/name-mangling.sh
index 5b92e60..76d90fa 100644
--- a/test/shell/name-mangling.sh
+++ b/test/shell/name-mangling.sh
@@ -164,8 +164,8 @@ function check_mangle_cmd()
# check dmsetup can process path where the last component is not equal dm name (rhbz #797322)
r=0
create_dm_dev auto "abc"
-ln -s ${DM_DEV_DIR}/mapper/${name_prefix}abc ${DM_DEV_DIR}/${name_prefix}xyz
-dmsetup status ${DM_DEV_DIR}/${name_prefix}xyz || r=1
+ln -s "$DM_DEV_DIR/mapper/${name_prefix}abc" "$DM_DEV_DIR/${name_prefix}xyz"
+dmsetup status "$DM_DEV_DIR/${name_prefix}xyz" || r=1
remove_dm_dev auto "abc"
if [ r = 1 ]; then
exit 1
diff --git a/test/shell/read-ahead.sh b/test/shell/read-ahead.sh
index 8c8f42c..264910c 100644
--- a/test/shell/read-ahead.sh
+++ b/test/shell/read-ahead.sh
@@ -34,7 +34,7 @@ lvremove -ff $vg
blockdev --setra 768 "$dev1"
vgscan
lvcreate -n $lv -L4m $vg "$dev1"
-test $(blockdev --getra $DM_DEV_DIR/$vg/$lv) -eq 768
+test $(blockdev --getra "$DM_DEV_DIR/$vg/$lv") -eq 768
lvremove -ff $vg
# Check default, active/inactive values for read_ahead / kernel_read_ahead
diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh
index 14a87c0..fb88ae1 100644
--- a/test/shell/snapshot-usage.sh
+++ b/test/shell/snapshot-usage.sh
@@ -14,7 +14,7 @@
. lib/test
fill() {
- dd if=/dev/zero of=$DM_DEV_DIR/$vg1/lvol0 bs=$1 count=1
+ dd if=/dev/zero of="$DM_DEV_DIR/$vg1/lvol0" bs=$1 count=1
}
cleanup_tail()
@@ -37,8 +37,8 @@ aux lvmconf "activation/snapshot_autoextend_percent = 20" \
"activation/snapshot_autoextend_threshold = 50"
# Check usability with smallest extent size
-pvcreate --setphysicalvolumesize 4T $DM_DEV_DIR/$vg/$lv
-vgcreate -s 1K $vg1 $DM_DEV_DIR/$vg/$lv
+pvcreate --setphysicalvolumesize 4T "$DM_DEV_DIR/$vg/$lv"
+vgcreate -s 1K $vg1 "$DM_DEV_DIR/$vg/$lv"
# Test removal of opened snapshot
lvcreate -V50 -L10 -n $lv1 -s $vg1
@@ -52,7 +52,7 @@ lvs -a -o+lv_active $vg1
trap 'cleanup_tail' EXIT
# Keep device busy (but not mounted) for a while
-sleep 30 < $DM_DEV_DIR/$vg1/$lv1 &
+sleep 30 < "$DM_DEV_DIR/$vg1/$lv1" &
SLEEP_PID=$!
# give some short time to lock file above
@@ -116,8 +116,8 @@ vgremove -ff $vg1
if test "$TSIZE" -eq 15P ; then
# Check usability with largest extent size
-pvcreate $DM_DEV_DIR/$vg/$lv
-vgcreate -s 4G $vg1 $DM_DEV_DIR/$vg/$lv
+pvcreate "$DM_DEV_DIR/$vg/$lv"
+vgcreate -s 4G $vg1 "$DM_DEV_DIR/$vg/$lv"
lvcreate -an -Zn -l50%FREE -n $lv1 $vg1
lvcreate -s -l100%FREE -n $lv2 $vg1/$lv1
diff --git a/test/shell/thin-merge.sh b/test/shell/thin-merge.sh
index 0bb5ee7..7eb137e 100644
--- a/test/shell/thin-merge.sh
+++ b/test/shell/thin-merge.sh
@@ -28,14 +28,14 @@ lvcreate -T -L8M $vg/pool -V10M -n $lv1
lvchange --addtag tagL $vg/$lv1
mkdir mnt
-$MKFS $DM_DEV_DIR/$vg/$lv1
-mount $DM_DEV_DIR/$vg/$lv1 mnt
+$MKFS "$DM_DEV_DIR/$vg/$lv1"
+mount "$DM_DEV_DIR/$vg/$lv1" mnt
touch mnt/test
lvcreate -K -s -n snap --addtag tagS $vg/$lv1
mkdir mntsnap
-$MKFS $DM_DEV_DIR/$vg/snap
-mount $DM_DEV_DIR/$vg/snap mntsnap
+$MKFS "$DM_DEV_DIR/$vg/snap"
+mount "$DM_DEV_DIR/$vg/snap" mntsnap
touch mntsnap/test_snap
lvs -o+tags,thin_id $vg
@@ -85,8 +85,8 @@ check lv_field $vg/$lv1 thin_id "2"
check lv_field $vg/$lv1 tags "tagL"
check lv_not_exists $vg snap
-fsck -n $DM_DEV_DIR/$vg/$lv1
-mount $DM_DEV_DIR/$vg/$lv1 mnt
+fsck -n "$DM_DEV_DIR/$vg/$lv1"
+mount "$DM_DEV_DIR/$vg/$lv1" mnt
test -e mnt/test_snap
umount mnt
@@ -98,9 +98,9 @@ lvcreate -s -n snap $vg/$lv1
# Also add old snapshot to thin origin
lvcreate -s -L10 -n oldsnapof_${lv1} $vg/$lv1
not lvconvert --merge $vg/snap
-$MKFS $DM_DEV_DIR/$vg/oldsnapof_${lv1}
+$MKFS "$DM_DEV_DIR/$vg/oldsnapof_${lv1}"
lvconvert --merge $vg/oldsnapof_${lv1}
-fsck -n $DM_DEV_DIR/$vg/$lv1
+fsck -n "$DM_DEV_DIR/$vg/$lv1"
check lv_not_exists $vg oldsnapof_${lv1}
# Add old snapshot to thin snapshot
lvcreate -s -L10 -n oldsnapof_snap $vg/snap
diff --git a/test/shell/vgsplit-stacked.sh b/test/shell/vgsplit-stacked.sh
index 3256191..c8b89b5 100644
--- a/test/shell/vgsplit-stacked.sh
+++ b/test/shell/vgsplit-stacked.sh
@@ -18,8 +18,8 @@ vgcreate $vg1 "$dev1" "$dev2"
lvcreate -n $lv1 -l 100%FREE $vg1
#top VG
-pvcreate $DM_DEV_DIR/$vg1/$lv1
-vgcreate $vg $DM_DEV_DIR/$vg1/$lv1 "$dev3"
+pvcreate "$DM_DEV_DIR/$vg1/$lv1"
+vgcreate $vg "$DM_DEV_DIR/$vg1/$lv1" "$dev3"
vgchange -a n $vg $vg1
10 years, 2 months
master - tests: drop mirror from filter
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f8780e2d79596f...
Commit: f8780e2d79596fcb3197e922247597d77336257e
Parent: a920bc1a40f3d8d76d0109ecfc6559965b458986
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 22 00:24:46 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 24 21:13:36 2014 +0100
tests: drop mirror from filter
---
test/lib/aux.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 7587c4b..66ed910 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -538,7 +538,7 @@ generate_config() {
devices/dir = "$DM_DEV_DIR"
devices/scan = "$DM_DEV_DIR"
devices/filter = "a|.*|"
-devices/global_filter = [ "a|$DM_DEV_DIR/mirror|", "a|$DM_DEV_DIR/mapper/.*pv[0-9_]*$|", "r|.*|" ]
+devices/global_filter = [ "a|$DM_DEV_DIR/mapper/.*pv[0-9_]*$|", "r|.*|" ]
devices/cache_dir = "$TESTDIR/etc"
devices/sysfs_scan = 0
devices/default_data_alignment = 1
10 years, 2 months
master - cleanup: indent, drop unneeded braces
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a920bc1a40f3d8...
Commit: a920bc1a40f3d8d76d0109ecfc6559965b458986
Parent: 408e276a615faf22e829cea385738dce02edae26
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 22 23:13:43 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 24 21:13:35 2014 +0100
cleanup: indent, drop unneeded braces
---
libdm/libdm-deptree.c | 6 ++++--
tools/lvconvert.c | 1 +
tools/toollib.c | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index fad14d6..e513885 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -1626,7 +1626,9 @@ static int _dm_tree_deactivate_children(struct dm_tree_node *dnode,
info.minor);
r = 0;
continue;
- } else if (info.suspended && info.live_table)
+ }
+
+ if (info.suspended && info.live_table)
dec_suspended();
if (child->callback &&
@@ -2705,7 +2707,7 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
child->info.minor);
/* If the device was not previously active, we might as well remove this node. */
if (!child->info.live_table &&
- !_deactivate_node(child->name, child->info.major,child->info.minor,
+ !_deactivate_node(child->name, child->info.major, child->info.minor,
&child->dtree->cookie, child->udev_flags, 0))
log_error("Unable to deactivate %s (%" PRIu32
":%" PRIu32 ")", child->name, child->info.major,
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 814ac65..09a64c7 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3134,6 +3134,7 @@ static int _poll_logical_volume(struct cmd_context *cmd, struct logical_volume *
log_print_unless_silent("Conversion starts after activation.");
return ECMD_PROCESSED;
}
+
return lvconvert_poll(cmd, lv, wait_completion ? 0 : 1U);
}
diff --git a/tools/toollib.c b/tools/toollib.c
index 31033e6..91b0559 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -681,7 +681,7 @@ int process_each_vg(struct cmd_context *cmd, int argc, char **argv,
if (sigint_caught())
return_ECMD_FAILED;
vgid = sl->str;
- if (!(vgid) || !(vg_name = lvmcache_vgname_from_vgid(cmd->mem, vgid)))
+ if (!vgid || !(vg_name = lvmcache_vgname_from_vgid(cmd->mem, vgid)))
continue;
ret_max = _process_one_vg(cmd, vg_name, vgid, &tagsl,
&arg_vgnames,
10 years, 2 months
master - cleanup: extend struct init usage
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=408e276a615faf...
Commit: 408e276a615faf22e829cea385738dce02edae26
Parent: 0118d6aa48c5d69b7b5f264f6f93ddb51a4379ad
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 22 20:28:30 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 24 21:13:35 2014 +0100
cleanup: extend struct init usage
---
daemons/lvmetad/lvmetad-core.c | 17 +++++------------
1 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index eefbf1d..ab0573f 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -1189,7 +1189,7 @@ static int fini(daemon_state *s)
return 1;
}
-static void usage(char *prog, FILE *file)
+static void usage(const char *prog, FILE *file)
{
fprintf(file, "Usage:\n"
"%s [-V] [-h] [-f] [-l {all|wire|debug}] [-s path]\n\n"
@@ -1204,27 +1204,19 @@ static void usage(char *prog, FILE *file)
int main(int argc, char *argv[])
{
signed char opt;
- lvmetad_state ls;
+ lvmetad_state ls = { .log_config = "" };
daemon_state s = {
.daemon_fini = fini,
.daemon_init = init,
.handler = handler,
.name = "lvmetad",
- .pidfile = getenv("LVM_LVMETAD_PIDFILE"),
+ .pidfile = getenv("LVM_LVMETAD_PIDFILE") ? : LVMETAD_PIDFILE,
.private = &ls,
.protocol = "lvmetad",
.protocol_version = 1,
- .socket_path = getenv("LVM_LVMETAD_SOCKET"),
+ .socket_path = getenv("LVM_LVMETAD_SOCKET") ? : LVMETAD_SOCKET,
};
- if (!s.pidfile)
- s.pidfile = LVMETAD_PIDFILE;
-
- if (!s.socket_path)
- s.socket_path = LVMETAD_SOCKET;
-
- ls.log_config = "";
-
// use getopt_long
while ((opt = getopt(argc, argv, "?fhVl:p:s:")) != EOF) {
switch (opt) {
@@ -1253,5 +1245,6 @@ int main(int argc, char *argv[])
}
daemon_start(s);
+
return 0;
}
10 years, 2 months
master - cleanup: spelling
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0118d6aa48c5d6...
Commit: 0118d6aa48c5d69b7b5f264f6f93ddb51a4379ad
Parent: 710c0df68a74c8da03eba62b43ae9080dd4a6ffe
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 22 00:23:59 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 24 21:13:35 2014 +0100
cleanup: spelling
---
lib/cache/lvmcache.c | 4 ++--
tools/lvcreate.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index ec8699b..d40bdce 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -264,9 +264,9 @@ static void _drop_metadata(const char *vgname, int drop_precommitted)
}
/*
- * Remote node uses this to upgrade precommited metadata to commited state
+ * Remote node uses this to upgrade precommitted metadata to commited state
* when receives vg_commit notification.
- * (Note that devices can be suspended here, if so, precommited metadata are already read.)
+ * (Note that devices can be suspended here, if so, precommitted metadata are already read.)
*/
void lvmcache_commit_metadata(const char *vgname)
{
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 6da0d61..19df387 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -683,7 +683,7 @@ static int _read_raid_params(struct lvcreate_params *lp,
if (lp->max_recovery_rate &&
(lp->max_recovery_rate < lp->min_recovery_rate)) {
- log_error("Minumum recovery rate cannot be higher than maximum.");
+ log_error("Minimum recovery rate cannot be higher than maximum.");
return 0;
}
return 1;
10 years, 2 months