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

[lvm-devel] [PATCH 3/4] Do not check already checked part

check_lv_segments is eithe called once - with 'complete_vg == 0'
or twice in row first with == 0, then with 1.

My assumtion is we do not need to make the same tests for same data
pointers twice - if we already know it's been been OK from the
first pass - that way it's used in vg_validate() and vg_read_internal().

Better idea would be probably to make rather 2 separte functions
there - but for now just skip some large piece of the code.

Signed-off-by: Zdenek Kabelac <zkabelac redhat com>
 lib/metadata/merge.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/metadata/merge.c b/lib/metadata/merge.c
index 3b8895c..402ee57 100644
--- a/lib/metadata/merge.c
+++ b/lib/metadata/merge.c
@@ -209,6 +209,9 @@ int check_lv_segments(struct logical_volume *lv, int complete_vg)
 		le += seg->len;
+	if (complete_vg)
+		goto out;
 	dm_list_iterate_items(sl, &lv->segs_using_this_lv) {
 		seg = sl->seg;
 		seg_found = 0;

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