From e178963c0bb30a38f1e276693d0011404a2de679 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Wed, 9 Nov 2005 23:56:36 +0000 Subject: [PATCH] workaround for pvmove with new activation code --- lib/activate/dev_manager.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index 3da41d343..8cb10f4d0 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -622,6 +622,8 @@ static struct dm_tree *_create_partial_dtree(struct dev_manager *dm, struct logi { struct dm_tree *dtree; struct list *snh, *snht; + struct lv_segment *seg; + uint32_t s; if (!(dtree = dm_tree_create())) { log_error("Partial dtree creation failed for %s.", lv->name); @@ -640,6 +642,16 @@ static struct dm_tree *_create_partial_dtree(struct dev_manager *dm, struct logi goto fail; } + /* Add any LVs used by segments in this LV */ + list_iterate_items(seg, &lv->segments) + for (s = 0; s < seg->area_count; s++) + if (seg_type(seg, s) == AREA_LV && seg_lv(seg, s)) { + if (!_add_lv_to_dtree(dm, dtree, seg_lv(seg, s))) { + stack; + goto fail; + } + } + return dtree; fail: @@ -976,7 +988,7 @@ static int _tree_action(struct dev_manager *dm, struct logical_volume *lv, actio goto_out; /* Preload any devices required before any suspensions */ - if (!dm_tree_preload_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1, (lv->status & LOCKED) ? 0 : 1)) + if (!dm_tree_preload_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1)) goto_out; if ((action == ACTIVATE) && @@ -1011,6 +1023,10 @@ int dev_manager_activate(struct dev_manager *dm, struct logical_volume *lv) int dev_manager_preload(struct dev_manager *dm, struct logical_volume *lv) { + /* FIXME Update the pvmove implementation! */ + if ((lv->status & PVMOVE) || (lv->status & LOCKED)) + return 1; + return _tree_action(dm, lv, PRELOAD); }