From cfd3d9413bbc66d6491eb0c31014f2883192bd8b Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 25 Jan 2012 09:17:15 +0000 Subject: [PATCH] Thin skip activation when there are no thin message If the list with thin messages is empty, do not touch thin pool device. --- lib/metadata/thin_manip.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c index 8b8e8a024..4eaf3594c 100644 --- a/lib/metadata/thin_manip.c +++ b/lib/metadata/thin_manip.c @@ -371,6 +371,9 @@ int update_pool_lv(struct logical_volume *lv, int activate) return 0; } + if (dm_list_empty(&(first_seg(lv)->thin_messages))) + return 1; /* No messages */ + if (activate) { /* If the pool is not active, do activate deactivate */ if (!lv_is_active(lv)) { @@ -389,14 +392,12 @@ int update_pool_lv(struct logical_volume *lv, int activate) } } - if (!dm_list_empty(&first_seg(lv)->thin_messages)) { - dm_list_init(&first_seg(lv)->thin_messages); + dm_list_init(&(first_seg(lv)->thin_messages)); - if (!vg_write(lv->vg) || !vg_commit(lv->vg)) - return_0; + if (!vg_write(lv->vg) || !vg_commit(lv->vg)) + return_0; - backup(lv->vg); - } + backup(lv->vg); return 1; }