Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6e7b24d34ff3da1c…
Commit: 6e7b24d34ff3da1c56718bb7def8a8ecd4258c43
Parent: 361e2d8df726e8428ed917939dab54643761b9e4
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Mar 23 13:33:57 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Mar 23 13:40:39 2015 +0100
pvmove: use safe version of iteration when iterating over vg->lvs list in _poll_vg
When we're iterating over LVs in _poll_vg fn, we need to use the safe
version of iteration - the LV can be removed from the list which we're
just iterating over if we're finishing or aborting pvmove operation.
---
tools/polldaemon.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/polldaemon.c b/tools/polldaemon.c
index 10ca4a5..53dab96 100644
--- a/tools/polldaemon.c
+++ b/tools/polldaemon.c
@@ -192,7 +192,7 @@ static int _poll_vg(struct cmd_context *cmd, const char *vgname,
struct volume_group *vg, struct processing_handle *handle)
{
struct daemon_parms *parms = (struct daemon_parms *) handle->custom_handle;
- struct lv_list *lvl;
+ struct lv_list *lvl, *tmp_lvl;
struct logical_volume *lv;
const char *name;
int finished;
@@ -202,7 +202,7 @@ static int _poll_vg(struct cmd_context *cmd, const char *vgname,
return ECMD_FAILED;
}
- dm_list_iterate_items(lvl, &vg->lvs) {
+ dm_list_iterate_items_safe(lvl, tmp_lvl, &vg->lvs) {
lv = lvl->lv;
if (!(lv->status & parms->lv_type))
continue;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=361e2d8df726e842…
Commit: 361e2d8df726e8428ed917939dab54643761b9e4
Parent: 21343ffbfed94f41da11fac4dd056af58f4341a9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 20 11:08:44 2015 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 20 11:08:44 2015 +0100
tests: revert should removal in mirror test
Since cluster test was actually not been working,
removal of should has been premature.
So restore 'should' back - bug in mirror code is still there.
---
test/shell/lvconvert-mirror-updown.sh | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvconvert-mirror-updown.sh b/test/shell/lvconvert-mirror-updown.sh
index ddd34c7..4d401fb 100644
--- a/test/shell/lvconvert-mirror-updown.sh
+++ b/test/shell/lvconvert-mirror-updown.sh
@@ -29,6 +29,9 @@ lvconvert -m+1 -b $vg/$lv1 "$dev3"
lvs -a $vg
-lvconvert -m-1 $vg/$lv1 "$dev2"
+#
+# It fails so use 'should' and -vvvv for now
+#
+should lvconvert -vvvv -m-1 $vg/$lv1 "$dev2"
vgremove -f $vg
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5bf74f2997cedb48…
Commit: 5bf74f2997cedb481e0fac21e3aa30fc61f8e5b1
Parent: 87941ccd1706ac9818f0f4828cade1d4cfae622d
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Mar 18 23:31:46 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Mar 18 23:31:46 2015 +0000
pvs: Hide inaccessible clustered PVs.
Inaccessible clustered PVs can be hidden from pvs -a in the same way as
foreign PVs, rather than showing them as if they do not belong to a VG.
---
WHATS_NEW | 1 +
tools/toollib.c | 15 +++++++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 2e50b18..b182925 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.118 -
=================================
+ Remove inaccessible clustered PVs from 'pvs -a'.
Don't invalidate cached orphan information while global lock is held.
Avoid rescan of all devices when requested pvscan for removed device.
Measure configuration timestamps with nanoseconds when available.
diff --git a/tools/toollib.c b/tools/toollib.c
index 12fe1e2..98e5879 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -175,6 +175,7 @@ const char *skip_dev_dir(struct cmd_context *cmd, const char *vg_name,
* and the command option has been used to ignore clustered vgs.
*
* Case c covers the other errors returned when reading the VG.
+ * If *skip is 1, it's OK for the caller to read the list of PVs in the VG.
*/
static int _ignore_vg(struct volume_group *vg, const char *vg_name,
struct dm_list *arg_vgnames, int allow_inconsistent, int *skip)
@@ -211,7 +212,14 @@ static int _ignore_vg(struct volume_group *vg, const char *vg_name,
}
}
+ if ((read_error == FAILED_CLUSTERED)) {
+ *skip = 1;
+ stack; /* Error already logged */
+ return 1;
+ }
+
if (read_error != SUCCESS) {
+ *skip = 0;
log_error("Cannot process volume group %s", vg_name);
return 1;
}
@@ -2718,8 +2726,11 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t flags,
if (_ignore_vg(vg, vg_name, NULL, flags & READ_ALLOW_INCONSISTENT, &skip)) {
stack;
ret_max = ECMD_FAILED;
- release_vg(vg);
- continue;
+ if (!skip) {
+ release_vg(vg);
+ continue;
+ }
+ /* Drop through to eliminate a clustered VG's PVs from the devices list */
}
/*