diff --git a/VERSION b/VERSION index c8f2c74b1..69c27ea7f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.02.40-cvs (2008-09-18) +2.02.41-cvs (2008-09-19) diff --git a/WHATS_NEW b/WHATS_NEW index 639bb5f39..f46874b23 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,3 +1,6 @@ +Version 2.02.41 - +===================================== + Version 2.02.40 - 19th September 2008 ===================================== Allow lvremove to remove LVs from VGs with missing PVs. diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c index c312949ae..50f1f1deb 100644 --- a/daemons/clvmd/lvm-functions.c +++ b/daemons/clvmd/lvm-functions.c @@ -141,8 +141,7 @@ static const char *decode_flags(unsigned char flags) { static char buf[128]; - sprintf(buf, "0x%x (%s%s%s)", flags, - flags & LCK_PARTIAL_MODE ? "PARTIAL " : "", + sprintf(buf, "0x%x (%s%s)", flags, flags & LCK_MIRROR_NOSYNC_MODE ? "MIRROR_NOSYNC " : "", flags & LCK_DMEVENTD_MONITOR_MODE ? "DMEVENTD_MONITOR " : ""); diff --git a/tools/vgreduce.c b/tools/vgreduce.c index a32aa505f..2842a0d77 100644 --- a/tools/vgreduce.c +++ b/tools/vgreduce.c @@ -163,7 +163,9 @@ static int _consolidate_vg(struct cmd_context *cmd, struct volume_group *vg) static int _make_vg_consistent(struct cmd_context *cmd, struct volume_group *vg) { + struct list *pvh, *pvht; struct list *lvh, *lvht; + struct pv_list *pvl; struct lv_list *lvl, *lvl2, *lvlt; struct logical_volume *lv; struct physical_volume *pv; @@ -190,7 +192,8 @@ static int _make_vg_consistent(struct cmd_context *cmd, struct volume_group *vg) /* FIXME Also check for segs on deleted LVs (incl pvmove) */ pv = seg_pv(seg, s); - if (!pv || !pv_dev(pv)) { + if (!pv || !pv_dev(pv) || + (pv->status & MISSING_PV)) { if (arg_count(cmd, mirrorsonly_ARG) && !(lv->status & MIRROR_IMAGE)) { log_error("Non-mirror-image LV %s found: can't remove.", lv->name); @@ -211,8 +214,21 @@ static int _make_vg_consistent(struct cmd_context *cmd, struct volume_group *vg) return 0; } - if (!_consolidate_vg(cmd, vg)) - return_0; + /* + * Remove missing PVs. FIXME: This duplicates _consolidate_vg above, + * but we cannot use that right now, since the LV removal code in this + * function leaves the VG in a "somewhat inconsistent" state and + * _consolidate_vg doesn't like that -- specifically, mirrors are fixed + * up *after* the PVs are removed. All this should be gradually + * superseded by lvconvert --repair. + */ + list_iterate_safe(pvh, pvht, &vg->pvs) { + pvl = list_item(pvh, struct pv_list); + if (pvl->pv->dev) + continue; + if (!_remove_pv(vg, pvl, 0)) + return_0; + } /* FIXME Recovery. For now people must clean up by hand. */