]> sourceware.org Git - lvm2.git/commitdiff
Fix contiguous allocation without preceding segments.
authorAlasdair Kergon <agk@redhat.com>
Thu, 27 Oct 2005 22:20:33 +0000 (22:20 +0000)
committerAlasdair Kergon <agk@redhat.com>
Thu, 27 Oct 2005 22:20:33 +0000 (22:20 +0000)
lib/metadata/lv_manip.c

index d96c77475267d0899650abcca08ac3c8145ee0eb..b069a92bed5292c5a477681cd4c2728682a88723 100644 (file)
@@ -666,12 +666,10 @@ static int _find_parallel_space(struct alloc_handle *ah, alloc_policy_t alloc,
        /* FIXME Do calculations on free extent counts before selecting space */
        /* FIXME Select log PV appropriately if there isn't one yet */
 
-       if ((alloc == ALLOC_CONTIGUOUS)) {
+       /* Are there any preceding segments we must follow on from? */
+       if ((alloc == ALLOC_CONTIGUOUS) && prev_lvseg) {
                contiguous = 1;
-               if (prev_lvseg)
-                       ix_offset = prev_lvseg->area_count;
-               else
-                       ix_offset = ah->area_count;
+               ix_offset = prev_lvseg->area_count;
        }
 
        /* FIXME This algorithm needs a lot of cleaning up! */
This page took 0.088304 seconds and 5 git commands to generate.