[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH 1/3] Fix mem



Fix release order when some data reference are moved
between pools - as data are move 'from -> to'
we just need to ensure 'from' pool will be released
as the last.

Signed-off-by: Zdenek Kabelac <zkabelac redhat com>
---
 tools/vgmerge.c |    6 ++++--
 tools/vgsplit.c |    6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/vgmerge.c b/tools/vgmerge.c
index adb00a0..e4431be 100644
--- a/tools/vgmerge.c
+++ b/tools/vgmerge.c
@@ -155,8 +155,10 @@ bad:
 		unlock_and_free_vg(cmd, vg_to, vg_name_to);
 		unlock_and_free_vg(cmd, vg_from, vg_name_from);
 	} else {
-		unlock_and_free_vg(cmd, vg_from, vg_name_from);
-		unlock_and_free_vg(cmd, vg_to, vg_name_to);
+		unlock_vg(cmd, vg_name_from);
+		unlock_vg(cmd, vg_name_to);
+		free_vg(vg_to);
+		free_vg(vg_from);
 	}
 	return r;
 }
diff --git a/tools/vgsplit.c b/tools/vgsplit.c
index b97db97..f30c335 100644
--- a/tools/vgsplit.c
+++ b/tools/vgsplit.c
@@ -491,8 +491,10 @@ bad:
 		unlock_and_free_vg(cmd, vg_to, vg_name_to);
 		unlock_and_free_vg(cmd, vg_from, vg_name_from);
 	} else {
-		unlock_and_free_vg(cmd, vg_from, vg_name_from);
-		unlock_and_free_vg(cmd, vg_to, vg_name_to);
+		unlock_vg(cmd, vg_name_from);
+		unlock_vg(cmd, vg_name_to);
+		free_vg(vg_to);
+		free_vg(vg_from);
 	}
 	return r;
 }
-- 
1.7.4.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]