From 28cb0299c1ff1435a630fe806701355ad94508ea Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Mon, 18 Aug 2003 13:52:43 +0000 Subject: [PATCH] Missing check for inconsistent VG in pvmove. --- tools/pvmove.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/pvmove.c b/tools/pvmove.c index b027f0f37..c1dafa958 100644 --- a/tools/pvmove.c +++ b/tools/pvmove.c @@ -182,7 +182,7 @@ static struct list *_get_allocatable_pvs(struct cmd_context *cmd, int argc, pvl = list_item(pvh, struct pv_list); if ((pvl->pv->dev == pv->dev) || (pvl->pv->pe_count == pvl->pv->pe_alloc_count)) - list_del(&pvl->list); + list_del(&pvl->list); } if (list_empty(allocatable_pvs)) { @@ -576,6 +576,17 @@ static int _poll_pvmove_vgs(struct cmd_context *cmd, const char *vgname, struct physical_volume *pv; int finished; + if (!vg) { + log_error("Couldn't read volume group %s", vgname); + return ECMD_FAILED; + } + + if (!consistent) { + log_error("Volume Group %s inconsistent - skipping", vgname); + /* FIXME Should we silently recover it here or not? */ + return ECMD_FAILED; + } + if (vg->status & EXPORTED_VG) { log_error("Volume group \"%s\" is exported", vg->name); return ECMD_FAILED;