From e0a86d8c1896ecefcbfb884e9857a0b958bef703 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Wed, 12 May 2004 20:43:34 +0000 Subject: [PATCH] Ensure presence of virtual targets before attempting activation. --- WHATS_NEW | 2 ++ lib/activate/dev_manager.c | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index 4776c6460..e3b32e74e 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,7 @@ Version 2.00.16 - ============================= + Ensure presence of virtual targets before attempting activating. + Attempt to fix resizing of snapshot origins. Restructure lvresize, bringing it closer to lvcreate. A quick sanity check on vg_disk struct when read in. More checks needed. Only include visible LVs in active/open counts. diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index bb022ab92..778fe5ab9 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -2048,8 +2048,9 @@ static int _remove_suspended_lvs(struct dev_manager *dm, static int _targets_present(struct dev_manager *dm, struct list *lvs) { struct logical_volume *lv; - struct list *lvh; + struct list *lvh, *segh; struct segment_type *segtype; + struct lv_segment *seg; int snapshots = 0, mirrors = 0; list_iterate(lvh, lvs) { @@ -2062,6 +2063,20 @@ static int _targets_present(struct dev_manager *dm, struct list *lvs) if (!mirrors) if (lv->status & PVMOVE) mirrors = 1; + + if (lv->status & VIRTUAL) { + list_iterate(segh, &lv->segments) { + seg = list_item(segh, struct lv_segment); + if (seg->segtype->ops->target_present && + !seg->segtype->ops->target_present()) { + log_error("Can't expand LV: %s target " + "support missing " + "from kernel?", + seg->segtype->name); + return 0; + } + } + } } if (mirrors) {