From 5689113d8807820a7f4279a07157f5a3b4c7ad9a Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 18 Feb 2010 16:19:31 +0100 Subject: [PATCH] libblkid: don't probe for nested PT on tiny disks (<=1.44MiB) Signed-off-by: Karel Zak --- shlibs/blkid/src/partitions/dos.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/shlibs/blkid/src/partitions/dos.c b/shlibs/blkid/src/partitions/dos.c index ec2ca1eb..f3e8a198 100644 --- a/shlibs/blkid/src/partitions/dos.c +++ b/shlibs/blkid/src/partitions/dos.c @@ -221,25 +221,26 @@ static int probe_dos_pt(blkid_probe pr, const struct blkid_idmag *mag) goto err; } - /* Parse subtypes (nested partitions) */ - for (p = p0, i = 0; i < 4; i++, p++) { - int n; - - if (!dos_partition_size(p) || is_extended(p)) - continue; + /* Parse subtypes (nested partitions) on large disks */ + if (!blkid_probe_is_tiny(pr)) { + for (p = p0, i = 0; i < 4; i++, p++) { + int n; - for (n = 0; n < ARRAY_SIZE(dos_nested); n++) { - if (dos_nested[n].type != p->sys_type) + if (!dos_partition_size(p) || is_extended(p)) continue; - if (blkid_partitions_do_subprobe(pr, - blkid_partlist_get_partition(ls, i), - dos_nested[n].id) == -1) - goto err; - break; + for (n = 0; n < ARRAY_SIZE(dos_nested); n++) { + if (dos_nested[n].type != p->sys_type) + continue; + + if (blkid_partitions_do_subprobe(pr, + blkid_partlist_get_partition(ls, i), + dos_nested[n].id) == -1) + goto err; + break; + } } } - return 0; nothing: -- 2.39.5