From 38a8b563bf50d6ac4a63416a5897460615c07fbb Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 13 Aug 2008 13:42:35 +0000 Subject: [PATCH] get lv_list properly from vg->lst and fix compiler warning --- lib/metadata/metadata.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index ec7b42a08..fc90adfa1 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -296,11 +296,14 @@ static int remove_lvs_in_vg(struct cmd_context *cmd, struct volume_group *vg, force_t force) { + struct list *lst; struct lv_list *lvl; - while ((lvl = list_first(&vg->lvs))) + while ((lst = list_first(&vg->lvs))) { + lvl = list_item(lst, struct lv_list); if (!lv_remove_with_dependencies(cmd, lvl->lv, force)) - return 0; + return 0; + } return 1; }