X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=block%2Fpartitions%2Fefi.c;h=1eb09ee5311b414e448b28eb26a72f7ff6bbaa1c;hb=6b02fa59a7cf34c548eedee657b07ea6c54d3894;hp=1a5ec9a03c0008d40b07306fcf0a70cf966bfbbb;hpb=02b9735c12892e04d3e101b06e4c6d64a814f566;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git diff --git a/block/partitions/efi.c b/block/partitions/efi.c index 1a5ec9a..1eb09ee 100644 --- a/block/partitions/efi.c +++ b/block/partitions/efi.c @@ -186,6 +186,7 @@ invalid: */ static int is_pmbr_valid(legacy_mbr *mbr, sector_t total_sectors) { + uint32_t sz = 0; int i, part = 0, ret = 0; /* invalid by default */ if (!mbr || le16_to_cpu(mbr->signature) != MSDOS_MBR_SIGNATURE) @@ -216,12 +217,15 @@ check_hybrid: /* * Protective MBRs take up the lesser of the whole disk * or 2 TiB (32bit LBA), ignoring the rest of the disk. + * Some partitioning programs, nonetheless, choose to set + * the size to the maximum 32-bit limitation, disregarding + * the disk size. * * Hybrid MBRs do not necessarily comply with this. */ if (ret == GPT_MBR_PROTECTIVE) { - if (le32_to_cpu(mbr->partition_record[part].size_in_lba) != - min((uint32_t) total_sectors - 1, 0xFFFFFFFF)) + sz = le32_to_cpu(mbr->partition_record[part].size_in_lba); + if (sz != (uint32_t) total_sectors - 1 && sz != 0xFFFFFFFF) ret = 0; } done: