From 0dbd22124b0a8c3f48aa0a0a9e1bf43281f4ead0 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Wed, 10 Jul 2002 13:54:17 +0000 Subject: [PATCH] Merge adjacent "Missing" segments. --- lib/format1/import-extents.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/format1/import-extents.c b/lib/format1/import-extents.c index 84791b583..13f5d9304 100644 --- a/lib/format1/import-extents.c +++ b/lib/format1/import-extents.c @@ -226,7 +226,8 @@ static int _read_linear(struct pool *mem, struct lv_map *lvm) seg->len++; while ((lvm->map[le + seg->len].pv == seg->area[0].pv) && - (lvm->map[le + seg->len].pe == seg->area[0].pe + + (seg->area[0].pv && + lvm->map[le + seg->len].pe == seg->area[0].pe + seg->len)); le += seg->len; @@ -249,7 +250,8 @@ static int _check_stripe(struct lv_map *lvm, struct stripe_segment *seg, */ for (st = 0; st < seg->stripes; st++) if ((lvm->map[le + st * len].pv != seg->area[st].pv) || - (lvm->map[le + st * len].pe != seg->area[st].pe + seg->len)) + (seg->area[st].pv && + lvm->map[le + st * len].pe != seg->area[st].pe + seg->len)) return 0; return 1;