]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: ignore nested BSD partitions if same like parent
authorKarel Zak <kzak@redhat.com>
Tue, 5 Mar 2013 12:40:32 +0000 (13:40 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 11 Mar 2013 12:00:57 +0000 (13:00 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/partitions/bsd.c

index ee15ad2fe9709dff7e17dafc1cac2627aed0ff9a..c39c78aa45cd70260cb88e14295ffba190e0961b 100644 (file)
@@ -174,6 +174,13 @@ static int probe_bsd_pt(blkid_probe pr, const struct blkid_idmag *mag)
                start = le32_to_cpu(p->p_offset);
                size = le32_to_cpu(p->p_size);
 
+               if (parent && blkid_partition_get_start(parent) == start
+                          && blkid_partition_get_size(parent) == size) {
+                       DBG(DEBUG_LOWPROBE, printf(
+                               "WARNING: BSD partition (%d) same like parent, "
+                               "ignore\n", i));
+                       continue;
+               }
                if (parent && !blkid_is_nested_dimension(parent, start, size)) {
                        DBG(DEBUG_LOWPROBE, printf(
                                "WARNING: BSD partition (%d) overflow "