summaryrefslogtreecommitdiffstats
path: root/misc-utils/blkid.c
diff options
context:
space:
mode:
authorKarel Zak2011-10-21 00:12:47 +0200
committerKarel Zak2011-10-21 00:37:06 +0200
commit6a2f2f58a428890a33b382876bab78c608cc7c1c (patch)
tree9e9ea800c2e0702c08315f163623e14e1e7a436f /misc-utils/blkid.c
parentswitch_root: handle /run and do not mount over existing mounts (diff)
downloadkernel-qcow2-util-linux-6a2f2f58a428890a33b382876bab78c608cc7c1c.tar.gz
kernel-qcow2-util-linux-6a2f2f58a428890a33b382876bab78c608cc7c1c.tar.xz
kernel-qcow2-util-linux-6a2f2f58a428890a33b382876bab78c608cc7c1c.zip
blkid: print ID_PART_ENTRY_* for small devices
The current optimization for small devices (1.4MiB) is broken. It checks for partition table, but if nothing is detected then details (ID_PART_ENTRY_*) about the current partition are not gathered. The optimization should be enabled for small *whole* disks only. Reported-by: David Zeuthen <davidz@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/blkid.c')
-rw-r--r--misc-utils/blkid.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/misc-utils/blkid.c b/misc-utils/blkid.c
index 3608304a5..0ff89d66f 100644
--- a/misc-utils/blkid.c
+++ b/misc-utils/blkid.c
@@ -454,9 +454,9 @@ static int lowprobe_superblocks(blkid_probe pr)
return -1;
blkid_probe_enable_partitions(pr, 1);
- blkid_probe_set_partitions_flags(pr, BLKID_PARTS_ENTRY_DETAILS);
- if (!S_ISCHR(st.st_mode) && blkid_probe_get_size(pr) <= 1024 * 1440) {
+ if (!S_ISCHR(st.st_mode) && blkid_probe_get_size(pr) <= 1024 * 1440 &&
+ blkid_probe_is_wholedisk(pr)) {
/*
* check if the small disk is partitioned, if yes then
* don't probe for filesystems.
@@ -469,11 +469,9 @@ static int lowprobe_superblocks(blkid_probe pr)
if (blkid_probe_lookup_value(pr, "PTTYPE", NULL, NULL) == 0)
return 0; /* partition table detected */
-
- /* small whole-disk is unpartitioned, probe for filesystems only */
- blkid_probe_enable_partitions(pr, 0);
}
+ blkid_probe_set_partitions_flags(pr, BLKID_PARTS_ENTRY_DETAILS);
blkid_probe_enable_superblocks(pr, 1);
return blkid_do_safeprobe(pr);