]> sourceware.org Git - lvm2.git/commitdiff
libdm: fix region overlap tests
authorBryn M. Reeves <bmr@redhat.com>
Mon, 12 Dec 2016 22:49:31 +0000 (22:49 +0000)
committerBryn M. Reeves <bmr@redhat.com>
Tue, 13 Dec 2016 09:09:29 +0000 (09:09 +0000)
libdm/libdm-stats.c

index 56a38f27efa566860964f31d759906442cac2101..8c0428ea8c1e6ce81faf2b918c6e83ef3a7a9a86 100644 (file)
@@ -3880,6 +3880,12 @@ static int _stats_group_check_overlap(const struct dm_stats *dms,
                i++;
        }
 
+       /* A single region cannot overlap itself. */
+       if (i == 1) {
+               dm_pool_free(dms->mem, map);
+               return 1;
+       }
+
        /* sort by extent.start */
        qsort(map, count, sizeof(*map), _extent_start_compare);
 
@@ -3915,7 +3921,7 @@ merge:
                goto merge;
 
        dm_pool_free(dms->mem, map);
-       return overlap;
+       return (overlap == 0);
 }
 
 static void _stats_copy_histogram_bounds(struct dm_histogram *to,
This page took 0.038112 seconds and 5 git commands to generate.