master - tests: temporarily trace prepare_vg
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d24b6cfb1ff1f2...
Commit: d24b6cfb1ff1f29eec49c3113f8cef9904cf4a8b
Parent: f08154cc7b2051b68b4eda1a6be0de61fc77d637
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 26 15:05:24 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 26 15:11:15 2015 +0100
tests: temporarily trace prepare_vg
---
test/shell/lvresize-rounding.sh | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvresize-rounding.sh b/test/shell/lvresize-rounding.sh
index d06dcf1..24ca00b 100644
--- a/test/shell/lvresize-rounding.sh
+++ b/test/shell/lvresize-rounding.sh
@@ -11,9 +11,10 @@
. lib/inittest
+# 15 extents
aux prepare_pvs 3 22
-vgcreate -s 32K $vg "$dev1" "$dev2" "$dev3"
+vgcreate -s 32K $vg $(cat DEVICES)
lvcreate -an -Zn -l4 -i3 -I64 $vg
@@ -31,7 +32,9 @@ lvresize -l+64 -i3 -I128 $vg/$lv1
vgremove -f $vg
# 15 extents
+LVM_TEST_AUX_TRACE=yes
aux prepare_vg 3 22
+unset LVM_TEST_AUX_TRACE
# Block some extents
lvcreate -an -Zn -l4 -i3 $vg
9 years, 1 month
master - tests: update aux
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f08154cc7b2051...
Commit: f08154cc7b2051b68b4eda1a6be0de61fc77d637
Parent: b7ebab765761098058c436a3543ecbff00ad171a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 26 15:01:54 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 26 15:10:31 2015 +0100
tests: update aux
When we use /dev/loopX device - shift first PV1 sector by 1M
so /dev/loop0 and dm device do not appear as same device.
Also notify lvmetad once 'devs' are created - so in case this
command is called in the middle of test - lvmetad properly
drops its metadata for these devices.
Drop used test.img file between reuse so the 'prepare_vg'
always starts with zeroed disks.
When LVM_TEST_AUX_TRACE is set, allow shell tracing of aux commands.
---
test/lib/aux.sh | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 69c1473..cdd9a2d 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -284,7 +284,8 @@ prepare_loop() {
echo -n .
local LOOPFILE="$PWD/test.img"
- dd if=/dev/zero of="$LOOPFILE" bs=$((1024*1024)) count=0 seek=$(($size)) 2> /dev/null
+ rm -f "$LOOPFILE"
+ dd if=/dev/zero of="$LOOPFILE" bs=$((1024*1024)) count=0 seek=$(($size + 1)) 2> /dev/null
if LOOP=$(losetup -s -f "$LOOPFILE" 2>/dev/null); then
:
elif LOOP=$(losetup -f) && losetup "$LOOP" "$LOOPFILE"; then
@@ -367,8 +368,11 @@ prepare_devs() {
local n=${1:-3}
local devsize=${2:-34}
local pvname=${3:-pv}
+ local shift=0
prepare_backing_dev $(($n*$devsize))
+ # shift start of PV devices on /dev/loopXX by 1M
+ not diff LOOP BACKING_DEV >/dev/null 2>&1 || shift=2048
echo -n "## preparing $n devices..."
local size=$(($devsize*2048)) # sectors
@@ -379,7 +383,7 @@ prepare_devs() {
local dev="$DM_DEV_DIR/mapper/$name"
DEVICES[$count]=$dev
count=$(( $count + 1 ))
- echo 0 $size linear "$BACKING_DEV" $((($i-1)*$size)) > "$name.table"
+ echo 0 $size linear "$BACKING_DEV" $((($i-1)*$size + $shift)) > "$name.table"
if not dmsetup create -u "TEST-$name" "$name" "$name.table" &&
test -n "$LVM_TEST_BACKING_DEVICE";
then # maybe the backing device is too small for this test
@@ -408,6 +412,10 @@ prepare_devs() {
printf "%s\n" "${DEVICES[@]}" > DEVICES
# ( IFS=$'\n'; echo "${DEVICES[*]}" ) >DEVICES
echo "ok"
+
+ for dev in "${DEVICES[@]}"; do
+ notify_lvmetad "$dev"
+ done
}
# Replace linear PV device with its 'delayed' version
@@ -894,6 +902,8 @@ dmsetup_wrapped() {
dmsetup "$@"
}
+test -z "$LVM_TEST_AUX_TRACE" || set -x
+
test -f DEVICES && devs=$(< DEVICES)
if test "$1" = dmsetup; then
9 years, 1 month
master - tests: avoid multiple pids
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b7ebab76576109...
Commit: b7ebab765761098058c436a3543ecbff00ad171a
Parent: 0bffd99daa6510f80c918a23187b638260e9e634
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 26 14:12:34 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 26 15:10:04 2015 +0100
tests: avoid multiple pids
On some systems (parisc) pgrep prints more then 1 pid
(all thread IDs are printed)
So print only leading pid and avoid 'kill' being confused.
---
test/shell/dmeventd-restart.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/dmeventd-restart.sh b/test/shell/dmeventd-restart.sh
index 4344e82..022b8a8 100644
--- a/test/shell/dmeventd-restart.sh
+++ b/test/shell/dmeventd-restart.sh
@@ -48,7 +48,7 @@ if test -n "$abs_top_builddir"; then
fi
lvchange --monitor y --verbose $vg/3way 2>&1 | tee lvchange.out
-pgrep dmeventd >LOCAL_DMEVENTD
+pgrep -o dmeventd >LOCAL_DMEVENTD
not grep 'already monitored' lvchange.out
vgremove -ff $vg
9 years, 1 month
master - tests: move thin-related test from select-tools.sh to select-tools-thin.sh
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0bffd99daa6510...
Commit: 0bffd99daa6510f80c918a23187b638260e9e634
Parent: 9dbe2d760f3810463ffa416e82f89766b12b0071
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Mar 24 10:12:04 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 24 10:12:27 2015 +0100
tests: move thin-related test from select-tools.sh to select-tools-thin.sh
And skip this test if thin target is not available.
---
test/shell/select-tools-thin.sh | 35 +++++++++++++++++++++++++++++++++++
test/shell/select-tools.sh | 15 ---------------
2 files changed, 35 insertions(+), 15 deletions(-)
diff --git a/test/shell/select-tools-thin.sh b/test/shell/select-tools-thin.sh
new file mode 100644
index 0000000..d70289f
--- /dev/null
+++ b/test/shell/select-tools-thin.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Copyright (C) 2015 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
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/inittest
+
+aux have_thin 1 0 0 || skip
+
+aux prepare_pvs 1 16
+
+#########################
+# special cases to test #
+#########################
+
+# if calling lvremove and an LV is removed that is related to other LV
+# and we're doing selection based on this relation, check if we're
+# selecting on initial state (here, thin origin LV thin_orig is removed
+# first, but thin snap should be still selectable based on origin=thin_orig
+# condition even though thin_orig has just been removed)
+vgcreate -s 4m $vg1 $dev1
+lvcreate -l100%FREE -T $vg1/pool
+lvcreate -V4m -T $vg1/pool -n thin_orig
+lvcreate -s $vg1/thin_orig -n thin_snap
+lvremove -ff -S 'lv_name=thin_orig || origin=thin_orig' > out
+grep "Logical volume \"thin_orig\" successfully removed" out
+grep "Logical volume \"thin_snap\" successfully removed" out
+not lvs $vg1/thin_orig
+not lvs $vg1/thin_snap
diff --git a/test/shell/select-tools.sh b/test/shell/select-tools.sh
index 975ebdb..d04ed0a 100644
--- a/test/shell/select-tools.sh
+++ b/test/shell/select-tools.sh
@@ -273,18 +273,3 @@ pvchange -a --deltag 309 --deltag tag
# iterates over LVs with process_each_lv_in_vg - so internally it actually
# operates per-LV, but we still need the selection to be done per-VG)
vgremove --yes -S 'lv_name=lv2' # should remove whole vg1, not just the lv2
-
-# if calling lvremove and an LV is removed that is related to other LV
-# and we're doing selection based on this relation, check if we're
-# selecting on initial state (here, thin origin LV thin_orig is removed
-# first, but thin snap should be still selectable based on origin=thin_orig
-# condition even though thin_orig has just been removed)
-vgcreate -s 4m $vg1 $dev1 $dev2
-lvcreate -l100%FREE -T $vg1/pool
-lvcreate -V4m -T $vg1/pool -n thin_orig
-lvcreate -s $vg1/thin_orig -n thin_snap
-lvremove -ff -S 'lv_name=thin_orig || origin=thin_orig' > out
-grep "Logical volume \"thin_orig\" successfully removed" out
-grep "Logical volume \"thin_snap\" successfully removed" out
-not lvs $vg1/thin_orig
-not lvs $vg1/thin_snap
9 years, 1 month
master - tests: select-tools.sh: add test for fix in commit c9f021de0b4d2c873ef5b97d17c602d0380359fd
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9dbe2d760f3810...
Commit: 9dbe2d760f3810463ffa416e82f89766b12b0071
Parent: 8759f7d755cec7286d1bccda3a323b12481d5738
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Mar 24 09:50:35 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 24 09:50:35 2015 +0100
tests: select-tools.sh: add test for fix in commit c9f021de0b4d2c873ef5b97d17c602d0380359fd
---
test/shell/select-tools.sh | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/test/shell/select-tools.sh b/test/shell/select-tools.sh
index d04ed0a..975ebdb 100644
--- a/test/shell/select-tools.sh
+++ b/test/shell/select-tools.sh
@@ -273,3 +273,18 @@ pvchange -a --deltag 309 --deltag tag
# iterates over LVs with process_each_lv_in_vg - so internally it actually
# operates per-LV, but we still need the selection to be done per-VG)
vgremove --yes -S 'lv_name=lv2' # should remove whole vg1, not just the lv2
+
+# if calling lvremove and an LV is removed that is related to other LV
+# and we're doing selection based on this relation, check if we're
+# selecting on initial state (here, thin origin LV thin_orig is removed
+# first, but thin snap should be still selectable based on origin=thin_orig
+# condition even though thin_orig has just been removed)
+vgcreate -s 4m $vg1 $dev1 $dev2
+lvcreate -l100%FREE -T $vg1/pool
+lvcreate -V4m -T $vg1/pool -n thin_orig
+lvcreate -s $vg1/thin_orig -n thin_snap
+lvremove -ff -S 'lv_name=thin_orig || origin=thin_orig' > out
+grep "Logical volume \"thin_orig\" successfully removed" out
+grep "Logical volume \"thin_snap\" successfully removed" out
+not lvs $vg1/thin_orig
+not lvs $vg1/thin_snap
9 years, 1 month
master - metadata: vg: add removed_lvs field to collect LVs which have been removed
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8759f7d755cec7...
Commit: 8759f7d755cec7286d1bccda3a323b12481d5738
Parent: c9f021de0b4d2c873ef5b97d17c602d0380359fd
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Mar 23 13:32:00 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 24 08:43:08 2015 +0100
metadata: vg: add removed_lvs field to collect LVs which have been removed
Do not keep dangling LVs if they're removed from the vg->lvs list and
move them to vg->removed_lvs instead (this is actually similar to already
existing vg->removed_pvs list, just it's for LVs now).
Once we have this vg->removed_lvs list indexed so it's possible to
do lookups for LVs quickly, we can remove the LV_REMOVED flag as
that one won't be needed anymore - instead of checking the flag,
we can directly check the vg->removed_lvs list if the LV is present
there or not and to say if the LV is removed or not then. For now,
we don't have this index, but it may be implemented in the future.
---
lib/metadata/lv_manip.c | 2 +-
lib/metadata/metadata-exported.h | 2 ++
lib/metadata/metadata.c | 14 ++++++++++++++
lib/metadata/vg.c | 1 +
lib/metadata/vg.h | 5 +++++
tools/toollib.c | 5 +++++
6 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index b9cd056..99fb91f 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -5350,7 +5350,7 @@ int unlink_lv_from_vg(struct logical_volume *lv)
if (!(lvl = find_lv_in_vg(lv->vg, lv->name)))
return_0;
- dm_list_del(&lvl->list);
+ dm_list_move(&lv->vg->removed_lvs, &lvl->list);
lv->status |= LV_REMOVED;
return 1;
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 75cd94f..47fb9ae 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -125,6 +125,8 @@
be referenced on internal lists of LVs.
Any remaining references should check for
this flag and ignore the LV is set.
+ FIXME: Remove this flag once we have indexed
+ vg->removed_lvs for quick lookup.
*/
#define LV_ERROR_WHEN_FULL UINT64_C(0x0008000000000000) /* LV - error when full */
#define PV_ALLOCATION_PROHIBITED UINT64_C(0x0010000000000000) /* PV - internal use only - allocation prohibited
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 33ce370..a1a31eb 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -2568,12 +2568,26 @@ int vg_validate(struct volume_group *vg)
r = 0;
}
+ dm_list_iterate_items(lvl, &vg->removed_lvs) {
+ if (!(lvl->lv->status & LV_REMOVED)) {
+ log_error(INTERNAL_ERROR "LV %s is not marked as removed while it's part "
+ "of removed LV list for VG %s", lvl->lv->name, vg->name);
+ r = 0;
+ }
+ }
+
/*
* Count all non-snapshot invisible LVs
*/
dm_list_iterate_items(lvl, &vg->lvs) {
lv_count++;
+ if (lvl->lv->status & LV_REMOVED) {
+ log_error(INTERNAL_ERROR "LV %s is marked as removed while it's "
+ "still part of the VG %s", lvl->lv->name, vg->name);
+ r = 0;
+ }
+
if (lvl->lv->status & LVM_WRITE_LOCKED) {
log_error(INTERNAL_ERROR "LV %s has external flag LVM_WRITE_LOCKED set internally.",
lvl->lv->name);
diff --git a/lib/metadata/vg.c b/lib/metadata/vg.c
index 404cc6f..c9a7e9e 100644
--- a/lib/metadata/vg.c
+++ b/lib/metadata/vg.c
@@ -63,6 +63,7 @@ struct volume_group *alloc_vg(const char *pool_name, struct cmd_context *cmd,
dm_list_init(&vg->pvs_to_create);
dm_list_init(&vg->lvs);
dm_list_init(&vg->tags);
+ dm_list_init(&vg->removed_lvs);
dm_list_init(&vg->removed_pvs);
log_debug_mem("Allocated VG %s at %p.", vg->name, vg);
diff --git a/lib/metadata/vg.h b/lib/metadata/vg.h
index 67a04a0..b0ab122 100644
--- a/lib/metadata/vg.h
+++ b/lib/metadata/vg.h
@@ -113,6 +113,11 @@ struct volume_group {
*/
/*
+ * List of removed logical volumes by _lv_reduce.
+ */
+ struct dm_list removed_lvs;
+
+ /*
* List of removed physical volumes by pvreduce.
* They have to get cleared on vg_commit.
*/
diff --git a/tools/toollib.c b/tools/toollib.c
index be89450..142ff33 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -2061,6 +2061,11 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
}
dm_list_iterate_items(lvl, &final_lvs) {
+ /*
+ * FIXME: Once we have index over vg->removed_lvs, check directly
+ * LV presence there and remove LV_REMOVE flag/lv_is_removed fn
+ * as they won't be needed anymore.
+ */
if (lv_is_removed(lvl->lv))
continue;
9 years, 1 month
master - metadata: process_each_lv_in_vg: get the list of LVs to process first, then do the processing
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c9f021de0b4d2c...
Commit: c9f021de0b4d2c873ef5b97d17c602d0380359fd
Parent: 83587f0555d753bf0754d17bb6d4630111968e12
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Mar 16 17:10:21 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 24 08:43:07 2015 +0100
metadata: process_each_lv_in_vg: get the list of LVs to process first, then do the processing
This avoids a problem in which we're using selection on LV list - we
need to do the selection on initial state and not on any intermediary
state as we process LVs one by one - some of the relations among LVs
can be gone during this processing.
For example, processing one LV can cause the other LVs to lose the
relation to this LV and hence they're not selectable anymore with
the original selection criteria as it would be if we did selection
on inital state. A perfect example is with thin snapshots:
$ lvs -o lv_name,origin,layout,role vg
LV Origin Layout Role
lvol1 thin,sparse public,origin,thinorigin,multithinorigin
lvol2 lvol1 thin,sparse public,snapshot,thinsnapshot
lvol3 lvol1 thin,sparse public,snapshot,thinsnapshot
pool thin,pool private
$ lvremove -ff -S 'lv_name=lvol1 || origin=lvol1'
Logical volume "lvol1" successfully removed
The lvremove command above was supposed to remove lvol1 as well as
all its snapshots which have origin=lvol1. It failed to do so, because
once we removed the origin lvol1, the lvol2 and lvol3 which were
snapshots before are not snapshots anymore - the relations change
as we're processing these LVs one by one.
If we do the selection first and then execute any concrete actions on
these LVs (which is what this patch does), the behaviour is correct
then - the selection is done on the *initial state*:
$ lvremove -ff -S 'lv_name=lvol1 || origin=lvol1'
Logical volume "lvol1" successfully removed
Logical volume "lvol2" successfully removed
Logical volume "lvol3" successfully removed
Similarly for all the other situations in which relations among
LVs are being changed by processing the LVs one by one.
This patch also introduces LV_REMOVED internal LV status flag
to mark removed LVs so they're not processed further when we
iterate over collected list of LVs to be processed.
Previously, when we iterated directly over vg->lvs list to
process the LVs, we relied on the fact that once the LV is removed,
it is also removed from the vg->lvs list we're iterating over.
But that was incorrect as we shouldn't remove LVs from the list
during one iteration while we're iterating over that exact list
(dm_list_iterate_items safe can handle only one removal at
one iteration anyway, so it can't be used here).
---
WHATS_NEW | 1 +
lib/format_text/flags.c | 1 +
lib/metadata/lv_manip.c | 2 ++
lib/metadata/metadata-exported.h | 11 ++++++++++-
tools/toollib.c | 23 +++++++++++++++++++----
5 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 91c324e..4010e67 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.119 -
==================================
+ Fix LV processing with selection to always do the selection on initial state.
Version 2.02.118 - 23rd March 2015
==================================
diff --git a/lib/format_text/flags.c b/lib/format_text/flags.c
index a975606..bbd47c3 100644
--- a/lib/format_text/flags.c
+++ b/lib/format_text/flags.c
@@ -92,6 +92,7 @@ static const struct flag _lv_flags[] = {
{CACHE_POOL_DATA, NULL, 0},
{CACHE_POOL_METADATA, NULL, 0},
{LV_PENDING_DELETE, NULL, 0}, /* FIXME Display like COMPATIBLE_FLAG */
+ {LV_REMOVED, NULL, 0},
{0, NULL, 0}
};
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index c9c1145..b9cd056 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -5338,6 +5338,7 @@ int link_lv_to_vg(struct volume_group *vg, struct logical_volume *lv)
lvl->lv = lv;
lv->vg = vg;
dm_list_add(&vg->lvs, &lvl->list);
+ lv->status &= ~LV_REMOVED;
return 1;
}
@@ -5350,6 +5351,7 @@ int unlink_lv_from_vg(struct logical_volume *lv)
return_0;
dm_list_del(&lvl->list);
+ lv->status |= LV_REMOVED;
return 1;
}
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 1555c87..75cd94f 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -119,11 +119,18 @@
#define CACHE UINT64_C(0x0001000000000000) /* LV - Internal use only */
#define LV_PENDING_DELETE UINT64_C(0x0004000000000000) /* LV - Internal use only */
+#define LV_REMOVED UINT64_C(0x0040000000000000) /* LV - Internal use only
+ This flag is used to mark an LV once it has
+ been removed from the VG. It might still
+ be referenced on internal lists of LVs.
+ Any remaining references should check for
+ this flag and ignore the LV is set.
+ */
#define LV_ERROR_WHEN_FULL UINT64_C(0x0008000000000000) /* LV - error when full */
#define PV_ALLOCATION_PROHIBITED UINT64_C(0x0010000000000000) /* PV - internal use only - allocation prohibited
e.g. to prohibit allocation of a RAID image
on a PV already holing an image of the RAID set */
-/* Next unused flag: UINT64_C(0x0040000000000000) */
+/* Next unused flag: UINT64_C(0x0080000000000000) */
/* Format features flags */
#define FMT_SEGMENTS 0x00000001U /* Arbitrary segment params? */
@@ -222,6 +229,8 @@
#define lv_is_rlog(lv) (((lv)->status & REPLICATOR_LOG) ? 1 : 0)
+#define lv_is_removed(lv) (((lv)->status & LV_REMOVED) ? 1 : 0)
+
int lv_layout_and_role(struct dm_pool *mem, const struct logical_volume *lv,
struct dm_list **layout, struct dm_list **role);
diff --git a/tools/toollib.c b/tools/toollib.c
index 4bd2339..be89450 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1957,6 +1957,10 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
unsigned lvargs_supplied = 0;
struct lv_list *lvl;
struct dm_str_list *sl;
+ struct dm_list final_lvs;
+ struct lv_list *final_lvl;
+
+ dm_list_init(&final_lvs);
if (!vg_check_status(vg, EXPORTED_VG)) {
ret_max = ECMD_FAILED;
@@ -1986,10 +1990,6 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
(tags_supplied && str_list_match_list(tags_in, &vg->tags, NULL)))
process_all = 1;
- /*
- * FIXME: In case of remove it goes through deleted entries,
- * but it works since entries are allocated from vg mem pool.
- */
dm_list_iterate_items(lvl, &vg->lvs) {
if (sigint_caught()) {
ret_max = ECMD_FAILED;
@@ -2049,6 +2049,21 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
if (!process_lv)
continue;
+ log_very_verbose("Adding %s/%s to the list of LVs to be processed.", vg->name, lvl->lv->name);
+
+ if (!(final_lvl = dm_pool_zalloc(vg->vgmem, sizeof(struct lv_list)))) {
+ log_error("Failed to allocate final LV list item.");
+ ret_max = ECMD_FAILED;
+ goto_out;
+ }
+ final_lvl->lv = lvl->lv;
+ dm_list_add(&final_lvs, &final_lvl->list);
+ }
+
+ dm_list_iterate_items(lvl, &final_lvs) {
+ if (lv_is_removed(lvl->lv))
+ continue;
+
log_very_verbose("Processing LV %s in VG %s.", lvl->lv->name, vg->name);
ret = process_single_lv(cmd, lvl->lv, handle);
9 years, 1 month
v2_02_118 annotated tag has been created
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=efa5f89e803799...
Commit: efa5f89e8037998219144c1ae9f7781e37afdc43
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2015-03-24 02:00 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2015-03-24 02:00 +0000
annotated tag: v2_02_118 has been created
at efa5f89e8037998219144c1ae9f7781e37afdc43 (tag)
tagging 8bb1dfdd323cb70160f37a2d3a4cba48d5243be7 (commit)
replaces v2_02_117
Release 2.02.118
83 files changed, 1153 insertions(+), 512 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlUQxTgACgkQIoGRwVZ+LBdgnACfTyP9aPeKczujHV6eDtFoh0zW
mGwAoKDbV78P5G6HfKhKqjFUVvk3yCTr
=LYtr
-----END PGP SIGNATURE-----
Alasdair G Kergon (15):
post-release
comments: Use full flag names.
metadata: Detect internal use of LVM_WRITE_LOCKED.
vgconvert: Check system ID compatibility.
vgchange: Additional system ID warnings.
systemid: Use temp status var for LVM_WRITE_LOCKED
format_text: Set system id directly.
metadata: Fix recent vg_validate message text.
cache: Retain orphans while global lock held.
systemid: Use correct mempool.
pvs: Hide inaccessible clustered PVs.
toollib: Reorder process_each_pv initialisation.
cache: Store metadata size and checksum.
format_text: Fix precommitted segfault.
pre-release
David Teigland (12):
system_id: enable the options in config file and command line
Revert "systemid: Add ACCESS_NEEDS_SYSTEM_ID VG flag."
system_id: make new VGs read-only for old lvm versions
system_id: undo the previous changes to the lvm1 code
system_id: avoid munging vg and lv fields
man: add info to lvmsystemid
tests: fix systemid uname test
system_id: detect an lvm1 system id
vgconvert: require lvmetad to not be used
WHATS_NEW vgconvert -M fix
tests: update to not run vgconvert -M with lvmetad
reporting: should not fail with foreign option if lvm1 pvs exist
Ondrej Kozina (2):
libdaemon: map error level properly
tests: add omitted --atomic mode in pvmove-restart
Peter Rajnoha (4):
report: fix seg_monitor field to display monitoring status for thick snapshots and mirrors
systemd: blk-availability.service: add After=iscsi-shutdown.service
lvmetad: pvscan: do not scan and read ignored MDAs from PVs
pvmove: use safe version of iteration when iterating over vg->lvs list in _poll_vg
Zdenek Kabelac (38):
devices: avoid extra open() syscall
lib: zero returned labeller struct
lib: return value
cleanup: add stack trace
lib: avoid reparsing same metadata
lib: reduce parsing in vgname_from_mda
lib: drop unneeded vg_read call
tests: slightly more efficient vgcreate
tests: speed of many PVS in a VG
display: fix return values
configure: check for sync-nand
tests: extend test timeout to 180sec
tests: enable kmsg by default
tests: cleanup some cxx warnings
tests: specify old mirror type
tests: drop old workaround
tests: extend race
makefiles: split gcc -W options
tests: do not leak in mem in destructor
tests: capture and print thrown errors
tests: drop unneeded comment
tests: update makefile
tests: update runner
tests: avoid loop on older system
tests: few more warnings for gcc only
tests: drop unused ""
tests: check for dmeventd first
tests: fix select report
tests: add ""
lvchange: disable persistent minors for pools
configure: detect st_ctim
lvm-file: wrapper to read ctim from stat
config: use timestamp with nanosecond precision
pvscan: check sysfs dev entry before rescan
makefiles: add more dirs for lcov
tests: export shell vars
tests: start clvmd without lib/
tests: revert should removal in mirror test
9 years, 1 month
master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=83587f0555d753...
Commit: 83587f0555d753bf0754d17bb6d4630111968e12
Parent: 8bb1dfdd323cb70160f37a2d3a4cba48d5243be7
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Mar 24 02:02:07 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Mar 24 02:02:07 2015 +0000
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 3 +++
WHATS_NEW_DM | 3 +++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index ef6bee0..3325ba1 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.118(2)-git (2015-03-24)
+2.02.119(2)-git (2015-03-24)
diff --git a/VERSION_DM b/VERSION_DM
index ca20a0d..9a34d79 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.95-git (2015-03-24)
+1.02.96-git (2015-03-24)
diff --git a/WHATS_NEW b/WHATS_NEW
index 558bdb5..91c324e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.119 -
+==================================
+
Version 2.02.118 - 23rd March 2015
==================================
Store metadata size + checksum in lvmcache and add struct lvmcache_vgsummary.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 08975b6..8e23306 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.96 -
+=================================
+
Version 1.02.95 - 15th March 2015
=================================
Makefile regenerated.
9 years, 1 month
master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8bb1dfdd323cb7...
Commit: 8bb1dfdd323cb70160f37a2d3a4cba48d5243be7
Parent: 192a83def3095b33b5590d0531d24a26588b4aef
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Mar 24 01:59:35 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Mar 24 01:59:35 2015 +0000
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 8 +++++---
WHATS_NEW_DM | 5 +++--
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/VERSION b/VERSION
index 4f24316..ef6bee0 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.118(2)-git (2015-03-04)
+2.02.118(2)-git (2015-03-24)
diff --git a/VERSION_DM b/VERSION_DM
index 649324d..ca20a0d 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.95-git (2015-03-04)
+1.02.95-git (2015-03-24)
diff --git a/WHATS_NEW b/WHATS_NEW
index c9242fe..558bdb5 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,5 @@
-Version 2.02.118 -
-=================================
+Version 2.02.118 - 23rd March 2015
+==================================
Store metadata size + checksum in lvmcache and add struct lvmcache_vgsummary.
Remove inaccessible clustered PVs from 'pvs -a'.
Don't invalidate cached orphan information while global lock is held.
@@ -14,11 +14,13 @@ Version 2.02.118 -
Avoid reparsing same metadata when reading same metadata from multiple PVs.
Save extra device open/close when scanning device for size.
Fix seg_monitor field to report status also for mirrors and thick snapshots.
+ Replace LVM_WRITE with LVM_WRITE_LOCKED flags in metadata if system ID is set.
+ Remove ACCESS_NEEDS_SYSTEM_ID VG status flag. (2.02.117)
+ Enable system ID features.
Version 2.02.117 - 4th March 2015
=================================
Add CFG_DISABLED for new system ID config settings that must not yet be used.
- Set ACCESS_NEEDS_SYSTEM_ID VG status flag while system_id is set.
Preserve original format type field when processing backup files.
Implement status action for lvm2-monitor initscript to display monitored LVs.
Allow lvchange -p to change kernel state only if metadata state differs.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 9286bc6..08975b6 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
-Version 1.02.95 -
-================================
+Version 1.02.95 - 15th March 2015
+=================================
+ Makefile regenerated.
Version 1.02.94 - 4th March 2015
================================
9 years, 1 month