diff options
author | Karel Zak | 2010-05-18 12:13:48 +0200 |
---|---|---|
committer | Karel Zak | 2010-05-18 15:22:17 +0200 |
commit | 66d8e050ca3c243094545ce8b0e4c53d54a11715 (patch) | |
tree | 7e2e401feb34746a5501cbae7cf46f2459bd9753 /shlibs/blkid/src/partitions | |
parent | libblkid: tiny change in debug output (diff) | |
download | kernel-qcow2-util-linux-66d8e050ca3c243094545ce8b0e4c53d54a11715.tar.gz kernel-qcow2-util-linux-66d8e050ca3c243094545ce8b0e4c53d54a11715.tar.xz kernel-qcow2-util-linux-66d8e050ca3c243094545ce8b0e4c53d54a11715.zip |
libblkid: improve MD 0.90 detection
We don't have to check for collision between partition table and RAID
on all RAIDs. This problem is specific to MD, where underlying device
could be a partition. The RAIDs like via, intel, ... always use
whole-disks only.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/blkid/src/partitions')
-rw-r--r-- | shlibs/blkid/src/partitions/partitions.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/shlibs/blkid/src/partitions/partitions.c b/shlibs/blkid/src/partitions/partitions.c index c670cc183..5597181a9 100644 --- a/shlibs/blkid/src/partitions/partitions.c +++ b/shlibs/blkid/src/partitions/partitions.c @@ -829,6 +829,19 @@ int blkid_probe_is_covered_by_pt(blkid_probe pr, end = (offset + size) >> 9; start = offset >> 9; + /* check if the partition table fits into the device */ + for (i = 0; i < nparts; i++) { + blkid_partition par = &ls->parts[i]; + + if (par->start + par->size > pr->size) { + DBG(DEBUG_LOWPROBE, printf("partition #%d overflows " + "device (off=%lu size=%lu)\n", + par->partno, par->start, par->size)); + goto done; + } + } + + /* check if the requested area is covered by PT */ for (i = 0; i < nparts; i++) { blkid_partition par = &ls->parts[i]; |